mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-09-04 08:02:22 +00:00
Fix rooms claiming they are bridged when they aren't
This commit is contained in:
parent
a0467c46e2
commit
5f0e9fec51
@ -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) {
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user