fix: let both bots see each other's messages in paired rooms for natural ping-pong
This commit is contained in:
@@ -104,10 +104,14 @@ export function getProcessableMessages(
|
|||||||
messages: Parameters<typeof filterProcessableMessages>[0],
|
messages: Parameters<typeof filterProcessableMessages>[0],
|
||||||
channel?: Channel,
|
channel?: Channel,
|
||||||
) {
|
) {
|
||||||
|
const isPaired = isPairedRoomJid(chatJid);
|
||||||
return filterProcessableMessages(
|
return filterProcessableMessages(
|
||||||
messages,
|
messages,
|
||||||
isPairedRoomJid(chatJid),
|
isPaired,
|
||||||
channel?.isOwnMessage?.bind(channel),
|
// In paired rooms (unified mode), don't filter by isOwnMessage —
|
||||||
|
// both bots need to see each other's messages for the ping-pong flow.
|
||||||
|
// Loop prevention is handled by filterLoopingPairedBotMessages + round_trip_count.
|
||||||
|
isPaired ? undefined : channel?.isOwnMessage?.bind(channel),
|
||||||
).filter((message) => !isTaskStatusControlMessage(message.content));
|
).filter((message) => !isTaskStatusControlMessage(message.content));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user