From 0c614b078073447bdd084ccc1030243dda96cb72 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Tue, 16 Jan 2018 10:23:17 +0400 Subject: [PATCH] fixed leaving supergroup as creator --- app/js/services.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/js/services.js b/app/js/services.js index 9315eccc..3f0145d4 100755 --- a/app/js/services.js +++ b/app/js/services.js @@ -802,17 +802,17 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) function wrapParticipants(id, participants) { var chat = getChat(id) + var myID = AppUsersManager.getSelf().id if (isChannel(id)) { var isAdmin = chat.pFlags.creator || chat.pFlags.editor || chat.pFlags.moderator angular.forEach(participants, function (participant) { - participant.canLeave = participant._ == 'channelParticipantSelf' + participant.canLeave = myID == participant.user_id participant.canKick = isAdmin && participant._ == 'channelParticipant' // just for order by last seen participant.user = AppUsersManager.getUser(participant.user_id) }) } else { - var myID = AppUsersManager.getSelf().id var isAdmin = chat.pFlags.creator || chat.pFlags.admins_enabled && chat.pFlags.admin angular.forEach(participants, function (participant) { participant.canLeave = myID == participant.user_id