good forst commit

This commit is contained in:
2026-06-09 02:02:40 +05:30
parent 801c1d7121
commit 249d759e6a
215 changed files with 15425 additions and 1240 deletions
+4 -4
View File
@@ -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 {