Stop parsing servername from roomId (#2391)

This commit is contained in:
Ajay Bura 2025-07-15 18:03:45 +05:30 committed by GitHub
parent fbd7e0a14b
commit c30c142653
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 9 additions and 16 deletions

View file

@ -93,11 +93,8 @@ function convertToRoom(mx, roomId) {
* @param {string[]} via
*/
async function join(mx, roomIdOrAlias, isDM = false, via = undefined) {
const roomIdParts = roomIdOrAlias.split(':');
const viaServers = via || [roomIdParts[1]];
try {
const resultRoom = await mx.joinRoom(roomIdOrAlias, { viaServers });
const resultRoom = await mx.joinRoom(roomIdOrAlias, { viaServers: via });
if (isDM) {
const targetUserId = guessDMRoomTargetId(mx.getRoom(resultRoom.roomId), mx.getUserId());