mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:28:26 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -31,9 +31,13 @@ type OutboundDeliveryMeta = {
|
||||
|
||||
const resolveChannelLabel = (channel: string) => {
|
||||
const pluginLabel = getChannelPlugin(channel as ChannelId)?.meta.label;
|
||||
if (pluginLabel) return pluginLabel;
|
||||
if (pluginLabel) {
|
||||
return pluginLabel;
|
||||
}
|
||||
const normalized = normalizeChatChannelId(channel);
|
||||
if (normalized) return getChatChannelMeta(normalized).label;
|
||||
if (normalized) {
|
||||
return getChatChannelMeta(normalized).label;
|
||||
}
|
||||
return channel;
|
||||
};
|
||||
|
||||
@@ -48,10 +52,18 @@ export function formatOutboundDeliverySummary(
|
||||
const label = resolveChannelLabel(result.channel);
|
||||
const base = `✅ Sent via ${label}. Message ID: ${result.messageId}`;
|
||||
|
||||
if ("chatId" in result) return `${base} (chat ${result.chatId})`;
|
||||
if ("channelId" in result) return `${base} (channel ${result.channelId})`;
|
||||
if ("roomId" in result) return `${base} (room ${result.roomId})`;
|
||||
if ("conversationId" in result) return `${base} (conversation ${result.conversationId})`;
|
||||
if ("chatId" in result) {
|
||||
return `${base} (chat ${result.chatId})`;
|
||||
}
|
||||
if ("channelId" in result) {
|
||||
return `${base} (channel ${result.channelId})`;
|
||||
}
|
||||
if ("roomId" in result) {
|
||||
return `${base} (room ${result.roomId})`;
|
||||
}
|
||||
if ("conversationId" in result) {
|
||||
return `${base} (conversation ${result.conversationId})`;
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user