good forst commit
This commit is contained in:
@@ -46,6 +46,7 @@ export function normalizeMessage(
|
||||
export function normalizeReaction(
|
||||
msg: proto.IWebMessageInfo,
|
||||
accountId: string,
|
||||
selfJid?: string,
|
||||
): NormalizedReaction | null {
|
||||
const key = msg.key;
|
||||
if (!key) return null;
|
||||
@@ -53,8 +54,7 @@ export function normalizeReaction(
|
||||
const remoteJid = key.remoteJid ?? '';
|
||||
// only group messages (group JIDs end with @g.us)
|
||||
if (!remoteJid.endsWith('@g.us')) return null;
|
||||
// skip our own outgoing messages
|
||||
if (key.fromMe) return null;
|
||||
// Allow fromMe reactions — admin may star from the connected account
|
||||
|
||||
const reaction = msg.message?.reactionMessage;
|
||||
if (!reaction) return null;
|
||||
@@ -62,8 +62,8 @@ export function normalizeReaction(
|
||||
const targetMsgId = reaction.key?.id;
|
||||
if (!targetMsgId) return null;
|
||||
|
||||
// Ensure reactorJid is not empty (group message must have a participant)
|
||||
const reactorJid = key.participant;
|
||||
// For fromMe reactions Baileys uses LID internally; use selfJid (PN format) to match TOWER_ADMIN_JIDS
|
||||
const reactorJid = key.fromMe ? (selfJid ?? key.participant) : key.participant;
|
||||
if (!reactorJid) return null;
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user