|
|
@ -14,7 +14,7 @@ import { tsNow } from "../../helpers/date"; |
|
|
|
import { replaceContent } from "../../helpers/dom"; |
|
|
|
import { replaceContent } from "../../helpers/dom"; |
|
|
|
import renderImageFromUrl from "../../helpers/dom/renderImageFromUrl"; |
|
|
|
import renderImageFromUrl from "../../helpers/dom/renderImageFromUrl"; |
|
|
|
import sequentialDom from "../../helpers/sequentialDom"; |
|
|
|
import sequentialDom from "../../helpers/sequentialDom"; |
|
|
|
import { ChannelParticipantsFilter, ChannelsChannelParticipants, Chat, ChatFull, ChatParticipants, ChatPhoto, ExportedChatInvite, InputChannel, InputFile, InputFileLocation, PhotoSize, UserFull, UserProfilePhoto } from "../../layer"; |
|
|
|
import { ChannelParticipantsFilter, ChannelsChannelParticipants, Chat, ChatFull, ChatParticipants, ChatPhoto, ExportedChatInvite, InputChannel, InputFile, InputFileLocation, PhotoSize, Update, UserFull, UserProfilePhoto } from "../../layer"; |
|
|
|
//import apiManager from '../mtproto/apiManager';
|
|
|
|
//import apiManager from '../mtproto/apiManager';
|
|
|
|
import apiManager from '../mtproto/mtprotoworker'; |
|
|
|
import apiManager from '../mtproto/mtprotoworker'; |
|
|
|
import { RichTextProcessor } from "../richtextprocessor"; |
|
|
|
import { RichTextProcessor } from "../richtextprocessor"; |
|
|
@ -376,7 +376,7 @@ export class AppProfileManager { |
|
|
|
updates: [{ |
|
|
|
updates: [{ |
|
|
|
_: 'updateChannel', |
|
|
|
_: 'updateChannel', |
|
|
|
channel_id: id |
|
|
|
channel_id: id |
|
|
|
}], |
|
|
|
} as Update.updateChannel], |
|
|
|
chats: [channel], |
|
|
|
chats: [channel], |
|
|
|
users: [] |
|
|
|
users: [] |
|
|
|
}); |
|
|
|
}); |
|
|
@ -426,7 +426,7 @@ export class AppProfileManager { |
|
|
|
date: tsNow(true), |
|
|
|
date: tsNow(true), |
|
|
|
photo: appUsersManager.getUser(myId).photo, |
|
|
|
photo: appUsersManager.getUser(myId).photo, |
|
|
|
previous: true |
|
|
|
previous: true |
|
|
|
} |
|
|
|
} as Update.updateUserPhoto |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -520,6 +520,10 @@ export class AppProfileManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const renderPromise = loadPromise.then((url) => { |
|
|
|
const renderPromise = loadPromise.then((url) => { |
|
|
|
|
|
|
|
/* if(photo.stripped_thumb) { |
|
|
|
|
|
|
|
url = appPhotosManager.getPreviewURLFromBytes(photo.stripped_thumb); |
|
|
|
|
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
|
|
return new Promise<void>((resolve) => { |
|
|
|
return new Promise<void>((resolve) => { |
|
|
|
renderImageFromUrl(img, url, () => { |
|
|
|
renderImageFromUrl(img, url, () => { |
|
|
|
callback(); |
|
|
|
callback(); |
|
|
@ -537,7 +541,7 @@ export class AppProfileManager { |
|
|
|
|
|
|
|
|
|
|
|
const size: PeerPhotoSize = 'photo_small'; |
|
|
|
const size: PeerPhotoSize = 'photo_small'; |
|
|
|
const avatarAvailable = !!photo; |
|
|
|
const avatarAvailable = !!photo; |
|
|
|
const avatarRendered = !!div.firstElementChild; |
|
|
|
const avatarRendered = div.firstElementChild && !(div.firstElementChild as HTMLElement).classList.contains('emoji'); |
|
|
|
|
|
|
|
|
|
|
|
const myId = rootScope.myId; |
|
|
|
const myId = rootScope.myId; |
|
|
|
|
|
|
|
|
|
|
@ -573,7 +577,8 @@ export class AppProfileManager { |
|
|
|
|
|
|
|
|
|
|
|
let abbr: string; |
|
|
|
let abbr: string; |
|
|
|
if(!title) { |
|
|
|
if(!title) { |
|
|
|
abbr = appPeersManager.getPeer(peerId).initials ?? ''; |
|
|
|
const peer = appPeersManager.getPeer(peerId); |
|
|
|
|
|
|
|
abbr = peer.initials ?? ''; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
abbr = RichTextProcessor.getAbbreviation(title); |
|
|
|
abbr = RichTextProcessor.getAbbreviation(title); |
|
|
|
} |
|
|
|
} |
|
|
|