fix(protocol): read group mute expire from official proto tags (#356)

get_group_info / get_group_list mapped FE5 tag 31 and 88D tag 59 as
shutUpAllTimestamp, then treated any >0 value as muted. Official
wrapper.node maps those tags to internal 60259; the real expire
(60027 / groupShutupExpireTime) is FE5 tag 10 and 88D tag 45
(request mask 45). After a group had been muted, 60259 often stayed
nonzero so group_all_shut stuck at -1. Read the 60027 tags and treat
all-mute as expire > now (0xFFFFFFFF is permanent).

Fixes #356
This commit is contained in:
DrSmoothl committed 2026-08-13 12:44:56 +08:00
1 parent 2f5065545a
commit f100faaeb6
8 files changed
+93 -12

No files matched your search

@@ -4,9 +4,8 @@
// including ones the bot hasn't joined — used to put a name on a group invite
// (where the invite push itself carries no group name). The `flags` block is a
// request mask: a present bool(true)/string("") asks the server to include that
// field in the response. Cross-checked against
// dev/Lagrange.Core/.../GetGroupInfoService.cs — note it builds the envelope
// with isUid=false, i.e. reserved=0 (NO uinForm), unlike the 0xFE5_2 list query.
// field in the response. Envelope is reserved=0 (NO uinForm), unlike 0xFE5_2.
// Mute expire request/response tag is 45 (official 60027), not Lagrange's 59.
import { protobuf_decode, protobuf_encode } from '@snowluma/proton';
import type { OidbBase, OidbSvcTrpcTcp0x88D_0Response } from '@snowluma/proto-defs/oidb';
@@ -33,6 +32,7 @@ export namespace FetchGroupDetail {
ownerUid: on, createTime: on, maxMemberCount: on, memberCount: on,
level: on, name: '', noticePreview: '', uin: on, lastSequence: on,
lastMessageTime: on, question: on, answer: '', maxAdminCount: '',
// Tag 45 (not Lagrange's 59): official request mask for 60027.
shutUpAllTimestamp: on, privilegeFlag: on, groupFlagExt4: on,
},
},
+1 -1
View File
@@ -57,7 +57,7 @@ export interface QQGroupInfo {
level?: number;
/** Group memo / announcement preview. '' when unknown (#197). */
memo?: string;
/** Whether the group currently has group-wide mute enabled. */
/** Whether group-wide mute is currently in effect (expire still in the future). */
allMuted?: boolean;
}
@@ -18,7 +18,8 @@ import { FetchGroupDetail } from '../../../src/oidb-services/contacts/fetch-grou
interface GroupDetailResultsFixture {
name?: pb<15, string>;
shutUpAllTimestamp?: pb<59, uint_32>;
shutUpAllTimestamp?: pb<45, uint_32>;
leftover59?: pb<59, uint_32>;
privilegeFlag?: pb<99, uint_32>;
groupFlagExt4?: pb<101, uint_32>;
}
@@ -116,6 +117,28 @@ describe('FetchGroupDetail namespace', () => {
expect(out.groupInfo?.results?.shutUpAllTimestamp).toBe(4_294_967_295);
});
it('does not treat 0x88D results tag 59 as the mute expire (#356)', async () => {
const responseData = Buffer.from(protobuf_encode<OidbBase<GroupDetailResponseFixture>>({
body: {
groupInfo: {
uin: 601692726n,
results: { name: 'Unmuted Group', leftover59: 4_294_967_295 },
},
},
}));
const sender = makeSender();
sender.sendRawPacket.mockResolvedValue({
success: true,
gotResponse: true,
errorCode: 0,
errorMessage: '',
responseData,
});
const out = await FetchGroupDetail.invoke(sender, { groupUin: 601692726 });
expect(out.groupInfo?.results?.shutUpAllTimestamp ?? undefined).toBeUndefined();
});
it('decodes the complete privilege flag used by masked group mutations', async () => {
const responseData = Buffer.from(protobuf_encode<OidbBase<GroupDetailResponseFixture>>({
body: {
@@ -14,7 +14,8 @@ import { FetchGroupList } from '../../../src/oidb-services/contacts/fetch-group-
interface GroupInfoFixture {
groupName?: pb<5, string>;
shutUpAllTimestamp?: pb<31, uint_32>;
shutUpAllTimestamp?: pb<10, uint_32>;
leftover31?: pb<31, uint_32>;
}
interface GroupFixture {
@@ -55,7 +56,7 @@ describe('FetchGroupList namespace', () => {
const env = protobuf_decode<OidbBase<OidbGroupListRequest>>(bytes);
expect(env.body?.config?.config1?.groupName).toBe(true);
expect(env.body?.config?.config1?.memberCount).toBe(true);
expect(env.body?.config?.config1?.field31).toBe(true);
expect(env.body?.config?.config1?.field10).toBe(true);
expect(env.body?.config?.config2?.remark).toBe(true);
for (const field of ['field1', 'field2', 'field4', 'field5', 'field6', 'field7', 'field8'] as const) {
expect(env.body?.config?.config2?.[field] ?? false, field).toBe(false);
@@ -87,5 +88,28 @@ describe('FetchGroupList namespace', () => {
expect(out.groups?.[0]?.info?.shutUpAllTimestamp).toBe(4_294_967_295);
});
it('does not treat 0xFE5 info tag 31 as the mute expire (#356)', async () => {
const responseData = Buffer.from(protobuf_encode<OidbBase<GroupListFixture>>({
body: {
groups: [{
groupUin: 123456789,
info: { groupName: 'Unmuted Group', leftover31: 4_294_967_295 },
}],
},
}));
const sender = makeSender();
sender.sendRawPacket.mockResolvedValue({
success: true,
gotResponse: true,
errorCode: 0,
errorMessage: '',
responseData,
});
const out = await FetchGroupList.invoke(sender);
expect(out.groups?.[0]?.info?.shutUpAllTimestamp ?? undefined).toBeUndefined();
});
});
});