fix(core): resolve group join member identity
This commit is contained in:
6 files changed
+309
-24
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user