diff --git a/common/src/main/java/com/yunbao/common/event/MessageIMEvent.java b/common/src/main/java/com/yunbao/common/event/MessageIMEvent.java index 39aeed9f9..c26ad14fa 100644 --- a/common/src/main/java/com/yunbao/common/event/MessageIMEvent.java +++ b/common/src/main/java/com/yunbao/common/event/MessageIMEvent.java @@ -7,6 +7,16 @@ import com.yunbao.common.bean.BaseModel; */ public class MessageIMEvent extends BaseModel { private int number = 0; + private int message = 0; + + public int getMessage() { + return message; + } + + public MessageIMEvent setMessage(int message) { + this.message = message; + return this; + } public int getNumber() { return number; diff --git a/common/src/main/java/com/yunbao/common/manager/imrongcloud/MessageIMManager.java b/common/src/main/java/com/yunbao/common/manager/imrongcloud/MessageIMManager.java index c5ff92f16..8d3554fdd 100644 --- a/common/src/main/java/com/yunbao/common/manager/imrongcloud/MessageIMManager.java +++ b/common/src/main/java/com/yunbao/common/manager/imrongcloud/MessageIMManager.java @@ -181,7 +181,7 @@ public class MessageIMManager { //整合未读消息数目并且发送出去 private final Runnable essagesRunnable = () -> { number = imNumber + systemNumber; - EventBus.getDefault().post(new MessageIMEvent().setNumber(number)); + EventBus.getDefault().post(new MessageIMEvent().setNumber(number).setMessage(imNumber)); }; /** diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 1a3164a28..c14cd2757 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -146,7 +146,7 @@ [語音] [位置] 消息 - 信息中心 + 消息中心 忽略未讀 已忽略未讀消息 消息發送失敗 diff --git a/live/src/main/java/com/yunbao/live/activity/PDLIiveChatActivity.java b/live/src/main/java/com/yunbao/live/activity/PDLIiveChatActivity.java index a57ef0f4d..fc92c0311 100644 --- a/live/src/main/java/com/yunbao/live/activity/PDLIiveChatActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/PDLIiveChatActivity.java @@ -109,21 +109,7 @@ public class PDLIiveChatActivity extends FragmentActivity { */ private void initData() { IMLoginManager.get(mContext).checkInstructor(); -// //获取系统消息列表 -// ImHttpUtil.getImUserInfo("", new HttpCallback() { -// @Override -// public void onSuccess(int code, String msg, String[] info) { -// if (code == 0) { -// container.post(new Runnable() { -// @Override -// public void run() { -// List listUserBean = JSON.parseArray(Arrays.toString(info), ImUserBean.class); -// addSystemMessagesView(listUserBean); -// } -// }); -// } -// } -// }); + //刷新列表内用户信息 addUserInfoProvider(); diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index f978d3171..3a96bd73d 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -439,7 +439,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) public void onMessageIMEvent(MessageIMEvent event) { //判断消息中心红点是否已经展示,如果已经展示并且未读消息大于0则不再执行之后的逻辑 - int number = event.getNumber(); + int number = event.getMessage(); if (v_msg_redpoint.getVisibility() == View.VISIBLE && number > 0 || SpUtil.getInstance().getBooleanValue("private_chat_message_switch")) return; if (number > 0) { v_msg_redpoint.setVisibility(View.VISIBLE);