refactor: prune room legacy

This commit is contained in:
Peter Steinberger
2026-01-17 07:41:01 +00:00
parent 6d969fe58e
commit d5fdda8e28
15 changed files with 43 additions and 34 deletions

View File

@@ -242,14 +242,19 @@ export async function initSessionState(params: {
const channel = groupResolution.channel;
const subject = ctx.GroupSubject?.trim();
const space = ctx.GroupSpace?.trim();
const explicitRoom = ctx.GroupRoom?.trim();
const explicitChannel = ctx.GroupChannel?.trim();
const normalizedChannel = normalizeChannelId(channel);
const isRoomProvider = Boolean(
const isChannelProvider = Boolean(
normalizedChannel &&
getChannelDock(normalizedChannel)?.capabilities.chatTypes.includes("channel"),
);
const nextRoom =
explicitRoom ?? (isRoomProvider && subject && subject.startsWith("#") ? subject : undefined);
explicitChannel ??
((groupResolution.chatType === "channel" || isChannelProvider) &&
subject &&
subject.startsWith("#")
? subject
: undefined);
const nextSubject = nextRoom ? undefined : subject;
sessionEntry.chatType = groupResolution.chatType ?? "group";
sessionEntry.channel = channel;