|
|
|
@ -14,7 +14,7 @@ import { tsNow } from "../../helpers/date";
@@ -14,7 +14,7 @@ import { tsNow } from "../../helpers/date";
|
|
|
|
|
import { replaceContent } from "../../helpers/dom"; |
|
|
|
|
import renderImageFromUrl from "../../helpers/dom/renderImageFromUrl"; |
|
|
|
|
import sequentialDom from "../../helpers/sequentialDom"; |
|
|
|
|
import { ChannelParticipantsFilter, ChannelsChannelParticipants, ChatFull, ChatParticipants, ChatPhoto, ExportedChatInvite, InputChannel, InputFile, InputFileLocation, PhotoSize, UserFull, UserProfilePhoto } from "../../layer"; |
|
|
|
|
import { ChannelParticipantsFilter, ChannelsChannelParticipants, Chat, ChatFull, ChatParticipants, ChatPhoto, ExportedChatInvite, InputChannel, InputFile, InputFileLocation, PhotoSize, UserFull, UserProfilePhoto } from "../../layer"; |
|
|
|
|
//import apiManager from '../mtproto/apiManager';
|
|
|
|
|
import apiManager from '../mtproto/mtprotoworker'; |
|
|
|
|
import { RichTextProcessor } from "../richtextprocessor"; |
|
|
|
@ -97,10 +97,11 @@ export class AppProfileManager {
@@ -97,10 +97,11 @@ export class AppProfileManager {
|
|
|
|
|
|
|
|
|
|
rootScope.on('chat_update', (chatId) => { |
|
|
|
|
const fullChat = this.chatsFull[chatId]; |
|
|
|
|
const chat = appChatsManager.getChat(chatId); |
|
|
|
|
const chat: Chat.chat = appChatsManager.getChat(chatId); |
|
|
|
|
if(!chat.photo || !fullChat) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const emptyPhoto = chat.photo._ === 'chatPhotoEmpty'; |
|
|
|
|
//////console.log('chat_update:', fullChat);
|
|
|
|
|
if(fullChat.chat_photo && emptyPhoto !== (fullChat.chat_photo._ === 'photoEmpty')) { |
|
|
|
@ -112,9 +113,9 @@ export class AppProfileManager {
@@ -112,9 +113,9 @@ export class AppProfileManager {
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const smallUserpic = chat.photo.photo_small; |
|
|
|
|
const smallPhotoSize = fullChat.chat_photo ? appPhotosManager.choosePhotoSize(fullChat.chat_photo as MyPhoto, 0, 0) : undefined; |
|
|
|
|
if(!smallPhotoSize || JSON.stringify(smallUserpic) !== JSON.stringify((smallPhotoSize as PhotoSize.photoSize).location)) { |
|
|
|
|
const photoId = (chat.photo as ChatPhoto.chatPhoto).photo_id; |
|
|
|
|
const chatFullPhotoId = fullChat.chat_photo?.id; |
|
|
|
|
if(chatFullPhotoId !== photoId) { |
|
|
|
|
delete this.chatsFull[chatId]; |
|
|
|
|
rootScope.broadcast('chat_full_update', chatId); |
|
|
|
|
} |
|
|
|
@ -328,10 +329,10 @@ export class AppProfileManager {
@@ -328,10 +329,10 @@ export class AppProfileManager {
|
|
|
|
|
} */ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public getChannelParticipant(id: number, userId: number) { |
|
|
|
|
public getChannelParticipant(id: number, peerId: number) { |
|
|
|
|
return apiManager.invokeApiSingle('channels.getParticipant', { |
|
|
|
|
channel: appChatsManager.getChannelInput(id), |
|
|
|
|
user_id: appUsersManager.getUserInput(userId) |
|
|
|
|
participant: appPeersManager.getInputPeerById(peerId), |
|
|
|
|
}).then(channelParticipant => { |
|
|
|
|
appUsersManager.saveApiUsers(channelParticipant.users); |
|
|
|
|
return channelParticipant.participant; |
|
|
|
@ -452,8 +453,7 @@ export class AppProfileManager {
@@ -452,8 +453,7 @@ export class AppProfileManager {
|
|
|
|
|
_: 'inputPeerPhotoFileLocation', |
|
|
|
|
pFlags: {}, |
|
|
|
|
peer: inputPeer, |
|
|
|
|
volume_id: photo[size].volume_id, |
|
|
|
|
local_id: photo[size].local_id |
|
|
|
|
photo_id: photo.photo_id |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
if(size === 'photo_big') { |
|
|
|
@ -536,7 +536,7 @@ export class AppProfileManager {
@@ -536,7 +536,7 @@ export class AppProfileManager {
|
|
|
|
|
const photo = appPeersManager.getPeerPhoto(peerId); |
|
|
|
|
|
|
|
|
|
const size: PeerPhotoSize = 'photo_small'; |
|
|
|
|
const avatarAvailable = photo && photo[size]; |
|
|
|
|
const avatarAvailable = !!photo; |
|
|
|
|
const avatarRendered = !!div.firstElementChild; |
|
|
|
|
|
|
|
|
|
const myId = rootScope.myId; |
|
|
|
|