perf: 优化自己的对话不限修改撤回时间

This commit is contained in:
kuaifan
2025-04-14 13:18:38 +08:00
parent dcf96e2bf5
commit 923016197a
2 changed files with 17 additions and 3 deletions

View File

@@ -1082,11 +1082,11 @@ class DialogController extends AbstractController
$dialogIds = $dialog_ids ? explode(',', $dialog_ids) : [$dialog_id ?: 0];
foreach ($dialogIds as $dialog_id) {
//
WebSocketDialog::checkDialog($dialog_id);
$dialog = WebSocketDialog::checkDialog($dialog_id);
//
if ($update_id > 0) {
$action = $update_mark ? "update-$update_id" : "change-$update_id";
if (!$user->bot) {
if (!$user->bot && !$dialog->isSelfDialog()) {
Setting::validateMsgLimit('edit', $update_id);
}
} elseif ($reply_id > 0) {
@@ -1811,7 +1811,9 @@ class DialogController extends AbstractController
if (empty($msg)) {
return Base::retError("消息不存在或已被删除");
}
if (!$user->bot) {
$dialog = WebSocketDialog::checkDialog($msg->dialog_id);
//
if (!$user->bot && !$dialog->isSelfDialog()) {
Setting::validateMsgLimit('rev', $msg);
}
$msg->withdrawMsg();