mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-25 03:04:29 -04:00
refactor: read accounts from cfg.channels.matrix.accounts directly for clarity
This commit is contained in:
committed by
Peter Steinberger
parent
bf4e348440
commit
1a72902991
@@ -21,13 +21,14 @@ export function resolveMatrixConfigForAccount(
|
|||||||
): MatrixResolvedConfig {
|
): MatrixResolvedConfig {
|
||||||
const normalizedAccountId = normalizeAccountId(accountId);
|
const normalizedAccountId = normalizeAccountId(accountId);
|
||||||
const matrixBase = cfg.channels?.matrix ?? {};
|
const matrixBase = cfg.channels?.matrix ?? {};
|
||||||
|
const accounts = cfg.channels?.matrix?.accounts;
|
||||||
|
|
||||||
// Try to get account-specific config first (direct lookup, then case-insensitive fallback)
|
// Try to get account-specific config first (direct lookup, then case-insensitive fallback)
|
||||||
let accountConfig = matrixBase.accounts?.[normalizedAccountId];
|
let accountConfig = accounts?.[normalizedAccountId];
|
||||||
if (!accountConfig && matrixBase.accounts) {
|
if (!accountConfig && accounts) {
|
||||||
for (const key of Object.keys(matrixBase.accounts)) {
|
for (const key of Object.keys(accounts)) {
|
||||||
if (normalizeAccountId(key) === normalizedAccountId) {
|
if (normalizeAccountId(key) === normalizedAccountId) {
|
||||||
accountConfig = matrixBase.accounts[key];
|
accountConfig = accounts[key];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user