perf: 优化撤回消息逻辑

This commit is contained in:
kuaifan 2025-03-25 16:39:49 +08:00
parent 6ebc89695a
commit b482947207
2 changed files with 4 additions and 4 deletions

View File

@ -1093,7 +1093,7 @@ class DialogController extends AbstractController
// //
if ($update_id > 0) { if ($update_id > 0) {
$action = $update_mark ? "update-$update_id" : "change-$update_id"; $action = $update_mark ? "update-$update_id" : "change-$update_id";
if (!($user->bot || $user->isAdmin())) { if (!$user->bot) {
Setting::validateMsgLimit('edit', $update_id); Setting::validateMsgLimit('edit', $update_id);
} }
} elseif ($reply_id > 0) { } elseif ($reply_id > 0) {
@ -1818,7 +1818,7 @@ class DialogController extends AbstractController
if (empty($msg)) { if (empty($msg)) {
return Base::retError("消息不存在或已被删除"); return Base::retError("消息不存在或已被删除");
} }
if (!($user->bot || $user->isAdmin())) { if (!$user->bot) {
Setting::validateMsgLimit('rev', $msg); Setting::validateMsgLimit('rev', $msg);
} }
$msg->withdrawMsg(); $msg->withdrawMsg();

View File

@ -214,7 +214,7 @@
</template> </template>
</Input> </Input>
</div> </div>
<div class="form-tip">{{$L('消息发出后的可撤回时长。')}} ({{$L('系统管理员除外')}})</div> <div class="form-tip">{{$L('消息发出后的可撤回时长。')}}</div>
</FormItem> </FormItem>
<FormItem :label="$L('修改消息限制')" prop="msgEditLimit"> <FormItem :label="$L('修改消息限制')" prop="msgEditLimit">
<div style="width: 220px;"> <div style="width: 220px;">
@ -224,7 +224,7 @@
</template> </template>
</Input> </Input>
</div> </div>
<div class="form-tip">{{$L('消息发出后的可修改时长。')}} ({{$L('系统管理员除外')}})</div> <div class="form-tip">{{$L('消息发出后的可修改时长。')}}</div>
</FormItem> </FormItem>
</div> </div>
</div> </div>