From 99bbffed217d097af202665a7554fbc1bf539cd8 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 26 Mar 2024 16:43:34 +0800 Subject: [PATCH] =?UTF-8?q?fix=20[=E8=B7=A8=E8=AE=BE=E5=A4=87=E5=B7=B2?= =?UTF-8?q?=E8=AF=BB=E6=B6=88=E6=81=AF=E4=BE=9D=E6=97=A7=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/shayu/phonelive/AppContext.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index 192cab2..c1f1fe2 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -284,10 +284,25 @@ public class AppContext extends CommonAppContext { if (message.getReceivedStatus().isRead()) { return false; } - MessageChatNotifyManager.getInstance().push(AppManager.getInstance().getLastActivity() - , message.getTargetId(), - content.getContent() - ); + + RongIMClient.getInstance().getUnreadCount(Conversation.ConversationType.PRIVATE, message.getTargetId(), new RongIMClient.ResultCallback() { + @Override + public void onSuccess(Integer integer) { + if (integer > 0) { + MessageChatNotifyManager.getInstance().push(AppManager.getInstance().getLastActivity() + , message.getTargetId(), + content.getContent() + ); + } + } + + @Override + public void onError(RongIMClient.ErrorCode e) { + + } + }); + + } } } catch (Exception e) {