修复无法转发别人的信息

This commit is contained in:
kuaifan 2022-06-06 16:46:02 +08:00
parent d75ee02b4a
commit 917f91249e

View File

@ -642,14 +642,16 @@ class DialogController extends AbstractController
$msg_id = intval(Request::input("msg_id")); $msg_id = intval(Request::input("msg_id"));
$userids = Request::input('userids'); $userids = Request::input('userids');
// //
$msg = WebSocketDialogMsg::whereId($msg_id)->whereUserid($user->userid)->first();
if (empty($msg)) {
return Base::retError("消息不存在或已被删除");
}
if (empty($userids)) { if (empty($userids)) {
return Base::retError("请选择转发成员"); return Base::retError("请选择转发成员");
} }
// //
$msg = WebSocketDialogMsg::whereId($msg_id)->first();
if (empty($msg)) {
return Base::retError("消息不存在或已被删除");
}
WebSocketDialog::checkDialog($msg->dialog_id);
//
return $msg->forwardMsg($userids, $user->userid); return $msg->forwardMsg($userids, $user->userid);
} }
@ -679,10 +681,12 @@ class DialogController extends AbstractController
return Base::retError("参数错误"); return Base::retError("参数错误");
} }
// //
$msg = WebSocketDialogMsg::whereId($msg_id)->first(); // 不限制会员身份 $msg = WebSocketDialogMsg::whereId($msg_id)->first();
if (empty($msg)) { if (empty($msg)) {
return Base::retError("消息不存在或已被删除"); return Base::retError("消息不存在或已被删除");
} }
WebSocketDialog::checkDialog($msg->dialog_id);
//
return $msg->emojiMsg($emoji, $user->userid); return $msg->emojiMsg($emoji, $user->userid);
} }