fix(onebot): handle non-friend group invitations

Refs #636
This commit is contained in:
DrSmoothl committed 2026-11-02 07:55:40 +08:00
1 parent 0fa912a32e
commit 2b63f375fc
8 files changed
+184 -8

No files matched your search

+2 -2
View File
@@ -5,7 +5,7 @@ import type { BridgeEventBus } from './event-bus';
import type { QQEventVariant } from './events';
import type { GroupInviteTracker } from './group-invite-tracker';
import type { IdentityService } from './identity-service';
import { formatGroupRequestFlag, type GroupRequestInfo } from './qq-info';
import { formatGroupRequestFlag, isSelfGroupInvitation, type GroupRequestInfo } from './qq-info';
const moduleLog = createLogger('Bridge');
const moduleEventLog = createLogger('Event');
@@ -564,7 +564,7 @@ export class IncomingPacketPipeline {
return 0;
}
if (request.eventType === 2) {
if (isSelfGroupInvitation(request)) {
return 0;
}
+6
View File
@@ -121,6 +121,12 @@ export interface GroupRequestInfo {
operateTransInfo?: Uint8Array;
}
/** Invitations handled by the invited account, rather than a group administrator.
* Notification types 1 and 2 use different approval discriminators. */
export function isSelfGroupInvitation(request: Pick<GroupRequestInfo, 'eventType'>): boolean {
return request.eventType === 2 || request.eventType === 10;
}
/** Approval tuple required by OIDB 0x10C8. The OneBot flag is opaque to
* clients, but carrying the complete tuple makes delayed handling stateless. */
export type GroupRequestHandle = Pick<