use of com.akaxin.common.channel.ChannelSession in project openzaly by akaxincom.
the class GroupMessageTextSecretHandler method handle.
public Boolean handle(Command command) {
ChannelSession channelSession = command.getChannelSession();
try {
ImCtsMessageProto.ImCtsMessageRequest request = ImCtsMessageProto.ImCtsMessageRequest.parseFrom(command.getParams());
int type = request.getType().getNumber();
if (CoreProto.MsgType.GROUP_SECRET_TEXT_VALUE == type) {
String gmsg_id = request.getGroupSecretText().getMsgId();
String group_user_id = request.getGroupSecretText().getSiteUserId();
String group_id = request.getGroupSecretText().getSiteGroupId();
String group_text = request.getGroupSecretText().getText().toStringUtf8();
command.setSiteGroupId(group_id);
// command.setField("group_id", group_id);
System.out.println("GroupMsg = id=" + gmsg_id + "," + group_user_id + "," + group_id + "," + group_text + ",");
long msgTime = System.currentTimeMillis();
GroupMessageBean gmsgBean = new GroupMessageBean();
gmsgBean.setMsgTime(msgTime);
messageDao.saveGroupMessage(gmsgBean);
msgResponse(channelSession.getChannel(), command, group_user_id, group_id, gmsg_id, msgTime);
return true;
}
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
Aggregations