mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
ChatListItem: fix legacy group title
This commit is contained in:
parent
0541f464a8
commit
9808bcde25
@ -7,8 +7,8 @@
|
|||||||
ldflags = -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -dead_strip -Xlinker -no_deduplicate $(config custom.other_cxxflags)
|
ldflags = -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -dead_strip -Xlinker -no_deduplicate $(config custom.other_cxxflags)
|
||||||
|
|
||||||
[swift]
|
[swift]
|
||||||
version = 4.0
|
version = 5
|
||||||
compiler_flags = -DBUCK -enable-testing -Onone -whole-module-optimization -suppress-warnings -Xcc -fno-optimize-sibling-calls $(config custom.other_swift_compiler_flags)
|
compiler_flags = -DBUCK -enable-testing -O -whole-module-optimization -suppress-warnings -Xcc -fno-optimize-sibling-calls $(config custom.other_swift_compiler_flags)
|
||||||
use_filelist = true
|
use_filelist = true
|
||||||
|
|
||||||
[apple]
|
[apple]
|
||||||
|
20
submodules/TelegramApi/BUCK
Normal file
20
submodules/TelegramApi/BUCK
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
load('//tools:buck_utils.bzl', 'config_with_updated_linker_flags', 'configs_with_config', 'combined_config')
|
||||||
|
load('//tools:buck_defs.bzl', 'SHARED_CONFIGS', 'EXTENSION_LIB_SPECIFIC_CONFIG')
|
||||||
|
|
||||||
|
apple_library(
|
||||||
|
name = 'TelegramApi',
|
||||||
|
srcs = glob([
|
||||||
|
'Sources/*.swift',
|
||||||
|
]),
|
||||||
|
configs = configs_with_config(combined_config([SHARED_CONFIGS, EXTENSION_LIB_SPECIFIC_CONFIG])),
|
||||||
|
swift_compiler_flags = [
|
||||||
|
'-suppress-warnings',
|
||||||
|
'-application-extension',
|
||||||
|
],
|
||||||
|
visibility = ['PUBLIC'],
|
||||||
|
deps = [
|
||||||
|
],
|
||||||
|
frameworks = [
|
||||||
|
'$SDKROOT/System/Library/Frameworks/Foundation.framework',
|
||||||
|
],
|
||||||
|
)
|
@ -732,7 +732,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
var contentImageMedia: Media?
|
var contentImageMedia: Media?
|
||||||
|
|
||||||
switch contentData {
|
switch contentData {
|
||||||
case let .chat(itemPeer, peer, _, messageText):
|
case let .chat(itemPeer, _, _, messageText):
|
||||||
let messageText = messageText.replacingOccurrences(of: "\n\n", with: " ")
|
let messageText = messageText.replacingOccurrences(of: "\n\n", with: " ")
|
||||||
|
|
||||||
if inlineAuthorPrefix == nil, let embeddedState = embeddedState as? ChatEmbeddedInterfaceState {
|
if inlineAuthorPrefix == nil, let embeddedState = embeddedState as? ChatEmbeddedInterfaceState {
|
||||||
@ -755,7 +755,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
if let messagePeer = itemPeer.chatMainPeer {
|
if let messagePeer = itemPeer.chatMainPeer {
|
||||||
peerText = messagePeer.displayTitle(strings: item.presentationData.strings, displayOrder: item.presentationData.nameDisplayOrder)
|
peerText = messagePeer.displayTitle(strings: item.presentationData.strings, displayOrder: item.presentationData.nameDisplayOrder)
|
||||||
}
|
}
|
||||||
} else if let author = message.author as? TelegramUser, let peer = peer, !(peer is TelegramUser) {
|
} else if let author = message.author as? TelegramUser, let peer = itemPeer.chatMainPeer, !(peer is TelegramUser) {
|
||||||
if let peer = peer as? TelegramChannel, case .broadcast = peer.info {
|
if let peer = peer as? TelegramChannel, case .broadcast = peer.info {
|
||||||
} else {
|
} else {
|
||||||
peerText = author.id == account.peerId ? item.presentationData.strings.DialogList_You : author.displayTitle(strings: item.presentationData.strings, displayOrder: item.presentationData.nameDisplayOrder)
|
peerText = author.id == account.peerId ? item.presentationData.strings.DialogList_You : author.displayTitle(strings: item.presentationData.strings, displayOrder: item.presentationData.nameDisplayOrder)
|
||||||
@ -827,12 +827,12 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch contentData {
|
switch contentData {
|
||||||
case let .chat(_, peer, _, _):
|
case let .chat(itemPeer, _, _, _):
|
||||||
if isPeerGroup {
|
if isPeerGroup {
|
||||||
titleAttributedString = NSAttributedString(string: item.presentationData.strings.ChatList_ArchivedChatsTitle, font: titleFont, textColor: theme.titleColor)
|
titleAttributedString = NSAttributedString(string: item.presentationData.strings.ChatList_ArchivedChatsTitle, font: titleFont, textColor: theme.titleColor)
|
||||||
} else if peer?.id == item.context.account.peerId {
|
} else if itemPeer.chatMainPeer?.id == item.context.account.peerId {
|
||||||
titleAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_SavedMessages, font: titleFont, textColor: theme.titleColor)
|
titleAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_SavedMessages, font: titleFont, textColor: theme.titleColor)
|
||||||
} else if let displayTitle = peer?.displayTitle(strings: item.presentationData.strings, displayOrder: item.presentationData.nameDisplayOrder) {
|
} else if let displayTitle = itemPeer.chatMainPeer?.displayTitle(strings: item.presentationData.strings, displayOrder: item.presentationData.nameDisplayOrder) {
|
||||||
titleAttributedString = NSAttributedString(string: displayTitle, font: titleFont, textColor: item.index.messageIndex.id.peerId.namespace == Namespaces.Peer.SecretChat ? theme.secretTitleColor : theme.titleColor)
|
titleAttributedString = NSAttributedString(string: displayTitle, font: titleFont, textColor: item.index.messageIndex.id.peerId.namespace == Namespaces.Peer.SecretChat ? theme.secretTitleColor : theme.titleColor)
|
||||||
}
|
}
|
||||||
case .group:
|
case .group:
|
||||||
@ -940,7 +940,6 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
}
|
}
|
||||||
titleIconsWidth += currentMutedIconImage.size.width
|
titleIconsWidth += currentMutedIconImage.size.width
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let isSecret = !isPeerGroup && item.index.messageIndex.id.peerId.namespace == Namespaces.Peer.SecretChat
|
let isSecret = !isPeerGroup && item.index.messageIndex.id.peerId.namespace == Namespaces.Peer.SecretChat
|
||||||
if isSecret {
|
if isSecret {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user