Improve and/or break things

This commit is contained in:
Tulir Asokan
2017-11-15 22:43:55 +02:00
parent 667421c727
commit eb2de79a4b
7 changed files with 117 additions and 39 deletions
+6
View File
@@ -116,13 +116,19 @@ class MatrixUser {
async syncDialogs() {
const dialogs = await this.telegramPuppet.client("messages.getDialogs", {})
let changed = false
for (const dialog of dialogs.chats) {
if (dialog._ === "chatForbidden" || dialog.deactivated) {
continue
}
const peer = new TelegramPeer(dialog._, dialog.id)
const portal = await this.app.getPortalByPeer(peer)
if (portal.updateInfo(this.telegramPuppet, dialog)) {
portal.save()
changed = true
}
}
return changed
}
async sendTelegramCode(phoneNumber) {