diff --git a/src/Store/make-in-memory-store.ts b/src/Store/make-in-memory-store.ts index 4cf4aa8..8d68cc1 100644 --- a/src/Store/make-in-memory-store.ts +++ b/src/Store/make-in-memory-store.ts @@ -6,7 +6,7 @@ import { DEFAULT_CONNECTION_CONFIG } from '../Defaults' import type makeLegacySocket from '../LegacySocket' import type makeMDSocket from '../Socket' import type { BaileysEventEmitter, Chat, ConnectionState, Contact, GroupMetadata, PresenceData, WAMessage, WAMessageCursor, WAMessageKey } from '../Types' -import { toNumber, updateMessageWithReceipt } from '../Utils' +import { toNumber, updateMessageWithReaction, updateMessageWithReceipt } from '../Utils' import { jidNormalizedUser } from '../WABinary' import makeOrderedDictionary from './make-ordered-dictionary' @@ -230,6 +230,16 @@ export default ( } } }) + + ev.on('messages.reaction', (reactions) => { + for(const { key, reaction } of reactions) { + const obj = messages[key.remoteJid!] + const msg = obj?.get(key.id!) + if(msg) { + updateMessageWithReaction(msg, reaction) + } + } + }) } const toJSON = () => ({ @@ -379,4 +389,4 @@ export default ( } } } -} \ No newline at end of file +}