mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 21:51:36 +00:00
chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -44,20 +44,13 @@ export function buildGroupDisplayName(params: {
|
||||
if (!params.room && token.startsWith("#")) {
|
||||
token = token.replace(/^#+/, "");
|
||||
}
|
||||
if (
|
||||
token &&
|
||||
!/^[@#]/.test(token) &&
|
||||
!token.startsWith("g-") &&
|
||||
!token.includes("#")
|
||||
) {
|
||||
if (token && !/^[@#]/.test(token) && !token.startsWith("g-") && !token.includes("#")) {
|
||||
token = `g-${token}`;
|
||||
}
|
||||
return token ? `${providerKey}:${token}` : providerKey;
|
||||
}
|
||||
|
||||
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();
|
||||
@@ -71,9 +64,7 @@ export function resolveGroupSessionKey(
|
||||
|
||||
const providerHint = ctx.Provider?.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 provider: string | undefined;
|
||||
let kind: "group" | "channel" | undefined;
|
||||
|
||||
Reference in New Issue
Block a user