修复bug

This commit is contained in:
liyuhua
2023-12-12 11:53:14 +08:00
parent af64bafcfe
commit 06eacbb38f
6 changed files with 23 additions and 7 deletions

View File

@@ -31,7 +31,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"

View File

@@ -14,7 +14,7 @@
///Tool
#import "UIImage+Utils.h"
NSString *const adImageName = @"adImageName";
NSString *const adUrl = @"adUrl";
// 广
static int const showtime = 3;

View File

@@ -645,7 +645,11 @@
[[NIMSDK sharedSDK].conversationManager markAllMessagesReadInSession:self.session];
}
- (void)onRecvRevokeMessageNotification:(NIMRevokeMessageNotification *)notification{
[[NIMSDK sharedSDK].conversationManager deleteMessage:notification.message];
}
- (void)sendMessage:(NIMMessage *)message didCompleteWithError:(NSError *)error {
if (message.session.sessionType != NIMSessionTypeP2P) {
return;

View File

@@ -27,7 +27,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
#import <Masonry/Masonry.h>
@interface SessionListViewController ()<UITableViewDataSource, UITableViewDelegate, NIMLoginManagerDelegate, NIMConversationManagerDelegate, XPSessionListHeadViewDelegate>
@interface SessionListViewController ()<UITableViewDataSource, UITableViewDelegate, NIMLoginManagerDelegate, NIMConversationManagerDelegate, XPSessionListHeadViewDelegate,NIMChatManagerDelegate>
@property (nonatomic, strong) XPSessionListHeadView *headView;
/**
@@ -54,6 +54,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
- (void)dealloc {
[[NIMSDK sharedSDK].conversationManager removeDelegate:self];
[[NIMSDK sharedSDK].loginManager removeDelegate:self];
[[NIMSDK sharedSDK].chatManager removeDelegate:self];
}
- (BOOL)isHiddenNavBar {
@@ -98,6 +99,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
[self initDatas];
[[NIMSDK sharedSDK].conversationManager addDelegate:self];
[[NIMSDK sharedSDK].loginManager addDelegate:self];
[[NIMSDK sharedSDK].chatManager addDelegate:self];
///
[[NIMSDKConfig sharedConfig] setShouldSyncStickTopSessionInfos:YES];
}
@@ -293,7 +295,15 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
[self.sessionListView reloadData];
[self setTabBarItemBadge:totalUnreadCount];
}
- (void)onRecvRevokeMessageNotification:(NIMRevokeMessageNotification *)notification{
for (NIMRecentSession *recent in self.recentSessions) {
if ([recent.session.sessionId isEqualToString:notification.session.sessionId]) {
id<NIMConversationManager> manager = [[NIMSDK sharedSDK] conversationManager];
[manager deleteRecentSession:recent];
break;
}
}
}
- (void)didUpdateRecentSession:(NIMRecentSession *)recentSession
totalUnreadCount:(NSInteger)totalUnreadCount {
if(self.openType != SessionListOpenTypeRoom && [[ClientConfig shareConfig].configInfo.officialMsgUids containsObject:recentSession.session.sessionId]) {

View File

@@ -72,7 +72,8 @@
self.avatarImageView.imageUrl = avatarUrl;
self.nickLabel.text = user.userInfo.nickName;
[self.nickLabel sizeToFit];
self.contentLabel.text = [NIMMessageUtils messageContent:session.lastMessage];
// self.contentLabel.text = [NIMMessageUtils messageContent:session.lastMessage];
self.contentLabel.text = @"收到一条新消息";
}
}
@@ -103,6 +104,7 @@
_contentLabel = [[UILabel alloc] init];
_contentLabel.font = [UIFont systemFontOfSize:10];
_contentLabel.textColor = [ThemeColor mainTextColor];
_contentLabel.adjustsFontSizeToFitWidth = YES;
}
return _contentLabel;
}

View File

@@ -157,7 +157,7 @@
} roomUid:self.roomUid targetUid:member.userId opt:@"1" isSet:@(NO)];
}else{
NIMChatroomMemberUpdateRequest *request = [[NIMChatroomMemberUpdateRequest alloc]init];
request.roomId = self.roomUid;
request.roomId = self.roomId;
request.userId = member.userId;
request.enable = NO;
[[NIMSDK sharedSDK].chatroomManager markMemberManager:request completion:^(NSError * _Nullable error) {