mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05: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 {
|
||||
const normalizedAccountId = normalizeAccountId(accountId);
|
||||
const matrixBase = cfg.channels?.matrix ?? {};
|
||||
const accounts = cfg.channels?.matrix?.accounts;
|
||||
|
||||
// Try to get account-specific config first (direct lookup, then case-insensitive fallback)
|
||||
let accountConfig = matrixBase.accounts?.[normalizedAccountId];
|
||||
if (!accountConfig && matrixBase.accounts) {
|
||||
for (const key of Object.keys(matrixBase.accounts)) {
|
||||
let accountConfig = accounts?.[normalizedAccountId];
|
||||
if (!accountConfig && accounts) {
|
||||
for (const key of Object.keys(accounts)) {
|
||||
if (normalizeAccountId(key) === normalizedAccountId) {
|
||||
accountConfig = matrixBase.accounts[key];
|
||||
accountConfig = accounts[key];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user