feat(dialog): 管理员可设置全员群名称

- 后端 group__edit 放开全员群改名(仅系统管理员 admin=1)
- formatData/getGroupName 用 ALL_GROUP_DEFAULT_NAME 哨兵区分"未自定义",
  避免回退逻辑被默认种子名短路导致 i18n 丢失
- 前端 canModifyName/编辑入口对全员群管理员放开,改名请求带 admin=1

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
kuaifan
2026-06-04 20:29:41 +00:00
parent e9ea1adc5d
commit 8e66f0bfb3
5 changed files with 22 additions and 5 deletions

View File

@@ -2916,7 +2916,9 @@ class DialogController extends AbstractController
$data['avatar'] = Base::fillUrl($array['avatar'] = $avatar);
}
$existName = Request::exists('chat_name') || Request::exists('name');
if ($existName && $dialog->group_type === 'user') {
// 个人群组群主可改名;全员群仅系统管理员可改名
$canEditName = $dialog->group_type === 'user' || ($dialog->group_type === 'all' && $admin === 1);
if ($existName && $canEditName) {
$chatName = trim(Request::input('chat_name') ?: Request::input('name'));
if (mb_strlen($chatName) < 2) {
return Base::retError('群名称至少2个字');