清除全部未读数

This commit is contained in:
18401019693 2022-09-05 14:54:21 +08:00
parent 52363a887d
commit ef9c218f87
2 changed files with 10 additions and 7 deletions

View File

@ -192,7 +192,7 @@ public class PDLiveConversationListActivity extends AbsActivity implements View.
container.post(new Runnable() {
@Override
public void run() {
showGuideView();
// showGuideView();
}
});
}
@ -418,7 +418,9 @@ public class PDLiveConversationListActivity extends AbsActivity implements View.
.setMessageReadAll(new com.yunbao.common.http.base.HttpCallback<String>() {
@Override
public void onSuccess(String data) {
textNewsNotice.setVisibility(View.GONE);
textNewsInteraction.setVisibility(View.GONE);
textNewsOnline.setVisibility(View.GONE);
}
@Override
@ -427,6 +429,8 @@ public class PDLiveConversationListActivity extends AbsActivity implements View.
}
});
// IMCenter.getInstance().clearMessagesUnreadStatus();
MessageIMManager.get(mContext).setSystemNumber(0);
EventBus.getDefault().post(new MessageIMEvent().setNumber(0));
}
@Override

View File

@ -286,11 +286,11 @@ public class ConversationIMListManager {
RongIMClient.getInstance().getConversationListByPage(new RongIMClient.ResultCallback<List<Conversation>>() {
@Override
public void onSuccess(List<Conversation> conversations) {
if (conversations.size() < 10) {
if (conversations != null && conversations.size() < 10) {
if (!clearMessages) {
for (Conversation conversation : conversations) {
UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(conversation.getTargetId());
if (!TextUtils.isEmpty(userInfo.getExtra())) {
if (userInfo != null && !TextUtils.isEmpty(userInfo.getExtra())) {
IMLoginModel model = GsonUtils.fromJson(userInfo.getExtra(), IMLoginModel.class);
if (TextUtils.equals(model.getIsAdmin(), "1")) {
targetId = userInfo.getUserId();
@ -299,11 +299,10 @@ public class ConversationIMListManager {
}
} else {
for (Conversation conversation : conversations) {
RongIMClient.getInstance()
IMCenter.getInstance()
.clearMessagesUnreadStatus(
Conversation.ConversationType.PRIVATE,
conversation.getTargetId(),
conversation.getSentTime(), null);
conversation.getTargetId(), null);
}
}