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 {
|
try {
|
||||||
const telegram = new TelegramBridge(userId);
|
const telegram = new TelegramBridge(userId);
|
||||||
const conf = await telegram.getChatConfiguration(chatId, roomId);
|
const conf = await telegram.getChatConfiguration(chatId, roomId);
|
||||||
if (!conf) return {
|
|
||||||
bridged: false,
|
|
||||||
canUnbridge: true,
|
|
||||||
chatId: chatId,
|
|
||||||
roomId: null,
|
|
||||||
chatName: null,
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
bridged: true,
|
bridged: conf ? conf.bridged : false,
|
||||||
canUnbridge: conf.canUnbridge,
|
canUnbridge: conf ? conf.canUnbridge : false,
|
||||||
chatId: chatId,
|
chatId: conf ? conf.chatId : null,
|
||||||
roomId: conf.roomId,
|
roomId: conf ? conf.roomId : null,
|
||||||
chatName: conf.chatName,
|
chatName: conf ? conf.chatName : null,
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.errcode) {
|
if (e.errcode) {
|
||||||
|
@ -124,7 +124,7 @@ export class TelegramBridge {
|
|||||||
try {
|
try {
|
||||||
const info = await this.doProvisionRequest<PortalInformationResponse>(bridge, "GET", `/portal/${chatId}`, {room_id: roomId});
|
const info = await this.doProvisionRequest<PortalInformationResponse>(bridge, "GET", `/portal/${chatId}`, {room_id: roomId});
|
||||||
return {
|
return {
|
||||||
bridged: !!info,
|
bridged: info && !!info.mxid,
|
||||||
chatId: chatId,
|
chatId: chatId,
|
||||||
roomId: info ? info.mxid : null,
|
roomId: info ? info.mxid : null,
|
||||||
chatName: info ? info.title || info.username : null,
|
chatName: info ? info.title || info.username : null,
|
||||||
|
Loading…
Reference in New Issue
Block a user