Fix rooms claiming they are bridged when they aren't

This commit is contained in:
Travis Ralston 2018-10-19 19:34:11 -06:00
parent a0467c46e2
commit 5f0e9fec51
2 changed files with 6 additions and 13 deletions

View file

@ -29,20 +29,13 @@ export class DimensionTelegramService {
try {
const telegram = new TelegramBridge(userId);
const conf = await telegram.getChatConfiguration(chatId, roomId);
if (!conf) return {
bridged: false,
canUnbridge: true,
chatId: chatId,
roomId: null,
chatName: null,
};
return {
bridged: true,
canUnbridge: conf.canUnbridge,
chatId: chatId,
roomId: conf.roomId,
chatName: conf.chatName,
bridged: conf ? conf.bridged : false,
canUnbridge: conf ? conf.canUnbridge : false,
chatId: conf ? conf.chatId : null,
roomId: conf ? conf.roomId : null,
chatName: conf ? conf.chatName : null,
};
} catch (e) {
if (e.errcode) {

View file

@ -124,7 +124,7 @@ export class TelegramBridge {
try {
const info = await this.doProvisionRequest<PortalInformationResponse>(bridge, "GET", `/portal/${chatId}`, {room_id: roomId});
return {
bridged: !!info,
bridged: info && !!info.mxid,
chatId: chatId,
roomId: info ? info.mxid : null,
chatName: info ? info.title || info.username : null,