feat(config): gate channel config writes

This commit is contained in:
Peter Steinberger
2026-01-15 01:41:11 +00:00
parent f65668cb5f
commit ad8799522c
28 changed files with 576 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import { firstDefined, isSenderAllowed, normalizeAllowFrom } from "./bot-access.
import { MEDIA_GROUP_TIMEOUT_MS, type MediaGroupEntry } from "./bot-updates.js";
import { migrateTelegramGroupConfig } from "./group-migration.js";
import { readTelegramAllowFromStore } from "./pairing-store.js";
import { resolveChannelConfigWrites } from "../channels/plugins/config-writes.js";
export const registerTelegramHandlers = ({
cfg,
@@ -93,6 +94,13 @@ export const registerTelegramHandlers = ({
runtime.log?.(warn(`[telegram] Group migrated: "${chatTitle}" ${oldChatId}${newChatId}`));
if (!resolveChannelConfigWrites({ cfg, channelId: "telegram", accountId })) {
runtime.log?.(
warn("[telegram] Config writes disabled; skipping group config migration."),
);
return;
}
// Check if old chat ID has config and migrate it
const currentConfig = loadConfig();
const migration = migrateTelegramGroupConfig({