Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
2f5e087c
Commit
2f5e087c
authored
May 16, 2022
by
Future
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
聊天室群成员数量fix
parent
e15cf921
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
core/src/main/java/com/wecloud/im/service/impl/ImClientLoginServiceImpl.java
+0
-1
core/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
+3
-6
No files found.
core/src/main/java/com/wecloud/im/service/impl/ImClientLoginServiceImpl.java
View file @
2f5e087c
...
@@ -135,7 +135,6 @@ public class ImClientLoginServiceImpl implements ImClientLoginService {
...
@@ -135,7 +135,6 @@ public class ImClientLoginServiceImpl implements ImClientLoginService {
ImClient
client
=
imClientService
.
getOne
(
new
QueryWrapper
<
ImClient
>().
lambda
()
ImClient
client
=
imClientService
.
getOne
(
new
QueryWrapper
<
ImClient
>().
lambda
()
.
eq
(
ImClient:
:
getFkAppid
,
appId
)
.
eq
(
ImClient:
:
getFkAppid
,
appId
)
.
eq
(
ImClient:
:
getClientId
,
clientId
));
.
eq
(
ImClient:
:
getClientId
,
clientId
));
;
if
(
client
==
null
)
{
if
(
client
==
null
)
{
client
=
new
ImClient
();
client
=
new
ImClient
();
...
...
core/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
View file @
2f5e087c
...
@@ -1198,13 +1198,11 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
...
@@ -1198,13 +1198,11 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
return
Boolean
.
FALSE
;
return
Boolean
.
FALSE
;
}
}
}
}
// 修改群成员数量
imConversationMapper
.
addMemberCount
(
imApplication
.
getId
(),
param
.
getChatRoomId
(),
1
);
chatRoomCacheManager
.
intoRoom
(
clientToConversation
.
getId
(),
param
.
getChatRoomId
(),
param
.
getPlatform
());
chatRoomCacheManager
.
intoRoom
(
clientToConversation
.
getId
(),
param
.
getChatRoomId
(),
param
.
getPlatform
());
// ws邀请事件通知给群内其他人 ----------
// ws邀请事件通知给群内其他人 ----------
// 生成消息id
long
messageId
=
SnowflakeUtil
.
getId
();
Map
<
String
,
Object
>
content
=
new
HashMap
<>();
Map
<
String
,
Object
>
content
=
new
HashMap
<>();
content
.
put
(
"operator"
,
imClientSender
.
getClientId
());
//操作的client ID
content
.
put
(
"operator"
,
imClientSender
.
getClientId
());
//操作的client ID
content
.
put
(
"passivityOperator"
,
clientToConversation
.
getClientId
());
//被操作的client ID
content
.
put
(
"passivityOperator"
,
clientToConversation
.
getClientId
());
//被操作的client ID
...
@@ -1212,7 +1210,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
...
@@ -1212,7 +1210,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
ImMessage
imMessage
=
MessageBuilder
.
buildEventMessage
(
MsgTypeEnum
.
INVITE_CLIENT_JOIN_CONVERSATION
,
imApplication
,
imClientSender
,
imConversation
,
""
);
ImMessage
imMessage
=
MessageBuilder
.
buildEventMessage
(
MsgTypeEnum
.
INVITE_CLIENT_JOIN_CONVERSATION
,
imApplication
,
imClientSender
,
imConversation
,
""
);
imMessage
.
setContent
(
JsonUtils
.
encodeJson
(
content
));
imMessage
.
setContent
(
JsonUtils
.
encodeJson
(
content
));
imMessage
.
setId
(
messageId
);
imMessage
.
setId
(
SnowflakeUtil
.
getId
()
);
imMessage
.
setMsgType
(
MsgTypeEnum
.
INVITE_CLIENT_JOIN_CONVERSATION
.
getUriCode
());
imMessage
.
setMsgType
(
MsgTypeEnum
.
INVITE_CLIENT_JOIN_CONVERSATION
.
getUriCode
());
imMessage
.
setCreateTime
(
new
Date
());
imMessage
.
setCreateTime
(
new
Date
());
imMessage
.
setFkAppid
(
imApplication
.
getId
());
imMessage
.
setFkAppid
(
imApplication
.
getId
());
...
@@ -1270,7 +1268,6 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
...
@@ -1270,7 +1268,6 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
chatRoomCacheManager
.
exitRoom
(
currentClient
.
getId
(),
param
.
getChatRoomId
(),
param
.
getPlatform
());
chatRoomCacheManager
.
exitRoom
(
currentClient
.
getId
(),
param
.
getChatRoomId
(),
param
.
getPlatform
());
// ws 退出事件通知给房间内其他人 ----------
// ws 退出事件通知给房间内其他人 ----------
// 生成消息id
ImMessage
imMessage
=
MessageBuilder
.
buildEventMessage
(
MsgTypeEnum
.
LEAVE_CONVERSATION
,
imApplication
,
currentClient
,
imConversation
,
""
);
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
());
List
<
Long
>
fkClientIds
=
chatRoomMembers
.
keySet
().
stream
().
map
(
key
->
Long
.
valueOf
(
key
.
split
(
RedisUtils
.
SPLIT
)[
0
])).
collect
(
Collectors
.
toList
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment