【用户给自己发送消息时,发错会话组问题】
This commit is contained in:
parent
a780b385bd
commit
e016aab767
@ -351,7 +351,10 @@ public class ConversationGroupHandlerService {
|
||||
private ConversationGroup getPrivateConversation(Simulation simulation, SimulationMember member, String memberId) {
|
||||
SimulationMember communicator = simulation.getSimulationMemberById(memberId);
|
||||
ConversationGroup conversationGroup = simulation.getSimulationConversationGroupMap().values()
|
||||
.stream().filter(group -> group.isPrivate() && group.contains(communicator)).findFirst().orElse(null);
|
||||
.stream().filter(group -> {
|
||||
int memberNumber = Objects.equals(member.getId(), memberId) ? 1 : 2;
|
||||
return group.getMemberList().size() == memberNumber && group.isPrivate() && group.contains(communicator);
|
||||
}).findFirst().orElse(null);
|
||||
if (conversationGroup == null) {
|
||||
Long groupId = simulation.getMaxConversationGroupId();
|
||||
conversationGroup = new ConversationGroup(groupId, null, null, simulation.getCorrectSystemTime(),
|
||||
|
Loading…
Reference in New Issue
Block a user