fix(core): resolve group join member identity

This commit is contained in:
DrSmoothl committed 2026-05-10 17:38:05 +08:00
1 parent 6f6ce1144b
commit bf0a89e221
6 files changed
+309 -24

No files matched your search

+6 -1
View File
@@ -135,7 +135,7 @@ export class EventConverter {
self_id: selfId,
post_type: 'notice',
notice_type: 'group_increase',
sub_type: event.operatorUin === event.userUin ? 'approve' : 'invite',
sub_type: isSameActor(event.operatorUin, event.operatorUid, event.userUin, event.userUid) ? 'approve' : 'invite',
group_id: event.groupId,
operator_id: event.operatorUin,
user_id: event.userUin,
@@ -330,6 +330,11 @@ function parseSelfId(instanceUin: string): number {
return Number.isNaN(parsed) ? 0 : parsed;
}
function isSameActor(leftUin: number, leftUid: string | undefined, rightUin: number, rightUid: string | undefined): boolean {
if (leftUin > 0 && rightUin > 0) return leftUin === rightUin;
return Boolean(leftUid) && leftUid === rightUid;
}
async function elementsToJson(
elements: MessageElement[],
isGroup: boolean,