mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
bc6b9b1b61
commit
acae4de3fb
@ -13601,3 +13601,7 @@ Sorry for the inconvenience.";
|
||||
|
||||
"Gift.View.Self.Title" = "Saved Gift";
|
||||
"Gift.View.Self.Description" = "You can display this gift on your page or turn it into a unique collectible and send to others.";
|
||||
|
||||
"BotVerification.ChooseChat" = "Choose Chat to Verify";
|
||||
"BotVerification.Added" = "**%@** has been notified and will receive your verification mark and description upon accepting.";
|
||||
"BotVerification.Removed" = "You have removed **%@'s** verification.";
|
||||
|
@ -28,7 +28,6 @@ public struct ChatListNodePeersFilter: OptionSet {
|
||||
public static let removeSearchHeader = ChatListNodePeersFilter(rawValue: 1 << 9)
|
||||
|
||||
public static let excludeDisabled = ChatListNodePeersFilter(rawValue: 1 << 10)
|
||||
public static let includeSavedMessages = ChatListNodePeersFilter(rawValue: 1 << 11)
|
||||
|
||||
public static let excludeChannels = ChatListNodePeersFilter(rawValue: 1 << 12)
|
||||
public static let onlyGroupsAndChannels = ChatListNodePeersFilter(rawValue: 1 << 13)
|
||||
@ -36,6 +35,8 @@ public struct ChatListNodePeersFilter: OptionSet {
|
||||
public static let excludeGroups = ChatListNodePeersFilter(rawValue: 1 << 14)
|
||||
public static let excludeUsers = ChatListNodePeersFilter(rawValue: 1 << 15)
|
||||
public static let excludeBots = ChatListNodePeersFilter(rawValue: 1 << 16)
|
||||
|
||||
public static let includeSelf = ChatListNodePeersFilter(rawValue: 1 << 7)
|
||||
}
|
||||
|
||||
|
||||
|
@ -439,7 +439,7 @@ public enum ChatListSearchEntry: Comparable, Identifiable {
|
||||
|
||||
case topic(EnginePeer, ChatListItemContent.ThreadInfo, Int, PresentationTheme, PresentationStrings, ChatListSearchSectionExpandType)
|
||||
case recentlySearchedPeer(EnginePeer, EnginePeer?, (Int32, Bool)?, Int, PresentationTheme, PresentationStrings, PresentationPersonNameOrder, PresentationPersonNameOrder, PeerStoryStats?, Bool)
|
||||
case localPeer(EnginePeer, EnginePeer?, (Int32, Bool)?, Int, PresentationTheme, PresentationStrings, PresentationPersonNameOrder, PresentationPersonNameOrder, ChatListSearchSectionExpandType, PeerStoryStats?, Bool)
|
||||
case localPeer(EnginePeer, EnginePeer?, (Int32, Bool)?, Int, PresentationTheme, PresentationStrings, PresentationPersonNameOrder, PresentationPersonNameOrder, ChatListSearchSectionExpandType, PeerStoryStats?, Bool, Bool)
|
||||
case globalPeer(FoundPeer, (Int32, Bool)?, Int, PresentationTheme, PresentationStrings, PresentationPersonNameOrder, PresentationPersonNameOrder, ChatListSearchSectionExpandType, PeerStoryStats?, Bool, String?)
|
||||
case message(EngineMessage, EngineRenderedPeer, EnginePeerReadCounters?, EngineMessageHistoryThread.Info?, ChatListPresentationData, Int32, Bool?, Bool, MessageOrderingKey, (id: String, size: Int64, isFirstInList: Bool)?, MessageSection, Bool, PeerStoryStats?, Bool, TelegramSearchPeersScope)
|
||||
case messagePlaceholder(Int32, ChatListPresentationData, TelegramSearchPeersScope)
|
||||
@ -452,7 +452,7 @@ public enum ChatListSearchEntry: Comparable, Identifiable {
|
||||
return .threadId(threadInfo.id)
|
||||
case let .recentlySearchedPeer(peer, _, _, _, _, _, _, _, _, _):
|
||||
return .localPeerId(peer.id)
|
||||
case let .localPeer(peer, _, _, _, _, _, _, _, _, _, _):
|
||||
case let .localPeer(peer, _, _, _, _, _, _, _, _, _, _, _):
|
||||
return .localPeerId(peer.id)
|
||||
case let .globalPeer(peer, _, _, _, _, _, _, _, _, _, _):
|
||||
return .globalPeerId(peer.peer.id)
|
||||
@ -481,8 +481,8 @@ public enum ChatListSearchEntry: Comparable, Identifiable {
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case let .localPeer(lhsPeer, lhsAssociatedPeer, lhsUnreadBadge, lhsIndex, lhsTheme, lhsStrings, lhsSortOrder, lhsDisplayOrder, lhsExpandType, lhsStoryStats, lhsRequiresPremiumForMessaging):
|
||||
if case let .localPeer(rhsPeer, rhsAssociatedPeer, rhsUnreadBadge, rhsIndex, rhsTheme, rhsStrings, rhsSortOrder, rhsDisplayOrder, rhsExpandType, rhsStoryStats, rhsRequiresPremiumForMessaging) = rhs, lhsPeer == rhsPeer && lhsAssociatedPeer == rhsAssociatedPeer && lhsIndex == rhsIndex && lhsTheme === rhsTheme && lhsStrings === rhsStrings && lhsSortOrder == rhsSortOrder && lhsDisplayOrder == rhsDisplayOrder && lhsUnreadBadge?.0 == rhsUnreadBadge?.0 && lhsUnreadBadge?.1 == rhsUnreadBadge?.1 && lhsExpandType == rhsExpandType && lhsStoryStats == rhsStoryStats && lhsRequiresPremiumForMessaging == rhsRequiresPremiumForMessaging {
|
||||
case let .localPeer(lhsPeer, lhsAssociatedPeer, lhsUnreadBadge, lhsIndex, lhsTheme, lhsStrings, lhsSortOrder, lhsDisplayOrder, lhsExpandType, lhsStoryStats, lhsRequiresPremiumForMessaging, lhsIsSelf):
|
||||
if case let .localPeer(rhsPeer, rhsAssociatedPeer, rhsUnreadBadge, rhsIndex, rhsTheme, rhsStrings, rhsSortOrder, rhsDisplayOrder, rhsExpandType, rhsStoryStats, rhsRequiresPremiumForMessaging, rhsIsSelf) = rhs, lhsPeer == rhsPeer && lhsAssociatedPeer == rhsAssociatedPeer && lhsIndex == rhsIndex && lhsTheme === rhsTheme && lhsStrings === rhsStrings && lhsSortOrder == rhsSortOrder && lhsDisplayOrder == rhsDisplayOrder && lhsUnreadBadge?.0 == rhsUnreadBadge?.0 && lhsUnreadBadge?.1 == rhsUnreadBadge?.1 && lhsExpandType == rhsExpandType && lhsStoryStats == rhsStoryStats && lhsRequiresPremiumForMessaging == rhsRequiresPremiumForMessaging && lhsIsSelf == rhsIsSelf {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
@ -614,11 +614,11 @@ public enum ChatListSearchEntry: Comparable, Identifiable {
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
case let .localPeer(_, _, _, lhsIndex, _, _, _, _, _, _, _):
|
||||
case let .localPeer(_, _, _, lhsIndex, _, _, _, _, _, _, _, _):
|
||||
switch rhs {
|
||||
case .topic, .recentlySearchedPeer:
|
||||
return false
|
||||
case let .localPeer(_, _, _, rhsIndex, _, _, _, _, _, _, _):
|
||||
case let .localPeer(_, _, _, rhsIndex, _, _, _, _, _, _, _, _):
|
||||
return lhsIndex <= rhsIndex
|
||||
case .globalPeer, .message, .messagePlaceholder, .emptyMessagesFooter, .addContact:
|
||||
return true
|
||||
@ -808,7 +808,7 @@ public enum ChatListSearchEntry: Comparable, Identifiable {
|
||||
openStories(peer.id, sourceNode.avatarNode)
|
||||
}
|
||||
})
|
||||
case let .localPeer(peer, associatedPeer, unreadBadge, _, theme, strings, nameSortOrder, nameDisplayOrder, expandType, storyStats, requiresPremiumForMessaging):
|
||||
case let .localPeer(peer, associatedPeer, unreadBadge, _, theme, strings, nameSortOrder, nameDisplayOrder, expandType, storyStats, requiresPremiumForMessaging, isSelf):
|
||||
let primaryPeer: EnginePeer
|
||||
var chatPeer: EnginePeer?
|
||||
if let associatedPeer = associatedPeer {
|
||||
@ -916,7 +916,7 @@ public enum ChatListSearchEntry: Comparable, Identifiable {
|
||||
)
|
||||
}
|
||||
|
||||
return ContactsPeerItem(presentationData: ItemListPresentationData(presentationData), sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, context: context, peerMode: .generalSearch(isSavedMessages: isSavedMessages), peer: .peer(peer: primaryPeer, chatPeer: chatPeer), status: status, badge: badge, requiresPremiumForMessaging: requiresPremiumForMessaging, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), buttonAction: buttonAction, index: nil, header: header, action: { contactPeer in
|
||||
return ContactsPeerItem(presentationData: ItemListPresentationData(presentationData), sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, context: context, peerMode: .generalSearch(isSavedMessages: isSavedMessages), aliasHandling: isSelf ? .standard : .treatSelfAsSaved, peer: .peer(peer: primaryPeer, chatPeer: chatPeer), status: status, badge: badge, requiresPremiumForMessaging: requiresPremiumForMessaging, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), buttonAction: buttonAction, index: nil, header: header, action: { contactPeer in
|
||||
if case let .peer(maybePeer, maybeChatPeer) = contactPeer, let peer = maybePeer, let chatPeer = maybeChatPeer {
|
||||
interaction.peerSelected(chatPeer, peer, nil, nil, false)
|
||||
} else {
|
||||
@ -2783,7 +2783,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
||||
}
|
||||
return false
|
||||
} else {
|
||||
guard !peersFilter.contains(.excludeSavedMessages) || peer.id != accountPeer.id else { return false }
|
||||
guard !peersFilter.contains(.excludeSavedMessages) || peersFilter.contains(.includeSelf) || peer.id != accountPeer.id else { return false }
|
||||
guard !peersFilter.contains(.excludeSecretChats) || peer.id.namespace != Namespaces.Peer.SecretChat else { return false }
|
||||
guard !peersFilter.contains(.onlyPrivateChats) || peer.id.namespace == Namespaces.Peer.CloudUser else { return false }
|
||||
|
||||
@ -2821,7 +2821,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
||||
|
||||
var totalNumberOfLocalPeers = 0
|
||||
for renderedPeer in foundLocalPeers.peers {
|
||||
if let peer = renderedPeer.peers[renderedPeer.peerId], peer.id != context.account.peerId, filteredPeer(peer, EnginePeer(accountPeer)) {
|
||||
if let peer = renderedPeer.peers[renderedPeer.peerId], peer.id != context.account.peerId || peersFilter.contains(.includeSelf), filteredPeer(peer, EnginePeer(accountPeer)) {
|
||||
if !existingPeerIds.contains(peer.id) {
|
||||
existingPeerIds.insert(peer.id)
|
||||
totalNumberOfLocalPeers += 1
|
||||
@ -2856,11 +2856,22 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
||||
if lowercasedQuery.count > 1 && (presentationData.strings.DialogList_SavedMessages.lowercased().hasPrefix(lowercasedQuery) || "saved messages".hasPrefix(lowercasedQuery)) {
|
||||
if !existingPeerIds.contains(accountPeer.id), filteredPeer(EnginePeer(accountPeer), EnginePeer(accountPeer)) {
|
||||
existingPeerIds.insert(accountPeer.id)
|
||||
entries.append(.localPeer(EnginePeer(accountPeer), nil, nil, index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, localExpandType, nil, false))
|
||||
entries.append(.localPeer(EnginePeer(accountPeer), nil, nil, index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, localExpandType, nil, false, false))
|
||||
index += 1
|
||||
}
|
||||
}
|
||||
|
||||
if peersFilter.contains(.includeSelf) {
|
||||
for renderedPeer in foundLocalPeers.peers {
|
||||
if renderedPeer.peerId == context.account.peerId, let peer = renderedPeer.peers[renderedPeer.peerId], filteredPeer(peer, EnginePeer(accountPeer)) {
|
||||
if !existingPeerIds.contains(peer.id) {
|
||||
entries.append(.localPeer(peer, nil, nil, index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, localExpandType, nil, false, true))
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for renderedPeer in foundLocalPeers.peers {
|
||||
if !foundLocalPeers.recentlySearchedPeerIds.contains(renderedPeer.peerId) {
|
||||
continue
|
||||
@ -2899,7 +2910,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
||||
|
||||
if matches {
|
||||
existingPeerIds.insert(peer.id)
|
||||
entries.append(.localPeer(peer, nil, nil, index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, localExpandType, nil, false))
|
||||
entries.append(.localPeer(peer, nil, nil, index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, localExpandType, nil, false, false))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2922,7 +2933,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
||||
associatedPeer = renderedPeer.peers[associatedPeerId]
|
||||
}
|
||||
|
||||
entries.append(.localPeer(peer, associatedPeer, foundLocalPeers.unread[peer.id], index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, localExpandType, nil, false))
|
||||
entries.append(.localPeer(peer, associatedPeer, foundLocalPeers.unread[peer.id], index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, localExpandType, nil, false, false))
|
||||
index += 1
|
||||
numberOfLocalPeers += 1
|
||||
}
|
||||
@ -2936,7 +2947,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
||||
|
||||
if !existingPeerIds.contains(peer.peer.id), filteredPeer(EnginePeer(peer.peer), EnginePeer(accountPeer)) {
|
||||
existingPeerIds.insert(peer.peer.id)
|
||||
entries.append(.localPeer(EnginePeer(peer.peer), nil, nil, index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, localExpandType, nil, false))
|
||||
entries.append(.localPeer(EnginePeer(peer.peer), nil, nil, index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, localExpandType, nil, false, false))
|
||||
index += 1
|
||||
numberOfLocalPeers += 1
|
||||
}
|
||||
@ -3362,7 +3373,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
||||
if case let .user(user) = peer, user.flags.contains(.requirePremium) {
|
||||
requiresPremiumForMessagingPeerIds.append(peer.id)
|
||||
}
|
||||
case let .localPeer(peer, _, _, _, _, _, _, _, _, _, _):
|
||||
case let .localPeer(peer, _, _, _, _, _, _, _, _, _, _, _):
|
||||
storyStatsIds.append(peer.id)
|
||||
if case let .user(user) = peer, user.flags.contains(.requirePremium) {
|
||||
requiresPremiumForMessagingPeerIds.append(peer.id)
|
||||
@ -3406,8 +3417,8 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
||||
switch mappedItems[i] {
|
||||
case let .recentlySearchedPeer(peer, associatedPeer, unreadBadge, index, theme, strings, sortOrder, displayOrder, _, _):
|
||||
mappedItems[i] = .recentlySearchedPeer(peer, associatedPeer, unreadBadge, index, theme, strings, sortOrder, displayOrder, stats[peer.id] ?? nil, requiresPremiumForMessaging[peer.id] ?? false)
|
||||
case let .localPeer(peer, associatedPeer, unreadBadge, index, theme, strings, sortOrder, displayOrder, expandType, _, _):
|
||||
mappedItems[i] = .localPeer(peer, associatedPeer, unreadBadge, index, theme, strings, sortOrder, displayOrder, expandType, stats[peer.id] ?? nil, requiresPremiumForMessaging[peer.id] ?? false)
|
||||
case let .localPeer(peer, associatedPeer, unreadBadge, index, theme, strings, sortOrder, displayOrder, expandType, _, _, isSelf):
|
||||
mappedItems[i] = .localPeer(peer, associatedPeer, unreadBadge, index, theme, strings, sortOrder, displayOrder, expandType, stats[peer.id] ?? nil, requiresPremiumForMessaging[peer.id] ?? false, isSelf)
|
||||
case let .globalPeer(peer, unreadBadge, index, theme, strings, sortOrder, displayOrder, expandType, _, _, searchQuery):
|
||||
mappedItems[i] = .globalPeer(peer, unreadBadge, index, theme, strings, sortOrder, displayOrder, expandType, stats[peer.peer.id] ?? nil, requiresPremiumForMessaging[peer.peer.id] ?? false, searchQuery)
|
||||
case let .message(message, peer, combinedPeerReadState, threadInfo, presentationData, totalCount, selected, displayCustomHeader, key, resourceId, section, allPaused, _, _, searchScope):
|
||||
@ -3441,7 +3452,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
||||
if let entries = entriesAndFlags {
|
||||
var filteredEntries: [ChatListSearchEntry] = []
|
||||
for entry in entries {
|
||||
if case let .localPeer(peer, _, _, _, _, _, _, _, _, _, _) = entry {
|
||||
if case let .localPeer(peer, _, _, _, _, _, _, _, _, _, _, _) = entry {
|
||||
peers.append(peer)
|
||||
} else if case .globalPeer = entry {
|
||||
} else {
|
||||
|
@ -3105,7 +3105,8 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode {
|
||||
|
||||
if peer.isVerified {
|
||||
currentCredibilityIconContent = .verified(fillColor: item.presentationData.theme.list.itemCheckColors.fillColor, foregroundColor: item.presentationData.theme.list.itemCheckColors.foregroundColor, sizeType: .compact)
|
||||
} else if let verificationIconFileId = peer.verificationIconFileId {
|
||||
}
|
||||
if let verificationIconFileId = peer.verificationIconFileId {
|
||||
currentVerifiedIconContent = .animation(content: .customEmoji(fileId: verificationIconFileId), size: CGSize(width: 32.0, height: 32.0), placeholderColor: item.presentationData.theme.list.mediaPlaceholderColor, themeColor: item.presentationData.theme.list.itemAccentColor, loopMode: .count(0))
|
||||
}
|
||||
}
|
||||
@ -3132,7 +3133,8 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode {
|
||||
|
||||
if peer.isVerified {
|
||||
currentCredibilityIconContent = .verified(fillColor: item.presentationData.theme.list.itemCheckColors.fillColor, foregroundColor: item.presentationData.theme.list.itemCheckColors.foregroundColor, sizeType: .compact)
|
||||
} else if let verificationIconFileId = peer.verificationIconFileId {
|
||||
}
|
||||
if let verificationIconFileId = peer.verificationIconFileId {
|
||||
currentVerifiedIconContent = .animation(content: .customEmoji(fileId: verificationIconFileId), size: CGSize(width: 32.0, height: 32.0), placeholderColor: item.presentationData.theme.list.mediaPlaceholderColor, themeColor: item.presentationData.theme.list.itemAccentColor, loopMode: .count(0))
|
||||
}
|
||||
}
|
||||
|
@ -73,6 +73,11 @@ public enum ContactsPeerItemPeerMode: Equatable {
|
||||
case app(isPopular: Bool)
|
||||
}
|
||||
|
||||
public enum ContactsPeerItemAliasHandling {
|
||||
case standard
|
||||
case treatSelfAsSaved
|
||||
}
|
||||
|
||||
public enum ContactsPeerItemBadgeType {
|
||||
case active
|
||||
case inactive
|
||||
@ -176,6 +181,7 @@ public class ContactsPeerItem: ItemListItem, ListViewItemWithHeader {
|
||||
let displayOrder: PresentationPersonNameOrder
|
||||
let context: AccountContext
|
||||
let peerMode: ContactsPeerItemPeerMode
|
||||
let aliasHandling: ContactsPeerItemAliasHandling
|
||||
public let peer: ContactsPeerItemPeer
|
||||
let status: ContactsPeerItemStatus
|
||||
let badge: ContactsPeerItemBadge?
|
||||
@ -217,6 +223,7 @@ public class ContactsPeerItem: ItemListItem, ListViewItemWithHeader {
|
||||
displayOrder: PresentationPersonNameOrder,
|
||||
context: AccountContext,
|
||||
peerMode: ContactsPeerItemPeerMode,
|
||||
aliasHandling: ContactsPeerItemAliasHandling = .treatSelfAsSaved,
|
||||
peer: ContactsPeerItemPeer,
|
||||
status: ContactsPeerItemStatus,
|
||||
badge: ContactsPeerItemBadge? = nil,
|
||||
@ -252,6 +259,7 @@ public class ContactsPeerItem: ItemListItem, ListViewItemWithHeader {
|
||||
self.displayOrder = displayOrder
|
||||
self.context = context
|
||||
self.peerMode = peerMode
|
||||
self.aliasHandling = aliasHandling
|
||||
self.peer = peer
|
||||
self.status = status
|
||||
self.badge = badge
|
||||
@ -786,7 +794,7 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode {
|
||||
var verifiedIcon: EmojiStatusComponent.Content?
|
||||
switch item.peer {
|
||||
case let .peer(peer, _):
|
||||
if let peer = peer, (peer.id != item.context.account.peerId || item.peerMode == .memberList) {
|
||||
if let peer = peer, (peer.id != item.context.account.peerId || item.peerMode == .memberList || item.aliasHandling == .treatSelfAsSaved) {
|
||||
if peer.isScam {
|
||||
credibilityIcon = .text(color: item.presentationData.theme.chat.message.incoming.scamColor, string: item.presentationData.strings.Message_ScamAccount.uppercased())
|
||||
} else if peer.isFake {
|
||||
@ -798,8 +806,9 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode {
|
||||
}
|
||||
|
||||
if peer.isVerified {
|
||||
verifiedIcon = .verified(fillColor: item.presentationData.theme.list.itemCheckColors.fillColor, foregroundColor: item.presentationData.theme.list.itemCheckColors.foregroundColor, sizeType: .compact)
|
||||
} else if let verificationIconFileId = peer.verificationIconFileId {
|
||||
credibilityIcon = .verified(fillColor: item.presentationData.theme.list.itemCheckColors.fillColor, foregroundColor: item.presentationData.theme.list.itemCheckColors.foregroundColor, sizeType: .compact)
|
||||
}
|
||||
if let verificationIconFileId = peer.verificationIconFileId {
|
||||
verifiedIcon = .animation(content: .customEmoji(fileId: verificationIconFileId), size: CGSize(width: 32.0, height: 32.0), placeholderColor: item.presentationData.theme.list.mediaPlaceholderColor, themeColor: item.presentationData.theme.list.itemAccentColor, loopMode: .count(0))
|
||||
}
|
||||
}
|
||||
@ -865,7 +874,7 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode {
|
||||
textColor = item.presentationData.theme.list.itemPrimaryTextColor
|
||||
}
|
||||
if case let .user(user) = peer {
|
||||
if peer.id == item.context.account.peerId, case let .generalSearch(isSavedMessages) = item.peerMode {
|
||||
if peer.id == item.context.account.peerId, case let .generalSearch(isSavedMessages) = item.peerMode, case .treatSelfAsSaved = item.aliasHandling {
|
||||
if isSavedMessages {
|
||||
titleAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_MyNotes, font: titleBoldFont, textColor: textColor)
|
||||
} else {
|
||||
@ -1171,7 +1180,7 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode {
|
||||
case let .peer(peer, _):
|
||||
if let peer = peer {
|
||||
var overrideImage: AvatarNodeImageOverride?
|
||||
if peer.id == item.context.account.peerId, case let .generalSearch(isSavedMessages) = item.peerMode {
|
||||
if peer.id == item.context.account.peerId, case let .generalSearch(isSavedMessages) = item.peerMode, case .treatSelfAsSaved = item.aliasHandling {
|
||||
if isSavedMessages {
|
||||
overrideImage = .myNotesIcon
|
||||
} else {
|
||||
@ -1433,6 +1442,7 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode {
|
||||
|
||||
if case .animation = verifiedIcon {
|
||||
titleLeftOffset += iconSize.width + 4.0
|
||||
nextIconX += iconSize.width
|
||||
} else {
|
||||
nextIconX += iconSize.width
|
||||
}
|
||||
|
@ -937,8 +937,9 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo
|
||||
}
|
||||
|
||||
if item.peer.isVerified {
|
||||
verifiedIcon = .verified(fillColor: item.presentationData.theme.list.itemCheckColors.fillColor, foregroundColor: item.presentationData.theme.list.itemCheckColors.foregroundColor, sizeType: .compact)
|
||||
} else if let verificationIconFileId = item.peer.verificationIconFileId {
|
||||
credibilityIcon = .verified(fillColor: item.presentationData.theme.list.itemCheckColors.fillColor, foregroundColor: item.presentationData.theme.list.itemCheckColors.foregroundColor, sizeType: .compact)
|
||||
}
|
||||
if let verificationIconFileId = item.peer.verificationIconFileId {
|
||||
verifiedIcon = .animation(content: .customEmoji(fileId: verificationIconFileId), size: CGSize(width: 32.0, height: 32.0), placeholderColor: item.presentationData.theme.list.mediaPlaceholderColor, themeColor: item.presentationData.theme.list.itemAccentColor, loopMode: .count(0))
|
||||
}
|
||||
}
|
||||
|
@ -1115,6 +1115,7 @@ private final class GiftViewSheetContent: CombinedComponent {
|
||||
text: .plain(value),
|
||||
horizontalAlignment: .center,
|
||||
maximumNumberOfLines: 0,
|
||||
insets: id == "originalInfo" ? UIEdgeInsets(top: 2.0, left: 0.0, bottom: 2.0, right: 0.0) : .zero,
|
||||
handleSpoilers: true
|
||||
)
|
||||
)
|
||||
@ -1306,6 +1307,7 @@ private final class GiftViewSheetContent: CombinedComponent {
|
||||
placeholderColor: theme.list.mediaPlaceholderColor,
|
||||
text: .plain(attributedText),
|
||||
maximumNumberOfLines: 0,
|
||||
insets: UIEdgeInsets(top: 1.0, left: 0.0, bottom: 1.0, right: 0.0),
|
||||
handleSpoilers: true
|
||||
)
|
||||
)
|
||||
|
@ -521,7 +521,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
||||
self.presentationData = presentationData
|
||||
|
||||
let premiumConfiguration = PremiumConfiguration.with(appConfiguration: self.context.currentAppConfiguration.with { $0 })
|
||||
let credibilityIcon: CredibilityIcon
|
||||
var credibilityIcon: CredibilityIcon
|
||||
var verifiedIcon: CredibilityIcon = .none
|
||||
if let peer = peer {
|
||||
if peer.id == self.context.account.peerId && !self.isSettings && !self.isMyProfile {
|
||||
@ -538,8 +538,9 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
||||
credibilityIcon = .none
|
||||
}
|
||||
if peer.isVerified {
|
||||
verifiedIcon = .verified
|
||||
} else if let verificationIconFileId = peer.verificationIconFileId {
|
||||
credibilityIcon = .verified
|
||||
}
|
||||
if let verificationIconFileId = peer.verificationIconFileId {
|
||||
verifiedIcon = .emojiStatus(PeerEmojiStatus(fileId: verificationIconFileId, expirationDate: nil))
|
||||
}
|
||||
} else {
|
||||
|
@ -8818,9 +8818,9 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
||||
let controller = self.context.sharedContext.makePeerSelectionController(
|
||||
PeerSelectionControllerParams(
|
||||
context: self.context,
|
||||
filter: [.excludeSecretChats, .excludeRecent, .excludeSavedMessages],
|
||||
filter: [.excludeSecretChats, .excludeRecent, .excludeSavedMessages, .includeSelf, .doNotSearchMessages],
|
||||
hasContactSelector: false,
|
||||
title: "Choose Chat to Verify"
|
||||
title: self.presentationData.strings.BotVerification_ChooseChat
|
||||
)
|
||||
)
|
||||
controller.peerSelected = { [weak self, weak controller] peer, _ in
|
||||
@ -8849,7 +8849,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
||||
}
|
||||
let undoController = UndoOverlayController(
|
||||
presentationData: self.presentationData,
|
||||
content: .invitedToVoiceChat(context: self.context, peer: peer, title: nil, text: "You have removed **\(peer.compactDisplayTitle)'s** verification.", action: nil, duration: 5.0),
|
||||
content: .invitedToVoiceChat(context: self.context, peer: peer, title: nil, text: self.presentationData.strings.BotVerification_Removed(peer.compactDisplayTitle).string, action: nil, duration: 5.0),
|
||||
elevatedLayout: false,
|
||||
action: { _ in return true }
|
||||
)
|
||||
@ -8878,7 +8878,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
||||
}
|
||||
let undoController = UndoOverlayController(
|
||||
presentationData: self.presentationData,
|
||||
content: .invitedToVoiceChat(context: self.context, peer: peer, title: nil, text: "**\(peer.compactDisplayTitle)** has been notified and will receive your verification mark and description upon accepting.", action: nil, duration: 5.0),
|
||||
content: .invitedToVoiceChat(context: self.context, peer: peer, title: nil, text: self.presentationData.strings.BotVerification_Added(peer.compactDisplayTitle).string, action: nil, duration: 5.0),
|
||||
elevatedLayout: false,
|
||||
action: { _ in return true }
|
||||
)
|
||||
|
File diff suppressed because one or more lines are too long
@ -554,7 +554,7 @@ func moveReplyMessageToAnotherChat(selfController: ChatControllerImpl, replySubj
|
||||
guard let selfController else {
|
||||
return
|
||||
}
|
||||
let filter: ChatListNodePeersFilter = [.onlyWriteable, .includeSavedMessages, .excludeDisabled, .doNotSearchMessages]
|
||||
let filter: ChatListNodePeersFilter = [.onlyWriteable, .excludeDisabled, .doNotSearchMessages]
|
||||
var attemptSelectionImpl: ((EnginePeer, ChatListDisabledPeerReason) -> Void)?
|
||||
let controller = selfController.context.sharedContext.makePeerSelectionController(PeerSelectionControllerParams(
|
||||
context: selfController.context,
|
||||
|
@ -29,7 +29,7 @@ extension ChatControllerImpl {
|
||||
|
||||
func forwardMessages(messages: [Message], options: ChatInterfaceForwardOptionsState? = nil, resetCurrent: Bool) {
|
||||
let _ = self.presentVoiceMessageDiscardAlert(action: {
|
||||
var filter: ChatListNodePeersFilter = [.onlyWriteable, .includeSavedMessages, .excludeDisabled, .doNotSearchMessages]
|
||||
var filter: ChatListNodePeersFilter = [.onlyWriteable, .excludeDisabled, .doNotSearchMessages]
|
||||
var hasPublicPolls = false
|
||||
var hasPublicQuiz = false
|
||||
for message in messages {
|
||||
|
Loading…
x
Reference in New Issue
Block a user