feat: 新增自定义撤回及修改消息时限

This commit is contained in:
kuaifan
2025-03-14 21:07:44 +08:00
parent cf5e126eaa
commit 957201804c
6 changed files with 90 additions and 6 deletions

View File

@@ -12,6 +12,7 @@ use App\Models\File;
use App\Models\User;
use App\Module\Base;
use App\Module\Timer;
use App\Models\Setting;
use App\Module\Extranet;
use App\Module\ElasticSearch\ElasticSearchUserMsg;
use App\Module\TimeRange;
@@ -1092,6 +1093,9 @@ class DialogController extends AbstractController
//
if ($update_id > 0) {
$action = $update_mark ? "update-$update_id" : "change-$update_id";
if (!($user->bot || $user->isAdmin())) {
Setting::validateMsgLimit('edit', $update_id);
}
} elseif ($reply_id > 0) {
$action = "reply-$reply_id";
if ($reply_check === 'yes') {
@@ -1844,6 +1848,9 @@ class DialogController extends AbstractController
if (empty($msg)) {
return Base::retError("消息不存在或已被删除");
}
if (!($user->bot || $user->isAdmin())) {
Setting::validateMsgLimit('rev', $msg);
}
$msg->withdrawMsg();
return Base::retSuccess("success");
}