File tree Expand file tree Collapse file tree 4 files changed +15
-1
lines changed
ios/RNNeteaseIm/RNNeteaseIm Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,9 @@ -(void)setNotiArr:(NSMutableArray *)notiArr{
5454 self.myBlock (5 , notiArr);
5555}
5656-(void )setTeamArr : (NSMutableArray *)teamArr {
57- self.myBlock (4 , teamArr);
57+ if (teamArr.count ) {
58+ self.myBlock (4 , teamArr);
59+ }
5860}
5961// 未读条数
6062-(void )setUnreadCount : (NSInteger )unreadCount {
Original file line number Diff line number Diff line change @@ -18,4 +18,5 @@ typedef void(^ERROR)(NSString *error);
1818// 获取最近聊天列表回调
1919-(void )getRecentContactListsuccess : (SUCCESS)suc andError : (ERROR)err ;
2020-(void )addDelegate ;
21+ - (void )getResouces ;
2122@end
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ - (void)viewDidLoad {
3838 [super viewDidLoad ];
3939 // Do any additional setup after loading the view.
4040}
41+
4142// 监听网络
4243#pragma mark - NIMLoginManagerDelegate
4344- (void )onLogin : (NIMLoginStep)step {
Original file line number Diff line number Diff line change @@ -219,20 +219,30 @@ - (dispatch_queue_t)methodQueue
219219}
220220// 开启/关闭群组消息提醒
221221RCT_EXPORT_METHOD (setTeamNotify:(nonnull NSString *)teamId needNotify:(nonnull NSString *)needNotify resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject){
222+ __weak typeof (self)weakSelf = self;
222223 [[TeamViewController initWithTeamViewController ]muteTeam:teamId mute: needNotify Succ: ^(id param) {
223224 resolve (param);
225+ [weakSelf updateMessageList ];
224226 } Err: ^(id erro) {
225227 reject (@" -1" ,erro,nil );
226228 }];
227229}
228230// 好友消息提醒开关
229231RCT_EXPORT_METHOD (setMessageNotify:(nonnull NSString *)contactId needNotify:(nonnull NSString *)needNotify resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject){
232+ __weak typeof (self)weakSelf = self;
230233 [[ConversationViewController initWithConversationViewController ]muteMessage:contactId mute: needNotify Succ: ^(id param) {
231234 resolve (param);
235+ [weakSelf updateMessageList ];
232236 } Err: ^(id erro) {
233237 reject (@" -1" ,erro,nil );
234238 }];
235239}
240+ // 刷新最近会话列表
241+ - (void )updateMessageList {
242+ [[NIMViewController initWithController ]getResouces];
243+ NSLog (@" ---updateMessageList" );
244+ }
245+
236246// 解散群
237247RCT_EXPORT_METHOD (dismissTeam:(nonnull NSString *)teamId resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject){
238248 [[TeamViewController initWithTeamViewController ] dismissTeam: teamId Succ: ^(id param) {
You can’t perform that action at this time.
0 commit comments