Allow upgrading Telegram groups to supergroups from Matrix

This commit is contained in:
Tulir Asokan
2017-12-03 22:34:47 +02:00
parent 58ea45638e
commit 8a082a4598
4 changed files with 39 additions and 9 deletions
+10
View File
@@ -541,6 +541,16 @@ class Portal {
await this.save()
}
async upgradeTelegramChat(telegramPOV) {
if (this.peer.type !== "chat") {
throw new Error("Can't upgrade non-chat portal.")
}
const updates = await telegramPOV.client("messages.migrateChat", {
chat_id: this.id,
})
await telegramPOV.handleUpdate(updates)
}
/**
* Create a Matrix room for this portal.
*