Browse Source

fixed leaving supergroup as creator

master
Igor Zhukov 7 years ago
parent
commit
0c614b0780
  1. 4
      app/js/services.js

4
app/js/services.js

@ -802,17 +802,17 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
function wrapParticipants(id, participants) { function wrapParticipants(id, participants) {
var chat = getChat(id) var chat = getChat(id)
var myID = AppUsersManager.getSelf().id
if (isChannel(id)) { if (isChannel(id)) {
var isAdmin = chat.pFlags.creator || chat.pFlags.editor || chat.pFlags.moderator var isAdmin = chat.pFlags.creator || chat.pFlags.editor || chat.pFlags.moderator
angular.forEach(participants, function (participant) { angular.forEach(participants, function (participant) {
participant.canLeave = participant._ == 'channelParticipantSelf' participant.canLeave = myID == participant.user_id
participant.canKick = isAdmin && participant._ == 'channelParticipant' participant.canKick = isAdmin && participant._ == 'channelParticipant'
// just for order by last seen // just for order by last seen
participant.user = AppUsersManager.getUser(participant.user_id) participant.user = AppUsersManager.getUser(participant.user_id)
}) })
} else { } else {
var myID = AppUsersManager.getSelf().id
var isAdmin = chat.pFlags.creator || chat.pFlags.admins_enabled && chat.pFlags.admin var isAdmin = chat.pFlags.creator || chat.pFlags.admins_enabled && chat.pFlags.admin
angular.forEach(participants, function (participant) { angular.forEach(participants, function (participant) {
participant.canLeave = myID == participant.user_id participant.canLeave = myID == participant.user_id

Loading…
Cancel
Save