mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix(matrix): land #31201 preserve room ID casing (@williamos-dev)
Landed from contributor PR #31201 by @williamos-dev. Co-authored-by: williamos-dev <williamos-dev@users.noreply.github.com>
This commit is contained in:
@@ -71,4 +71,15 @@ describe("matrix directory live", () => {
|
||||
expect(result).toEqual([]);
|
||||
expect(resolveMatrixAuth).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("preserves original casing for room IDs without :server suffix", async () => {
|
||||
const mixedCaseId = "!EonMPPbOuhntHEHgZ2dnBO-c_EglMaXlIh2kdo8cgiA";
|
||||
const result = await listMatrixDirectoryGroupsLive({
|
||||
cfg,
|
||||
query: mixedCaseId,
|
||||
});
|
||||
|
||||
expect(result).toHaveLength(1);
|
||||
expect(result[0].id).toBe(mixedCaseId);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -174,7 +174,8 @@ export async function listMatrixDirectoryGroupsLive(
|
||||
}
|
||||
|
||||
if (query.startsWith("!")) {
|
||||
return [createGroupDirectoryEntry({ id: query, name: query })];
|
||||
const originalId = params.query?.trim() ?? query;
|
||||
return [createGroupDirectoryEntry({ id: originalId, name: originalId })];
|
||||
}
|
||||
|
||||
const joined = await fetchMatrixJson<MatrixJoinedRoomsResponse>({
|
||||
|
||||
Reference in New Issue
Block a user