mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Saved messages view as chats
This commit is contained in:
@@ -122,6 +122,7 @@ import WallpaperGalleryScreen
|
||||
import WallpaperGridScreen
|
||||
import VideoMessageCameraScreen
|
||||
import TopMessageReactions
|
||||
import PeerInfoScreen
|
||||
|
||||
public enum ChatControllerPeekActions {
|
||||
case standard
|
||||
@@ -267,6 +268,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
var chatTitleView: ChatTitleView?
|
||||
var leftNavigationButton: ChatNavigationButton?
|
||||
var rightNavigationButton: ChatNavigationButton?
|
||||
var secondaryRightNavigationButton: ChatNavigationButton?
|
||||
var chatInfoNavigationButton: ChatNavigationButton?
|
||||
|
||||
var moreBarButton: MoreHeaderButton
|
||||
@@ -4725,13 +4727,18 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
self.moreBarButton.setContent(.more(MoreHeaderButton.optionsCircleImage(color: self.presentationData.theme.rootController.navigationBar.buttonColor)))
|
||||
self.moreInfoNavigationButton = ChatNavigationButton(action: .toggleInfoPanel, buttonItem: UIBarButtonItem(customDisplayNode: self.moreBarButton)!)
|
||||
self.moreBarButton.contextAction = { [weak self] sourceNode, gesture in
|
||||
guard let self = self else {
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
guard case let .peer(peerId) = self.chatLocation else {
|
||||
return
|
||||
}
|
||||
ChatListControllerImpl.openMoreMenu(context: self.context, peerId: peerId, sourceController: self, isViewingAsTopics: false, sourceView: sourceNode.view, gesture: gesture)
|
||||
|
||||
if peerId == self.context.account.peerId {
|
||||
PeerInfoScreenImpl.openSavedMessagesMoreMenu(context: self.context, sourceController: self, isViewingAsTopics: false, sourceView: sourceNode.view, gesture: gesture)
|
||||
} else {
|
||||
ChatListControllerImpl.openMoreMenu(context: self.context, peerId: peerId, sourceController: self, isViewingAsTopics: false, sourceView: sourceNode.view, gesture: gesture)
|
||||
}
|
||||
}
|
||||
self.moreBarButton.addTarget(self, action: #selector(self.moreButtonPressed), forControlEvents: .touchUpInside)
|
||||
|
||||
@@ -12087,6 +12094,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
}
|
||||
}
|
||||
|
||||
@objc func secondaryRightNavigationButtonAction() {
|
||||
if let button = self.secondaryRightNavigationButton {
|
||||
self.navigationButtonAction(button.action)
|
||||
}
|
||||
}
|
||||
|
||||
@objc func moreButtonPressed() {
|
||||
self.moreBarButton.play()
|
||||
self.moreBarButton.contextAction?(self.moreBarButton.containerNode, nil)
|
||||
|
||||
Reference in New Issue
Block a user