fix(protocol): apply member permission updates on the correct group setting command

set_group_member_permissions was still rejected after the privilege
flag read was corrected. Album, temporary-session, and create-group
writes use a different 0x89A variant than invite policy.

Closes #392
This commit is contained in:
DrSmoothl committed 2026-08-18 21:57:11 +08:00
1 parent d879ba1027
commit b088ffaff0
4 files changed
+21 -9

No files matched your search

@@ -1,6 +1,8 @@
// 0x89A_0 — update one member capability through the appPrivilegeFlag deny
// bits. Current QQ applies one selected mask per operation; callers that change
// multiple capabilities must invoke this namespace sequentially.
// 0x89A_8 — update one member capability through the appPrivilegeFlag deny
// bits. Invite policy shares the same settings tags on 0x89A_0; album /
// temporary-session / create-group writes use this variant. Current QQ applies
// one selected mask per operation; callers that change multiple capabilities
// must invoke this namespace sequentially.
import { protobuf_decode, protobuf_encode } from '@snowluma/proton';
import type { OidbBase, OidbEmpty } from '@snowluma/proto-defs/oidb';
@@ -50,7 +52,7 @@ export function decodeGroupMemberPermissions(privilegeFlag: number): {
export namespace SetMemberPermission {
export const command = 0x89A;
export const subCommand = 0;
export const subCommand = 8;
export interface Params {
groupId: number;
@@ -24,6 +24,11 @@ function makeSender() {
}
describe('SetMemberPermission namespace', () => {
it('declares 0x89A_8', () => {
expect(SetMemberPermission.command).toBe(0x89A);
expect(SetMemberPermission.subCommand).toBe(8);
});
it.each<[GroupMemberPermission, number]>([
['upload_album', 0x1],
['temporary_session', 0x10000],
@@ -39,8 +44,10 @@ describe('SetMemberPermission namespace', () => {
});
const [command, bytes] = sender.sendRawPacket.mock.calls[0]!;
expect(command).toBe('OidbSvcTrpcTcp.0x89a_0');
expect(command).toBe('OidbSvcTrpcTcp.0x89a_8');
const envelope = protobuf_decode<OidbBase<Oidb0x89a_0MemberPermission>>(bytes);
expect(envelope.command).toBe(0x89A);
expect(envelope.subCommand).toBe(8);
expect(envelope.body).toMatchObject({
groupUin: 12345n,
settings: {