Add via param in join room function
Signed-off-by: ajbura <ajbura@gmail.com>
This commit is contained in:
parent
189dc93a6e
commit
e654226e60
1 changed files with 5 additions and 2 deletions
|
@ -82,12 +82,15 @@ function guessDMRoomTargetId(room, myUserId) {
|
|||
*
|
||||
* @param {string} roomId
|
||||
* @param {boolean} isDM
|
||||
* @param {string[]} via
|
||||
*/
|
||||
async function join(roomIdOrAlias, isDM) {
|
||||
async function join(roomIdOrAlias, isDM, via) {
|
||||
const mx = initMatrix.matrixClient;
|
||||
const roomIdParts = roomIdOrAlias.split(':');
|
||||
const viaServers = via || [roomIdParts[1]];
|
||||
|
||||
try {
|
||||
const resultRoom = await mx.joinRoom(roomIdOrAlias, { viaServers: [roomIdParts[1]] });
|
||||
const resultRoom = await mx.joinRoom(roomIdOrAlias, { viaServers });
|
||||
|
||||
if (isDM) {
|
||||
const targetUserId = guessDMRoomTargetId(mx.getRoom(resultRoom.roomId), mx.getUserId());
|
||||
|
|
Loading…
Reference in a new issue