From be4545a1cdbb9471e4bf23cbca4af1b0310cee44 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 8 Jan 2018 16:50:11 +0200 Subject: [PATCH] Don't join channels the user has left --- src/matrix-user.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/matrix-user.js b/src/matrix-user.js index 33ba778f..54960cdf 100644 --- a/src/matrix-user.js +++ b/src/matrix-user.js @@ -186,6 +186,7 @@ class MatrixUser { let changed = false for (const user of dialogs.users) { + this.app.debug("cyan", "Syncing data for", this.telegramPuppet.userID, JSON.stringify(user, "", " ")) if (!user.self) { continue } @@ -209,9 +210,10 @@ class MatrixUser { this.chats = [] for (const dialog of dialogs.chats) { - if (dialog._ === "chatForbidden" || dialog._ === "channelForbidden" || dialog.deactivated) { + if (dialog._ === "chatForbidden" || dialog._ === "channelForbidden" || dialog.deactivated || dialog.left) { continue } + this.app.debug("cyan", "Syncing data for ", this.telegramPuppet.userID, JSON.stringify(dialog, "", " ")) const peer = new TelegramPeer(dialog._, dialog.id, { accessHash: dialog.access_hash, })