From e88da25c22d4ce7d266cf8721c32452c70c016f0 Mon Sep 17 00:00:00 2001 From: imndx Date: Wed, 16 Dec 2020 21:59:00 +0800 Subject: [PATCH] fix insertMessage notify issue. fix #490 --- client/src/main/java/cn/wildfirechat/remote/ChatManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/main/java/cn/wildfirechat/remote/ChatManager.java b/client/src/main/java/cn/wildfirechat/remote/ChatManager.java index 8d8f8c748..59eed1092 100644 --- a/client/src/main/java/cn/wildfirechat/remote/ChatManager.java +++ b/client/src/main/java/cn/wildfirechat/remote/ChatManager.java @@ -1412,6 +1412,9 @@ public Message insertMessage(Conversation conversation, String sender, MessageCo try { message = mClient.insertMessage(message, notify); + if (notify) { + onReceiveMessage(Collections.singletonList(message), false); + } } catch (RemoteException e) { e.printStackTrace(); return null; @@ -2232,6 +2235,7 @@ public void onFailure(int errorCode) throws RemoteException { mainHandler.post(() -> callback.onFail(ErrorCode.SERVICE_EXCEPTION)); } } + /** * 获取会话消息 *