Fix logout and improve login-related management replies. Fixes #6

This commit is contained in:
Tulir Asokan
2017-11-25 17:10:21 +02:00
parent b66b65db65
commit a691315340
2 changed files with 6 additions and 8 deletions
+3 -4
View File
@@ -30,6 +30,7 @@ class MatrixUser {
this.phoneNumber = undefined
this.phoneCodeHash = undefined
this.commandStatus = undefined
this.puppetData = undefined
this.contacts = []
this._telegramPuppet = undefined
}
@@ -204,10 +205,8 @@ class MatrixUser {
}
async logOutFromTelegram() {
const ok = await this.telegramPuppet.logOut()
if (!ok) {
return false
}
this.telegramPuppet.logOut()
// TODO kick user from all portals
this._telegramPuppet = undefined
this.puppetData = undefined
await this.save()