Merge pull request #129 from lingyufei/fix/replayMessage-setType-error

Fix 2 errors in TextMsgHandler and CheckRecall
This commit is contained in:
zongzibinbin
2023-09-10 19:48:49 +08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -290,7 +290,7 @@ public class ChatServiceImpl implements ChatService {
private void checkRecall(Long uid, Message message) {
AssertUtil.isNotEmpty(message, "消息有误");
AssertUtil.notEqual(message.getType(), MessageTypeEnum.RECALL, "消息无法撤回");
AssertUtil.notEqual(message.getType(), MessageTypeEnum.RECALL.getType(), "消息无法撤回");
boolean hasPower = iRoleService.hasPower(uid, RoleEnum.CHAT_MANAGER);
if (hasPower) {
return;

View File

@@ -120,7 +120,7 @@ public class TextMsgHandler extends AbstractMsgHandler {
TextMsgResp.ReplyMsg replyMsgVO = new TextMsgResp.ReplyMsg();
replyMsgVO.setId(replyMessage.getId());
replyMsgVO.setUid(replyMessage.getFromUid());
replyMessage.setType(replyMessage.getType());
replyMsgVO.setType(replyMessage.getType());
replyMsgVO.setBody(MsgHandlerFactory.getStrategyNoNull(replyMessage.getType()).showReplyMsg(replyMessage));
User replyUser = userCache.getUserInfo(replyMessage.getFromUid());
replyMsgVO.setUsername(replyUser.getName());