style: apply oxfmt
This commit is contained in:
@@ -80,7 +80,9 @@ export async function listSlackDirectoryPeersLive(
|
||||
const name = member.profile?.display_name || member.profile?.real_name || member.real_name;
|
||||
const handle = member.name;
|
||||
const email = member.profile?.email;
|
||||
const candidates = [name, handle, email].map((item) => item?.trim().toLowerCase()).filter(Boolean);
|
||||
const candidates = [name, handle, email]
|
||||
.map((item) => item?.trim().toLowerCase())
|
||||
.filter(Boolean);
|
||||
if (!query) return true;
|
||||
return candidates.some((candidate) => candidate?.includes(query));
|
||||
});
|
||||
|
||||
@@ -187,9 +187,7 @@ export async function monitorSlackProvider(opts: MonitorSlackOpts = {}) {
|
||||
unresolved.push(entry.input);
|
||||
continue;
|
||||
}
|
||||
mapping.push(
|
||||
`${entry.input}→${entry.id}${entry.archived ? " (archived)" : ""}`,
|
||||
);
|
||||
mapping.push(`${entry.input}→${entry.id}${entry.archived ? " (archived)" : ""}`);
|
||||
const existing = nextChannels[entry.id] ?? {};
|
||||
nextChannels[entry.id] = { ...source, ...existing };
|
||||
}
|
||||
@@ -276,7 +274,9 @@ export async function monitorSlackProvider(opts: MonitorSlackOpts = {}) {
|
||||
ctx.channelsConfig = nextChannels;
|
||||
summarizeMapping("slack channel users", mapping, unresolved, runtime);
|
||||
} catch (err) {
|
||||
runtime.log?.(`slack channel user resolve failed; using config entries. ${String(err)}`);
|
||||
runtime.log?.(
|
||||
`slack channel user resolve failed; using config entries. ${String(err)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,11 +88,7 @@ function scoreSlackUser(user: SlackUserLookup, match: { name?: string; email?: s
|
||||
if (match.email && user.email === match.email) score += 5;
|
||||
if (match.name) {
|
||||
const target = match.name.toLowerCase();
|
||||
const candidates = [
|
||||
user.name,
|
||||
user.displayName,
|
||||
user.realName,
|
||||
]
|
||||
const candidates = [user.name, user.displayName, user.realName]
|
||||
.map((value) => value?.toLowerCase())
|
||||
.filter(Boolean) as string[];
|
||||
if (candidates.some((value) => value === target)) score += 2;
|
||||
@@ -147,11 +143,7 @@ export async function resolveSlackUserAllowlist(params: {
|
||||
if (parsed.name) {
|
||||
const target = parsed.name.toLowerCase();
|
||||
const matches = users.filter((user) => {
|
||||
const candidates = [
|
||||
user.name,
|
||||
user.displayName,
|
||||
user.realName,
|
||||
]
|
||||
const candidates = [user.name, user.displayName, user.realName]
|
||||
.map((value) => value?.toLowerCase())
|
||||
.filter(Boolean) as string[];
|
||||
return candidates.includes(target);
|
||||
|
||||
Reference in New Issue
Block a user