fix(core): apply member permissions from the current privilege flag
set_group_member_permissions now writes only the member-capability bits. An omitted privilege value is treated as all allowed. Fixes #388
This commit is contained in:
2 files changed
+54
-7
No files matched your search
@@ -139,11 +139,11 @@ export class GroupAdminApi {
|
||||
|
||||
private async fetchGroupPrivilegeFlag(groupId: number, setting: string, phase: string): Promise<number> {
|
||||
const detail = await FetchGroupDetail.invoke(this.ctx, { groupUin: groupId });
|
||||
const privilegeFlag = detail.groupInfo?.results?.privilegeFlag;
|
||||
if (typeof privilegeFlag !== 'number') {
|
||||
const results = detail.groupInfo?.results;
|
||||
if (!results) {
|
||||
throw new Error(`unable to read ${setting} ${phase} for group ${groupId}`);
|
||||
}
|
||||
return privilegeFlag;
|
||||
return results.privilegeFlag ?? 0;
|
||||
}
|
||||
|
||||
async setMemberPermissions(groupId: number, permissions: GroupMemberPermissions): Promise<void> {
|
||||
|
||||
Reference in new issue
Block a user