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

set_group_member_permissions was still rejected after the previous
command switch. Linux QQ writes these capabilities with the same
group-detail command as the other admin settings.

Closes #392
This commit is contained in:
DrSmoothl committed 2026-08-19 21:46:44 +08:00
1 parent 4b8cc4292b
commit e6aeef02b4
3 files changed
+15 -15

No files matched your search

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