From 0709e909bdb9146cfdfbf251c765899f4170c9a6 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 1 Dec 2017 16:44:43 +0200 Subject: [PATCH] Fix non-cached getPortalByRoomID --- src/portal.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/portal.js b/src/portal.js index 51262d2d..43d6dc13 100644 --- a/src/portal.js +++ b/src/portal.js @@ -42,7 +42,7 @@ class Portal { throw new Error("MatrixUser can only be created from entry type \"portal\"") } - const portal = new Portal(app, entry.data.roomID, TelegramPeer.fromSubentry(entry.data.peer)) + const portal = new Portal(app, entry.roomID || entry.data.roomID, TelegramPeer.fromSubentry(entry.data.peer)) portal.photo = entry.data.photo portal.avatarURL = entry.data.avatarURL if (portal.peer.type === "channel") { @@ -209,6 +209,7 @@ class Portal { } catch (err) { console.error("Error creating room:", err) console.error(err.stack) + return } } @@ -450,8 +451,8 @@ class Portal { type: this.type, id: this.id, receiverID: this.receiverID, + roomID: this.roomID, data: { - roomID: this.roomID, peer: this.peer.toSubentry(), photo: this.photo, avatarURL: this.avatarURL,