mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: do not fire chat update for reactions
This commit is contained in:
@@ -120,12 +120,16 @@ const makeMessagesSocket = (config: LegacySocketConfig) => {
|
||||
ev.emit('groups.update', [ { id: jid, ...update } ])
|
||||
}
|
||||
|
||||
const normalizedContent = normalizeMessageContent(message.message)
|
||||
const protocolMessage = normalizedContent?.protocolMessage
|
||||
|
||||
if(
|
||||
(
|
||||
!!message.message ||
|
||||
!!normalizedContent ||
|
||||
(message.messageStubType === WAMessageStubType.CIPHERTEXT && treatCiphertextMessagesAsReal)
|
||||
)
|
||||
&& !message.message?.protocolMessage
|
||||
&& !normalizedContent?.protocolMessage
|
||||
&& !normalizedContent?.reactionMessage
|
||||
) {
|
||||
chatUpdate.conversationTimestamp = +toNumber(message.messageTimestamp)
|
||||
// add to count if the message isn't from me & there exists a message
|
||||
@@ -143,9 +147,6 @@ const makeMessagesSocket = (config: LegacySocketConfig) => {
|
||||
}
|
||||
}
|
||||
|
||||
const normalizedContent = normalizeMessageContent(message.message)
|
||||
const protocolMessage = normalizedContent?.protocolMessage
|
||||
|
||||
if(normalizedContent?.reactionMessage) {
|
||||
const reaction: proto.IReaction = {
|
||||
...normalizedContent.reactionMessage,
|
||||
|
||||
@@ -562,12 +562,15 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
() => processMessage(msg, chat)
|
||||
)
|
||||
|
||||
const normalizedContent = msg.message ? normalizeMessageContent(msg.message) : undefined
|
||||
|
||||
if(
|
||||
(
|
||||
!!msg.message ||
|
||||
!!normalizedContent ||
|
||||
(msg.messageStubType === WAMessageStubType.CIPHERTEXT && treatCiphertextMessagesAsReal)
|
||||
)
|
||||
&& !msg.message?.protocolMessage
|
||||
&& !normalizedContent?.protocolMessage
|
||||
&& !normalizedContent?.reactionMessage
|
||||
) {
|
||||
chat.conversationTimestamp = toNumber(msg.messageTimestamp)
|
||||
if(!msg.key.fromMe) {
|
||||
|
||||
Reference in New Issue
Block a user