mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Refactoring
This commit is contained in:
@@ -130,7 +130,7 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
|
||||
if !peerView.peerIsContact, let user = peer as? TelegramUser, !user.flags.contains(.isSupport), user.botInfo == nil, let phone = user.phone, !phone.isEmpty {
|
||||
segments = [.text(0, NSAttributedString(string: formatPhoneNumber(phone), font: titleFont, textColor: titleTheme.rootController.navigationBar.primaryTextColor))]
|
||||
} else {
|
||||
segments = [.text(0, NSAttributedString(string: peer.displayTitle(strings: self.strings, displayOrder: self.nameDisplayOrder), font: titleFont, textColor: titleTheme.rootController.navigationBar.primaryTextColor))]
|
||||
segments = [.text(0, NSAttributedString(string: EnginePeer(peer).displayTitle(strings: self.strings, displayOrder: self.nameDisplayOrder), font: titleFont, textColor: titleTheme.rootController.navigationBar.primaryTextColor))]
|
||||
}
|
||||
}
|
||||
if peer.isFake {
|
||||
@@ -350,7 +350,7 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
|
||||
}
|
||||
} else {
|
||||
for (peer, _) in inputActivities {
|
||||
let title = peer.compactDisplayTitle
|
||||
let title = EnginePeer(peer).compactDisplayTitle
|
||||
if !title.isEmpty {
|
||||
if first {
|
||||
first = false
|
||||
@@ -411,11 +411,11 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
|
||||
let userPresence: TelegramUserPresence
|
||||
if let presence = peerView.peerPresences[peer.id] as? TelegramUserPresence {
|
||||
userPresence = presence
|
||||
self.presenceManager?.reset(presence: presence)
|
||||
self.presenceManager?.reset(presence: EnginePeer.Presence(presence))
|
||||
} else {
|
||||
userPresence = TelegramUserPresence(status: .none, lastActivity: 0)
|
||||
}
|
||||
let (string, activity) = stringAndActivityForUserPresence(strings: self.strings, dateTimeFormat: self.dateTimeFormat, presence: userPresence, relativeTo: Int32(timestamp))
|
||||
let (string, activity) = stringAndActivityForUserPresence(strings: self.strings, dateTimeFormat: self.dateTimeFormat, presence: EnginePeer.Presence(userPresence), relativeTo: Int32(timestamp))
|
||||
let attributedString = NSAttributedString(string: string, font: subtitleFont, textColor: activity ? titleTheme.rootController.navigationBar.accentTextColor : titleTheme.rootController.navigationBar.secondaryTextColor)
|
||||
state = .info(attributedString, activity ? .online : .lastSeenTime)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user