fix(protocol): set_group_special_title — send uinName so the title actually applies

The 0x8FC_2 body omitted uinName (tag 7), so the server accepted the request
(errorCode 0) but silently never applied the title — looking like the feature
was unsupported. Both NapCat (Oidb.0x8FC_2: uinName=title) and Lagrange
(0x8FC body @7 UinName=title) set it; mirror them by sending uinName = title.

No RE needed — two independent packet-based implementations agree on the field.

Note: setting a special title is group-owner-only, so on-target validation
requires a group the bot owns.
This commit is contained in:
DrSmoothl committed 2026-06-22 21:53:33 +08:00
1 parent 1bd126562f
commit b918450483
3 files changed
+9

No files matched your search

@@ -20,6 +20,9 @@ export namespace SetSpecialTitle {
targetUid: await ctx.resolveUserUid(p.userId, p.groupId),
specialTitle: p.title,
expireTime: -1,
// Must mirror specialTitle, or the server accepts the request (errorCode 0)
// but silently never applies the title (see OidbSpecialTitleBody note).
uinName: p.title,
},
});
@@ -30,6 +30,8 @@ describe('SetSpecialTitle namespace', () => {
expect(env.body?.groupUin).toBe(12345);
expect(env.body?.body?.targetUid).toBe('resolved-uid');
expect(env.body?.body?.specialTitle).toBe('crown');
// uinName (tag 7) must mirror specialTitle or the server silently no-ops.
expect(env.body?.body?.uinName).toBe('crown');
// -1 (int_32) round-trips as 0xFFFFFFFF after the proton decoder reinterprets.
expect(env.body?.body?.expireTime).toBe(0xFFFFFFFF);
});