Various improvements

This commit is contained in:
Ali
2023-10-23 23:35:39 +04:00
parent f957979db9
commit 29ee666889
29 changed files with 306 additions and 108 deletions

View File

@@ -620,7 +620,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
self.stickerSettings = ChatInterfaceStickerSettings()
self.presentationInterfaceState = ChatPresentationInterfaceState(chatWallpaper: self.presentationData.chatWallpaper, theme: self.presentationData.theme, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameDisplayOrder: self.presentationData.nameDisplayOrder, limitsConfiguration: context.currentLimitsConfiguration.with { $0 }, fontSize: self.presentationData.chatFontSize, bubbleCorners: self.presentationData.chatBubbleCorners, accountPeerId: context.account.peerId, mode: mode, chatLocation: chatLocation, subject: subject, peerNearbyData: peerNearbyData, greetingData: context.prefetchManager?.preloadedGreetingSticker, pendingUnpinnedAllMessages: false, activeGroupCallInfo: nil, hasActiveGroupCall: false, importState: nil, threadData: nil, isGeneralThreadClosed: nil, replyMessage: nil)
self.presentationInterfaceState = ChatPresentationInterfaceState(chatWallpaper: self.presentationData.chatWallpaper, theme: self.presentationData.theme, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameDisplayOrder: self.presentationData.nameDisplayOrder, limitsConfiguration: context.currentLimitsConfiguration.with { $0 }, fontSize: self.presentationData.chatFontSize, bubbleCorners: self.presentationData.chatBubbleCorners, accountPeerId: context.account.peerId, mode: mode, chatLocation: chatLocation, subject: subject, peerNearbyData: peerNearbyData, greetingData: context.prefetchManager?.preloadedGreetingSticker, pendingUnpinnedAllMessages: false, activeGroupCallInfo: nil, hasActiveGroupCall: false, importState: nil, threadData: nil, isGeneralThreadClosed: nil, replyMessage: nil, accountPeerColor: nil)
self.presentationInterfaceStatePromise = ValuePromise(self.presentationInterfaceState)
var mediaAccessoryPanelVisibility = MediaAccessoryPanelVisibility.none
@@ -5068,8 +5068,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|> deliverOnMainQueue).startStrict(next: { [weak self] peerView in
if let strongSelf = self {
let isPremium = peerView.peers[peerView.peerId]?.isPremium ?? false
strongSelf.updateChatPresentationInterfaceState(animated: false, interactive: false, {
return $0.updatedIsPremium(isPremium)
var accountPeerColor: ChatPresentationInterfaceState.AccountPeerColor?
if peerView.peers[peerView.peerId]?.nameColor?.dashColors.1 != nil {
accountPeerColor = ChatPresentationInterfaceState.AccountPeerColor(isDashed: true)
}
strongSelf.updateChatPresentationInterfaceState(animated: false, interactive: false, { state in
return state.updatedIsPremium(isPremium).updatedAccountPeerColor(accountPeerColor)
})
}
})