Skip to content

Commit 7178b70

Browse files
guangyaoguangyao
authored andcommitted
Fix免打扰开关后刷新最近会话列表
1 parent 8e3cb16 commit 7178b70

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

ios/RNNeteaseIm/RNNeteaseIm/NIMModel.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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{

ios/RNNeteaseIm/RNNeteaseIm/NIMViewController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

ios/RNNeteaseIm/RNNeteaseIm/NIMViewController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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{

ios/RNNeteaseIm/RNNeteaseIm/RNNeteaseIm.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,20 +219,30 @@ - (dispatch_queue_t)methodQueue
219219
}
220220
//开启/关闭群组消息提醒
221221
RCT_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
//好友消息提醒开关
229231
RCT_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
//解散群
237247
RCT_EXPORT_METHOD(dismissTeam:(nonnull NSString *)teamId resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject){
238248
[[TeamViewController initWithTeamViewController] dismissTeam:teamId Succ:^(id param) {

0 commit comments

Comments
 (0)