当客户端更新用户设置时,不需要再通知修改的端重新更新

This commit is contained in:
imhao183
2021-05-14 09:28:05 +08:00
parent cdc7f0893c
commit 40e9d108ad
4 changed files with 17 additions and 10 deletions
@@ -465,14 +465,21 @@ public class MessagesPublisher {
publishNotification(topic, receiver, head, null, null);
}
public void publishNotification(String topic, String receiver, long head, String fromUser, String pushContent) {
publishNotificationLocal(topic, receiver, head, fromUser, pushContent);
public void publishNotification(String topic, String receiver, long head, String exceptClientId) {
publishNotification(topic, receiver, head, null, null, exceptClientId);
}
void publishNotificationLocal(String topic, String receiver, long head, String fromUser, String pushContent) {
public void publishNotification(String topic, String receiver, long head, String fromUser, String pushContent) {
publishNotification(topic, receiver, head, fromUser, pushContent, null);
}
public void publishNotification(String topic, String receiver, long head, String fromUser, String pushContent, String exceptClientId) {
Collection<Session> sessions = m_sessionsStore.sessionForUser(receiver);
String fromUserName = null;
for (Session targetSession : sessions) {
if(targetSession.getClientID().equals(exceptClientId)) {
continue;
}
boolean needPush = !StringUtil.isNullOrEmpty(pushContent);
boolean targetIsActive = this.connectionDescriptors.isConnected(targetSession.getClientSession().clientID);
if (targetIsActive) {