diff --git a/server/api/ChatApi.ts b/server/api/ChatApi.ts index 5b67193..9c5d10e 100644 --- a/server/api/ChatApi.ts +++ b/server/api/ChatApi.ts @@ -283,8 +283,16 @@ export default class ChatApi extends BaseApi { code: 404, msg: "对话不存在", } - - chat.addJoinRequest(token.author, args.reason as string) + if (chat.bean.type == 'group') { + const settings = ChatGroup.fromChat(chat).getSettings() + if (settings.settings.allow_new_member_join) + chat.addJoinRequest(token.author, args.reason as string) + else + return { + code: 403, + msg: "该对话不允许加入请求", + } + } return { code: 200,