mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 01:30:21 +00:00
refactor(channels): route core through registered plugin capabilities
This commit is contained in:
@@ -54,6 +54,10 @@ import {
|
||||
resolveMatrixDirectUserId,
|
||||
resolveMatrixTargetIdentity,
|
||||
} from "./matrix/target-ids.js";
|
||||
import {
|
||||
setMatrixThreadBindingIdleTimeoutBySessionKey,
|
||||
setMatrixThreadBindingMaxAgeBySessionKey,
|
||||
} from "./matrix/thread-bindings-shared.js";
|
||||
import { getMatrixRuntime } from "./runtime.js";
|
||||
import { resolveMatrixOutboundSessionRoute } from "./session-route.js";
|
||||
import { matrixSetupAdapter } from "./setup-core.js";
|
||||
@@ -310,6 +314,46 @@ export const matrixPlugin: ChannelPlugin<ResolvedMatrixAccount, MatrixProbe> =
|
||||
},
|
||||
conversationBindings: {
|
||||
supportsCurrentConversationBinding: true,
|
||||
setIdleTimeoutBySessionKey: ({ targetSessionKey, accountId, idleTimeoutMs }) =>
|
||||
setMatrixThreadBindingIdleTimeoutBySessionKey({
|
||||
targetSessionKey,
|
||||
accountId: accountId ?? "",
|
||||
idleTimeoutMs,
|
||||
}).map((binding) => ({
|
||||
boundAt: binding.boundAt,
|
||||
lastActivityAt:
|
||||
typeof binding.metadata?.lastActivityAt === "number"
|
||||
? binding.metadata.lastActivityAt
|
||||
: binding.boundAt,
|
||||
idleTimeoutMs:
|
||||
typeof binding.metadata?.idleTimeoutMs === "number"
|
||||
? binding.metadata.idleTimeoutMs
|
||||
: undefined,
|
||||
maxAgeMs:
|
||||
typeof binding.metadata?.maxAgeMs === "number"
|
||||
? binding.metadata.maxAgeMs
|
||||
: undefined,
|
||||
})),
|
||||
setMaxAgeBySessionKey: ({ targetSessionKey, accountId, maxAgeMs }) =>
|
||||
setMatrixThreadBindingMaxAgeBySessionKey({
|
||||
targetSessionKey,
|
||||
accountId: accountId ?? "",
|
||||
maxAgeMs,
|
||||
}).map((binding) => ({
|
||||
boundAt: binding.boundAt,
|
||||
lastActivityAt:
|
||||
typeof binding.metadata?.lastActivityAt === "number"
|
||||
? binding.metadata.lastActivityAt
|
||||
: binding.boundAt,
|
||||
idleTimeoutMs:
|
||||
typeof binding.metadata?.idleTimeoutMs === "number"
|
||||
? binding.metadata.idleTimeoutMs
|
||||
: undefined,
|
||||
maxAgeMs:
|
||||
typeof binding.metadata?.maxAgeMs === "number"
|
||||
? binding.metadata.maxAgeMs
|
||||
: undefined,
|
||||
})),
|
||||
},
|
||||
messaging: {
|
||||
normalizeTarget: normalizeMatrixMessagingTarget,
|
||||
|
||||
Reference in New Issue
Block a user