feat(matrix): add Matrix channel adapter
This commit is contained in:
+15
-1
@@ -1,6 +1,6 @@
|
||||
import type { Config } from '../config/index.js';
|
||||
import type { HookEngine } from '../hooks/index.js';
|
||||
import { ChannelRegistry, TelegramAdapter, WebChatAdapter, DiscordAdapter, SlackAdapter, WhatsAppAdapter, PairingManager } from '../channels/index.js';
|
||||
import { ChannelRegistry, TelegramAdapter, WebChatAdapter, DiscordAdapter, SlackAdapter, WhatsAppAdapter, MatrixAdapter, PairingManager } from '../channels/index.js';
|
||||
import { CronScheduler, WebhookHandler, GmailWatcher } from '../automation/index.js';
|
||||
import type { GatewayServer } from '../gateway/index.js';
|
||||
|
||||
@@ -70,6 +70,20 @@ export function registerChannels(deps: ChannelsDeps): ChannelsResult {
|
||||
channelRegistry.register(whatsappAdapter);
|
||||
}
|
||||
|
||||
// Register Matrix adapter (if configured)
|
||||
if (config.matrix) {
|
||||
const matrixAdapter = new MatrixAdapter({
|
||||
homeserverUrl: config.matrix.homeserver_url,
|
||||
accessToken: config.matrix.access_token,
|
||||
allowedRoomIds: config.matrix.allowed_room_ids.length > 0 ? config.matrix.allowed_room_ids : undefined,
|
||||
requireMention: config.matrix.require_mention,
|
||||
syncTimeoutMs: config.matrix.sync_timeout_ms,
|
||||
displayName: config.matrix.display_name,
|
||||
pairingManager,
|
||||
});
|
||||
channelRegistry.register(matrixAdapter);
|
||||
}
|
||||
|
||||
// Register WebChat adapter (wraps the gateway)
|
||||
const webChatAdapter = new WebChatAdapter({ gateway });
|
||||
channelRegistry.register(webChatAdapter);
|
||||
|
||||
Reference in New Issue
Block a user