feat(contacts): resolve non-member group name via 0x88D_0 (group invites)
A group invite push carries no group name (confirmed across SnowLuma / Lagrange
/ NapCat — all three invite protos only have groupUin + invitorUid), and
get_group_info only resolved joined groups (fetchGroupList → roster), so an
invited group rendered "未知群名". Add a by-id server lookup so the name
resolves even when the bot isn't a member.
- proto-defs: 0x88D_0 request (field1 + config.uin + a request-mask `flags`
block) + response (groupInfo.results: name / member counts / owner / …),
field tags transcribed from
dev/Lagrange.Core/.../OidbSvcTrpcTcp0x88D_0{,Response}.cs.
- protocol: FetchGroupDetail oidb-service. Envelope reserved=0 (NO uinForm) —
Lagrange's GetGroupInfoService builds it with isUid=false.
- core: ContactsApi.fetchGroupDetail(gid) → QQGroupInfo | null; deliberately
NOT remembered into the joined-groups roster (mustn't pollute get_group_list).
- onebot: get_group_info falls back to fetchGroupDetail for non-member groups,
behind a 5-min per-id TTL cache so a burst of invites for one group can't
hammer 0x88D_0 (rate-limit / kick risk). noCache bypasses it.
- tests: request/envelope round-trip (reserved=0, uin, command), response
decode; + non-member resolve / cache-hit / noCache-bypass at the onebot layer.
Live note: byte-identical to Lagrange's 0x88D_0, but not verified against a real
account on this host.
This commit is contained in:
8 files changed
+281
-8
No files matched your search
@@ -257,6 +257,35 @@ export interface OidbGroupListConfig {
|
||||
export interface OidbGroupListRequest {
|
||||
config?: pb<1, OidbGroupListConfig>;
|
||||
}
|
||||
|
||||
// 0x88D_0 — fetch a single group's detail by group uin (works for groups the
|
||||
// bot has NOT joined, unlike the 0xFE5_2 joined-list query). `flags` is a
|
||||
// request mask: a present bool(true)/string("") asks the server to return that
|
||||
// field; the tags mirror the response `Results`. Cross-checked against
|
||||
// dev/Lagrange.Core/.../Request/OidbSvcTrpcTcp0x88D_0.cs.
|
||||
export interface OidbGroupDetailFlags {
|
||||
ownerUid?: pb<1, bool>;
|
||||
createTime?: pb<2, bool>;
|
||||
maxMemberCount?: pb<5, bool>;
|
||||
memberCount?: pb<6, bool>;
|
||||
level?: pb<10, bool>;
|
||||
name?: pb<15, string>;
|
||||
noticePreview?: pb<16, string>;
|
||||
uin?: pb<21, bool>;
|
||||
lastSequence?: pb<22, bool>;
|
||||
lastMessageTime?: pb<23, bool>;
|
||||
question?: pb<24, bool>;
|
||||
answer?: pb<25, string>;
|
||||
maxAdminCount?: pb<29, string>;
|
||||
}
|
||||
export interface OidbGroupDetailConfig {
|
||||
uin?: pb<1, uint_64>;
|
||||
flags?: pb<2, OidbGroupDetailFlags>;
|
||||
}
|
||||
export interface OidbGroupDetailRequest {
|
||||
field1?: pb<1, uint_32>;
|
||||
config?: pb<2, OidbGroupDetailConfig>;
|
||||
}
|
||||
export interface OidbGroupMemberListBody {
|
||||
memberName?: pb<10, bool>;
|
||||
memberCard?: pb<11, bool>;
|
||||
|
||||
@@ -94,6 +94,32 @@ export interface OidbSvcTrpcTcp0xFE5_2Response {
|
||||
groups?: pb_repeated<2, OidbSvcTrpcTcp0xFE5_2Group>;
|
||||
}
|
||||
|
||||
// Oidb.0x88D_0 — single group detail by uin. `results` tags mirror the request
|
||||
// flags. Cross-checked against
|
||||
// dev/Lagrange.Core/.../Response/OidbSvcTrpcTcp0x88D_0Response.cs.
|
||||
export interface OidbSvcTrpcTcp0x88D_0Results {
|
||||
ownerUid?: pb<1, string>;
|
||||
createTime?: pb<2, uint_64>;
|
||||
maxMemberCount?: pb<5, uint_64>;
|
||||
memberCount?: pb<6, uint_64>;
|
||||
level?: pb<10, uint_64>;
|
||||
name?: pb<15, string>;
|
||||
noticePreview?: pb<16, string>;
|
||||
uin?: pb<21, uint_64>;
|
||||
lastSequence?: pb<22, uint_64>;
|
||||
lastMessageTime?: pb<23, uint_64>;
|
||||
question?: pb<24, string>;
|
||||
answer?: pb<25, string>;
|
||||
maxAdminCount?: pb<29, uint_64>;
|
||||
}
|
||||
export interface OidbSvcTrpcTcp0x88D_0ResponseGroupInfo {
|
||||
uin?: pb<1, uint_64>;
|
||||
results?: pb<3, OidbSvcTrpcTcp0x88D_0Results>;
|
||||
}
|
||||
export interface OidbSvcTrpcTcp0x88D_0Response {
|
||||
groupInfo?: pb<1, OidbSvcTrpcTcp0x88D_0ResponseGroupInfo>;
|
||||
}
|
||||
|
||||
// Oidb.0xFE7_3 Group member list
|
||||
export interface OidbSvcTrpcTcp0xFE7_3Uin {
|
||||
uid?: pb<2, string>;
|
||||
|
||||
Reference in new issue
Block a user