Fixed mentions in supergroups

Closes #1584
This commit is contained in:
Igor Zhukov 2018-01-02 21:06:21 +04:00
parent 617b138deb
commit c168a26382
2 changed files with 13 additions and 4 deletions

View File

@ -2512,8 +2512,14 @@ angular.module('myApp.controllers', ['myApp.i18n'])
})
var chatParticipantsPromise
if (peerID < 0) {
chatParticipantsPromise = AppProfileManager.getChatFull(-peerID).then(function (chatFull) {
var participantsVector = (chatFull.participants || {}).participants || []
if (AppPeersManager.isChannel(peerID)) {
chatParticipantsPromise = AppProfileManager.getChannelParticipants(-peerID)
} else {
chatParticipantsPromise = AppProfileManager.getChatFull(-peerID).then(function (chatFull) {
return (chatFull.participants || {}).participants || []
})
}
chatParticipantsPromise = chatParticipantsPromise.then(function (participantsVector) {
var ids = []
angular.forEach(participantsVector, function (participant) {
ids.push(participant.user_id)

View File

@ -1208,8 +1208,11 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
if (filter._ == 'channelParticipantsRecent') {
var chat = AppChatsManager.getChat(id)
if (chat.pFlags.kicked ||
chat.pFlags.broadcast && !chat.pFlags.creator && !chat.admin_rights) {
if (chat &&
chat.pFlags && (
chat.pFlags.kicked ||
chat.pFlags.broadcast && !chat.pFlags.creator && !chat.admin_rights
)) {
return $q.reject()
}
}