refactor: prune legacy group prefixes

This commit is contained in:
Peter Steinberger
2026-01-17 08:46:19 +00:00
parent ab49fe0e92
commit 13b931c006
44 changed files with 160 additions and 179 deletions

View File

@@ -23,11 +23,13 @@ export function resolveAnnounceTargetFromKey(sessionKey: string): AnnounceTarget
if (!channelRaw) return null;
const normalizedChannel = normalizeChannelId(channelRaw);
const channel = normalizedChannel ?? channelRaw.toLowerCase();
const kindTarget = normalizedChannel
? kind === "channel"
? `channel:${id}`
: `group:${id}`
: id;
const kindTarget = (() => {
if (!normalizedChannel) return id;
if (normalizedChannel === "discord" || normalizedChannel === "slack") {
return `channel:${id}`;
}
return kind === "channel" ? `channel:${id}` : `group:${id}`;
})();
const normalized = normalizedChannel
? getChannelPlugin(normalizedChannel)?.messaging?.normalizeTarget?.(kindTarget)
: undefined;