解决移动平台多端未收消息计数重复的问题

This commit is contained in:
heavyrian2012
2025-11-20 11:41:54 +08:00
parent b65282f8e2
commit 554243d553
@@ -230,6 +230,7 @@ public class MessagesPublisher {
}
}
boolean unreadCountIncreased = false;
for (Session targetSession : sessions) {
//超过7天不活跃的用户忽略
if(System.currentTimeMillis() - targetSession.getLastActiveTime() > m_messagesStore.getPushExpiredTimes()) {
@@ -314,8 +315,9 @@ public class MessagesPublisher {
}
if (!StringUtil.isNullOrEmpty(pushContent) || messageContentType == 400) {
if (!isConvSilent && (persistFlag & 0x02) > 0) {
if (!isConvSilent && (persistFlag & 0x02) > 0 && !unreadCountIncreased) {
m_messagesStore.increaseUnreceivedMsgCount(user);
unreadCountIncreased = true;
}
}
}