Commit 2f5e087c by Future

聊天室群成员数量fix

parent e15cf921
......@@ -135,7 +135,6 @@ public class ImClientLoginServiceImpl implements ImClientLoginService {
ImClient client = imClientService.getOne(new QueryWrapper<ImClient>().lambda()
.eq(ImClient::getFkAppid, appId)
.eq(ImClient::getClientId, clientId));
;
if (client == null) {
client = new ImClient();
......
......@@ -1198,13 +1198,11 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
return Boolean.FALSE;
}
}
// 修改群成员数量
imConversationMapper.addMemberCount(imApplication.getId(), param.getChatRoomId(), 1);
chatRoomCacheManager.intoRoom(clientToConversation.getId(), param.getChatRoomId(), param.getPlatform());
// ws邀请事件通知给群内其他人 ----------
// 生成消息id
long messageId = SnowflakeUtil.getId();
Map<String, Object> content = new HashMap<>();
content.put("operator", imClientSender.getClientId()); //操作的client ID
content.put("passivityOperator", clientToConversation.getClientId()); //被操作的client ID
......@@ -1212,7 +1210,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
ImMessage imMessage = MessageBuilder.buildEventMessage(MsgTypeEnum.INVITE_CLIENT_JOIN_CONVERSATION, imApplication, imClientSender, imConversation, "");
imMessage.setContent(JsonUtils.encodeJson(content));
imMessage.setId(messageId);
imMessage.setId(SnowflakeUtil.getId());
imMessage.setMsgType(MsgTypeEnum.INVITE_CLIENT_JOIN_CONVERSATION.getUriCode());
imMessage.setCreateTime(new Date());
imMessage.setFkAppid(imApplication.getId());
......@@ -1270,7 +1268,6 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
chatRoomCacheManager.exitRoom(currentClient.getId(), param.getChatRoomId(), param.getPlatform());
// ws 退出事件通知给房间内其他人 ----------
// 生成消息id
ImMessage imMessage = MessageBuilder.buildEventMessage(MsgTypeEnum.LEAVE_CONVERSATION, imApplication, currentClient, imConversation, "");
// 遍历发送给已在群内的成员
List<Long> fkClientIds = chatRoomMembers.keySet().stream().map(key -> Long.valueOf(key.split(RedisUtils.SPLIT)[0])).collect(Collectors.toList());
......
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