|
|
@ -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 |
|
|
|