Files
IM-server-new/common/src/main/java/cn/wildfirechat/pojos/InputQuitGroup.java
T

52 lines
1.3 KiB
Java
Raw Normal View History

2019-12-27 09:41:44 +08:00
/*
* 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;
2021-06-01 08:45:00 +08:00
import io.netty.util.internal.StringUtil;
2019-12-27 09:41:44 +08:00
import java.util.List;
public class InputQuitGroup extends InputGroupBase {
private String group_id;
public String getGroup_id() {
return group_id;
}
public void setGroup_id(String group_id) {
this.group_id = group_id;
}
public boolean isValide() {
2021-06-01 08:45:00 +08:00
if (StringUtil.isNullOrEmpty(group_id) || StringUtil.isNullOrEmpty(operator))
return false;
2019-12-27 09:41:44 +08:00
return true;
}
public WFCMessage.QuitGroupRequest toProtoGroupRequest() {
WFCMessage.QuitGroupRequest.Builder removedGroupBuilder = WFCMessage.QuitGroupRequest.newBuilder();
removedGroupBuilder.setGroupId(group_id);
if (to_lines != null) {
for (Integer line : to_lines
) {
removedGroupBuilder.addToLine(line);
}
}
if (notify_message != null) {
removedGroupBuilder.setNotifyContent(notify_message.toProtoMessageContent());
}
return removedGroupBuilder.build();
}
}