style: format linted files

This commit is contained in:
Peter Steinberger
2026-01-02 12:20:38 +01:00
parent fa16304e4f
commit b50df6eb1d
5 changed files with 59 additions and 26 deletions

View File

@@ -143,7 +143,9 @@ export function buildGroupDisplayName(params: {
return token ? `${surfaceKey}:${token}` : surfaceKey;
}
export function resolveGroupSessionKey(ctx: MsgContext): GroupKeyResolution | null {
export function resolveGroupSessionKey(
ctx: MsgContext,
): GroupKeyResolution | null {
const from = typeof ctx.From === "string" ? ctx.From.trim() : "";
if (!from) return null;
const chatType = ctx.ChatType?.trim().toLowerCase();
@@ -157,7 +159,9 @@ export function resolveGroupSessionKey(ctx: MsgContext): GroupKeyResolution | nu
const surfaceHint = ctx.Surface?.trim().toLowerCase();
const hasLegacyGroupPrefix = from.startsWith("group:");
const raw = (hasLegacyGroupPrefix ? from.slice("group:".length) : from).trim();
const raw = (
hasLegacyGroupPrefix ? from.slice("group:".length) : from
).trim();
let surface: string | undefined;
let kind: "group" | "channel" | undefined;
@@ -209,7 +213,12 @@ export function resolveGroupSessionKey(ctx: MsgContext): GroupKeyResolution | nu
const resolvedSurface = surface ?? surfaceHint;
if (!resolvedSurface) {
const legacy = hasLegacyGroupPrefix ? `group:${raw}` : `group:${from}`;
return { key: legacy, id: raw || from, legacyKey: legacy, chatType: "group" };
return {
key: legacy,
id: raw || from,
legacyKey: legacy,
chatType: "group",
};
}
const resolvedKind = kind === "channel" ? "channel" : "group";