mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 03:03:24 +08:00
Show WhatsApp channel peer next to Agent Preset in session header (4.9.1-ops.20).
Plugins inject conversation.session.header.actions; resolve sessionId back to the bound chat and render nickname/phone or group title. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
2718586fda
commit
37742043a9
15 changed files with 852 additions and 326 deletions
|
|
@ -44,6 +44,10 @@ import { WhatsappSettingsTab } from './channels/whatsapp/index.js';
|
|||
import { installWhatsappStyles } from './channels/whatsapp/styles.js';
|
||||
import { en, h, IM_LOCALE_NAMESPACE, setImTranslator, zh } from './i18n.js';
|
||||
import { BotSettingsContext } from './channel-card-meta.js';
|
||||
import {
|
||||
ChannelPeerLabel,
|
||||
resolveWhatsappChannelPeer,
|
||||
} from './channel-peer-label.js';
|
||||
import {
|
||||
DELIVERY_RPC_CHANNEL,
|
||||
DeliveryTargetSettingsPage,
|
||||
|
|
@ -376,6 +380,18 @@ export function apply(ctx) {
|
|||
pickDirectory: () => callWorkspaceDirectoryApi(ctx, 'pickDirectory'),
|
||||
});
|
||||
|
||||
const resolveChannelPeer = (sessionId, signal) =>
|
||||
resolveWhatsappChannelPeer(whatsappRpcCall, sessionId, signal);
|
||||
|
||||
ctx.slots.inject('conversation.session.header.actions', () => ctx.slots.register({
|
||||
name: 'conversation.session.header.actions',
|
||||
id: 'im-channel-peer',
|
||||
// Immediately after Agent Preset (−10); schedule/jobs follow at 10+.
|
||||
order: 0,
|
||||
locale: IM_LOCALE_NAMESPACE,
|
||||
inject: () => ({ resolveChannelPeer }),
|
||||
}, ChannelPeerLabel));
|
||||
|
||||
ctx.slots.inject('settings.section', () => ctx.slots.register({
|
||||
name: 'settings.section',
|
||||
id: 'xmanrui-dsh-im',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue