Don't join channels the user has left

This commit is contained in:
Tulir Asokan
2018-01-08 16:50:11 +02:00
parent f84f32ee10
commit be4545a1cd
+3 -1
View File
@@ -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,
})