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:
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: {
|
||||
|
||||
Reference in new issue
Block a user