mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 23:58:25 +00:00
refactor: centralize channel ui metadata
This commit is contained in:
29
src/channels/plugins/bluebubbles-actions.ts
Normal file
29
src/channels/plugins/bluebubbles-actions.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { ChannelMessageActionName } from "./types.js";
|
||||
|
||||
export type BlueBubblesActionSpec = {
|
||||
gate: string;
|
||||
groupOnly?: boolean;
|
||||
unsupportedOnMacOS26?: boolean;
|
||||
};
|
||||
|
||||
export const BLUEBUBBLES_ACTIONS = {
|
||||
react: { gate: "reactions" },
|
||||
edit: { gate: "edit", unsupportedOnMacOS26: true },
|
||||
unsend: { gate: "unsend" },
|
||||
reply: { gate: "reply" },
|
||||
sendWithEffect: { gate: "sendWithEffect" },
|
||||
renameGroup: { gate: "renameGroup", groupOnly: true },
|
||||
setGroupIcon: { gate: "setGroupIcon", groupOnly: true },
|
||||
addParticipant: { gate: "addParticipant", groupOnly: true },
|
||||
removeParticipant: { gate: "removeParticipant", groupOnly: true },
|
||||
leaveGroup: { gate: "leaveGroup", groupOnly: true },
|
||||
sendAttachment: { gate: "sendAttachment" },
|
||||
} as const satisfies Partial<Record<ChannelMessageActionName, BlueBubblesActionSpec>>;
|
||||
|
||||
export const BLUEBUBBLES_ACTION_NAMES = Object.keys(
|
||||
BLUEBUBBLES_ACTIONS,
|
||||
) as ChannelMessageActionName[];
|
||||
|
||||
export const BLUEBUBBLES_GROUP_ACTIONS = new Set<ChannelMessageActionName>(
|
||||
BLUEBUBBLES_ACTION_NAMES.filter((action) => BLUEBUBBLES_ACTIONS[action]?.groupOnly),
|
||||
);
|
||||
Reference in New Issue
Block a user