SDK增加群内成员禁言功能

This commit is contained in:
imhao183
2020-05-24 19:02:39 +08:00
parent e914afedf4
commit 508beaf62c
6 changed files with 106 additions and 2 deletions
@@ -53,6 +53,7 @@ public interface APIPath {
String Group_Member_Kickoff = "/admin/group/member/del";
String Group_Member_Quit = "/admin/group/member/quit";
String Group_Set_Manager = "/admin/group/manager/set";
String Group_Mute_Member = "/admin/group/manager/mute";
String Get_User_Groups = "/admin/group/of_user";
@@ -145,6 +145,8 @@ public class GroupNotificationBinaryContent {
return getGroupNotifyContent(ProtoConstants.MESSAGE_CONTENT_TYPE_SET_MANAGER);
}
public WFCMessage.MessageContent getMuteGroupMemberNotifyContent() {
return getGroupNotifyContent(ProtoConstants.MESSAGE_CONTENT_TYPE_MUTE_MEMBER);
}
}
@@ -0,0 +1,72 @@
/*
* This file is part of the Wildfire Chat package.
* (c) Heavyrain2012 <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
package cn.wildfirechat.pojos;
import cn.wildfirechat.proto.WFCMessage;
import io.netty.util.internal.StringUtil;
import java.util.List;
public class InputMuteGroupMember extends InputGroupBase {
private String group_id;
private List<String> members;
private boolean is_manager;
public String getGroup_id() {
return group_id;
}
public void setGroup_id(String group_id) {
this.group_id = group_id;
}
public List<String> getMembers() {
return members;
}
public void setMembers(List<String> members) {
this.members = members;
}
public boolean isIs_manager() {
return is_manager;
}
public void setIs_manager(boolean is_manager) {
this.is_manager = is_manager;
}
public boolean isValide() {
if (StringUtil.isNullOrEmpty(operator) || StringUtil.isNullOrEmpty(group_id) || members == null || members.isEmpty()) {
return false;
}
return true;
}
public WFCMessage.SetGroupManagerRequest toProtoGroupRequest() {
WFCMessage.SetGroupManagerRequest.Builder addGroupBuilder = WFCMessage.SetGroupManagerRequest.newBuilder();
addGroupBuilder.setGroupId(group_id);
addGroupBuilder.addAllUserId(members);
addGroupBuilder.setType(is_manager ? 1 : 0);
if (to_lines != null) {
for (Integer line : to_lines
) {
addGroupBuilder.addToLine(line);
}
}
if (notify_message != null) {
addGroupBuilder.setNotifyContent(notify_message.toProtoMessageContent());
}
return addGroupBuilder.build();
}
}
@@ -181,5 +181,6 @@ public class ProtoConstants {
public static final int MESSAGE_CONTENT_TYPE_CHANGE_SEARCHABLE = 116;
public static final int MESSAGE_CONTENT_TYPE_SET_MANAGER = 117;
public static final int MESSAGE_CONTENT_TYPE_MUTE_MEMBER = 118;
}