fix (telegram/whatsapp): use account-scoped pairing allowlists

This commit is contained in:
Vignesh Natarajan
2026-02-15 19:09:07 -08:00
parent ee10feb80e
commit 6957354d48
6 changed files with 35 additions and 5 deletions

View File

@@ -227,7 +227,11 @@ export const registerTelegramHandlers = ({
}
}
const storeAllowFrom = await readChannelAllowFromStore("telegram").catch(() => []);
const storeAllowFrom = await readChannelAllowFromStore(
"telegram",
process.env,
accountId,
).catch(() => []);
await processMessage(primaryEntry.ctx, allMedia, storeAllowFrom);
} catch (err) {
runtime.error?.(danger(`media group handler failed: ${String(err)}`));
@@ -258,7 +262,11 @@ export const registerTelegramHandlers = ({
date: last.msg.date ?? first.msg.date,
};
const storeAllowFrom = await readChannelAllowFromStore("telegram").catch(() => []);
const storeAllowFrom = await readChannelAllowFromStore(
"telegram",
process.env,
accountId,
).catch(() => []);
const baseCtx = first.ctx;
const getFile =
typeof baseCtx.getFile === "function" ? baseCtx.getFile.bind(baseCtx) : async () => ({});
@@ -330,6 +338,7 @@ export const registerTelegramHandlers = ({
const isForum = callbackMessage.chat.is_forum === true;
const groupAllowContext = await resolveTelegramGroupAllowFromContext({
chatId,
accountId,
isForum,
messageThreadId,
groupAllowFrom,
@@ -699,6 +708,7 @@ export const registerTelegramHandlers = ({
const isForum = msg.chat.is_forum === true;
const groupAllowContext = await resolveTelegramGroupAllowFromContext({
chatId,
accountId,
isForum,
messageThreadId,
groupAllowFrom,