Commit 7d2e8465 by Future

代码调试

parent 89ead4c4
......@@ -171,7 +171,7 @@ public class NormalChatAction {
ImMessageOnlineSend imMessageOnlineSend = assembleImMessageOnlineSend(data, imClientSender, imApplication.getId());
// 入库 保存收件箱
batchSaveInbox(imApplication, conversation, imMessageOnlineSend.getMsgId(), membersList);
batchSaveInbox(imApplication, imClientSender, conversation, imMessageOnlineSend.getMsgId(), membersList);
// 入库成功后 判断是否是临时会话 如果是,双方会话display状态是否是1(显示),如果不是,需要修改为是
if (ChatTypeEnum.TEMP.getCode().equals(conversation.getChatType())) {
// 木有只有私聊一种临时会话类型
......@@ -301,10 +301,13 @@ public class NormalChatAction {
* @param messageId
* @param membersList
*/
private void batchSaveInbox(ImApplication imApplication, ImConversationQueryVo conversation, long messageId,
private void batchSaveInbox(ImApplication imApplication, ImClient clientSender, ImConversationQueryVo conversation, long messageId,
List<ImConversationMembers> membersList) {
List<ImInbox> inboxes = Lists.newArrayList();
for (ImConversationMembers member : membersList) {
if (clientSender.getClientId().equals(member.getClientId())) {
continue;
}
ImInbox imInbox = new ImInbox();
imInbox.setId(SnowflakeUtil.getId());
imInbox.setCreateTime(new Date());
......@@ -316,7 +319,9 @@ public class NormalChatAction {
imInbox.setFkConversationId(conversation.getId());
inboxes.add(imInbox);
}
imInboxService.saveBatch(inboxes);
if (CollectionUtils.isNotEmpty(inboxes)) {
imInboxService.saveBatch(inboxes);
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment