mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Tag improvements
This commit is contained in:
parent
53ba8afced
commit
e579de45cd
@ -489,7 +489,9 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
|||||||
let credibilityIcon: CredibilityIcon
|
let credibilityIcon: CredibilityIcon
|
||||||
var verifiedIcon: CredibilityIcon = .none
|
var verifiedIcon: CredibilityIcon = .none
|
||||||
if let peer = peer {
|
if let peer = peer {
|
||||||
if peer.isFake {
|
if peer.id == self.context.account.peerId && !self.isSettings {
|
||||||
|
credibilityIcon = .none
|
||||||
|
} else if peer.isFake {
|
||||||
credibilityIcon = .fake
|
credibilityIcon = .fake
|
||||||
} else if peer.isScam {
|
} else if peer.isScam {
|
||||||
credibilityIcon = .scam
|
credibilityIcon = .scam
|
||||||
@ -969,7 +971,11 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
|||||||
if let peer = peer {
|
if let peer = peer {
|
||||||
var title: String
|
var title: String
|
||||||
if peer.id == self.context.account.peerId && !self.isSettings {
|
if peer.id == self.context.account.peerId && !self.isSettings {
|
||||||
|
if case .replyThread = self.chatLocation {
|
||||||
|
title = presentationData.strings.Conversation_MyNotes
|
||||||
|
} else {
|
||||||
title = presentationData.strings.Conversation_SavedMessages
|
title = presentationData.strings.Conversation_SavedMessages
|
||||||
|
}
|
||||||
} else if peer.id.isAnonymousSavedMessages {
|
} else if peer.id.isAnonymousSavedMessages {
|
||||||
title = presentationData.strings.ChatList_AuthorHidden
|
title = presentationData.strings.ChatList_AuthorHidden
|
||||||
} else if let threadData = threadData {
|
} else if let threadData = threadData {
|
||||||
|
@ -1266,6 +1266,10 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !force && message.areReactionsTags(accountPeerId: strongSelf.context.account.peerId) {
|
if !force && message.areReactionsTags(accountPeerId: strongSelf.context.account.peerId) {
|
||||||
|
if case .pinnedMessages = strongSelf.subject {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if !strongSelf.presentationInterfaceState.isPremium {
|
if !strongSelf.presentationInterfaceState.isPremium {
|
||||||
//TODO:localize
|
//TODO:localize
|
||||||
let context = strongSelf.context
|
let context = strongSelf.context
|
||||||
@ -2807,8 +2811,10 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
return .none
|
return .none
|
||||||
}
|
}
|
||||||
if case let .replyThread(replyThreadMessage) = strongSelf.chatLocation, replyThreadMessage.peerId == strongSelf.context.account.peerId {
|
if case let .replyThread(replyThreadMessage) = strongSelf.chatLocation, replyThreadMessage.peerId == strongSelf.context.account.peerId {
|
||||||
|
if replyThreadMessage.threadId != strongSelf.context.account.peerId.toInt64() {
|
||||||
return .none
|
return .none
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if case .peer = strongSelf.chatLocation, let channel = strongSelf.presentationInterfaceState.renderedPeer?.peer as? TelegramChannel, channel.flags.contains(.isForum) {
|
if case .peer = strongSelf.chatLocation, let channel = strongSelf.presentationInterfaceState.renderedPeer?.peer as? TelegramChannel, channel.flags.contains(.isForum) {
|
||||||
if message.threadId == nil {
|
if message.threadId == nil {
|
||||||
return .none
|
return .none
|
||||||
|
@ -118,6 +118,8 @@ extension ChatControllerImpl {
|
|||||||
})
|
})
|
||||||
})))
|
})))
|
||||||
|
|
||||||
|
if case .pinnedMessages = self.subject {
|
||||||
|
} else {
|
||||||
if self.presentationInterfaceState.historyFilter?.customTags != tags {
|
if self.presentationInterfaceState.historyFilter?.customTags != tags {
|
||||||
items.append(.action(ContextMenuActionItem(text: self.presentationData.strings.Chat_ReactionContextMenu_FilterByTag, icon: { theme in
|
items.append(.action(ContextMenuActionItem(text: self.presentationData.strings.Chat_ReactionContextMenu_FilterByTag, icon: { theme in
|
||||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/TagFilter"), color: theme.contextMenu.primaryColor)
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/TagFilter"), color: theme.contextMenu.primaryColor)
|
||||||
@ -134,6 +136,7 @@ extension ChatControllerImpl {
|
|||||||
a(.default)
|
a(.default)
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
items.append(.action(ContextMenuActionItem(text: self.presentationData.strings.Chat_ReactionContextMenu_RemoveTag, textColor: .destructive, icon: { theme in
|
items.append(.action(ContextMenuActionItem(text: self.presentationData.strings.Chat_ReactionContextMenu_RemoveTag, textColor: .destructive, icon: { theme in
|
||||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/TagRemove"), color: theme.contextMenu.destructiveColor)
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/TagRemove"), color: theme.contextMenu.destructiveColor)
|
||||||
|
@ -287,8 +287,10 @@ func canReplyInChat(_ chatPresentationInterfaceState: ChatPresentationInterfaceS
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
if case let .replyThread(replyThreadMessage) = chatPresentationInterfaceState.chatLocation, replyThreadMessage.peerId == accountPeerId {
|
if case let .replyThread(replyThreadMessage) = chatPresentationInterfaceState.chatLocation, replyThreadMessage.peerId == accountPeerId {
|
||||||
|
if replyThreadMessage.threadId != accountPeerId.toInt64() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if let channel = peer as? TelegramChannel, channel.flags.contains(.isForum) {
|
if let channel = peer as? TelegramChannel, channel.flags.contains(.isForum) {
|
||||||
if let threadData = chatPresentationInterfaceState.threadData {
|
if let threadData = chatPresentationInterfaceState.threadData {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user