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

@@ -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();
});
});
});