REQ-3345: 移除群成员

This commit is contained in:
yanglin 2025-02-08 14:52:08 +08:00
parent 8e3ae7e2cd
commit 6dd5b38530

View File

@ -95,7 +95,7 @@ public class GroupManager {
GroupCreateResponse response = new GroupCreateResponse();
response.setTid(nimResponse.getTid());
response.setAccountsNotFound(getAccountNotFoundPersons(
notification, "创建群", imAccounts, group, request.getMembers()));
"创建群", imAccounts, group, request.getMembers()));
return response;
}
@ -152,7 +152,7 @@ public class GroupManager {
MqEventType.GROUP_ADD_MEMBERS);
GroupAddMembersResponse response = new GroupAddMembersResponse();
response.setAccountsNotFound(getAccountNotFoundPersons(
notification, "添加群成员", imAccounts, group, request.getMembers()));
"添加群成员", imAccounts, group, request.getMembers()));
return response;
}
@ -205,15 +205,15 @@ public class GroupManager {
}
public Set<PersonAccountAttribute> getAccountNotFoundPersons(
Notification notification, String operation,
ImAccounts accounts, Group group, Set<PersonAccountAttribute> persons) {
String operation, ImAccounts accounts, Group group,
Set<PersonAccountAttribute> persons) {
if (org.apache.commons.collections.CollectionUtils.isEmpty(persons))
return Collections.emptySet();
Set<PersonAccountAttribute> notFound = persons.stream()
.filter(person -> !accounts.findAccount(person).isPresent())
.collect(toSet());
if (!notFound.isEmpty())
notification.send("{}[{},{}], IM账号不存在列表: {}", operation,
this.notification.send("{}[{},{}], IM账号不存在列表: {}", operation,
group.getTid(), group.getName(),
cn.axzo.framework.jackson.utility.JSON.toJSONString(notFound));
return notFound;