From 9075086be4192ab546ba33434416abb8826c6ba1 Mon Sep 17 00:00:00 2001 From: Lucas Maia <58118141+Iucasmaia@users.noreply.github.com> Date: Sun, 28 Apr 2024 08:06:38 -0300 Subject: [PATCH] Show jid of people who changed some setting in group. (#688) * JId of people who changed settings in group. * Show jid of people who changed some setting in group. * fix lint --- src/Types/GroupMetadata.ts | 2 +- src/Utils/process-message.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Types/GroupMetadata.ts b/src/Types/GroupMetadata.ts index baa284c..a7d0dcb 100644 --- a/src/Types/GroupMetadata.ts +++ b/src/Types/GroupMetadata.ts @@ -36,7 +36,7 @@ export interface GroupMetadata { participants: GroupParticipant[] ephemeralDuration?: number inviteCode?: string - /** the person who added you */ + /** the person who added you to group or changed some setting in group */ author?: string } diff --git a/src/Utils/process-message.ts b/src/Utils/process-message.ts index 24563a7..114ccf0 100644 --- a/src/Utils/process-message.ts +++ b/src/Utils/process-message.ts @@ -298,7 +298,7 @@ const processMessage = async( ev.emit('group-participants.update', { id: jid, author: message.participant!, participants, action }) ) const emitGroupUpdate = (update: Partial) => { - ev.emit('groups.update', [{ id: jid, ...update }]) + ev.emit('groups.update', [{ id: jid, ...update, author: message.participant ?? undefined }]) } const participantsIncludesMe = () => participants.find(jid => areJidsSameUser(meId, jid))