mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Group stories
This commit is contained in:
parent
85ef0b00b9
commit
1bbfc8da52
@ -821,11 +821,13 @@ public struct StoryCameraTransitionInCoordinator {
|
||||
|
||||
public class MediaEditorTransitionOutExternalState {
|
||||
public var storyTarget: Stories.PendingTarget?
|
||||
public var isForcedTarget: Bool
|
||||
public var isPeerArchived: Bool
|
||||
public var transitionOut: ((Stories.PendingTarget?, Bool) -> StoryCameraTransitionOut?)?
|
||||
|
||||
public init(storyTarget: Stories.PendingTarget?, isPeerArchived: Bool, transitionOut: ((Stories.PendingTarget?, Bool) -> StoryCameraTransitionOut?)?) {
|
||||
public init(storyTarget: Stories.PendingTarget?, isForcedTarget: Bool, isPeerArchived: Bool, transitionOut: ((Stories.PendingTarget?, Bool) -> StoryCameraTransitionOut?)?) {
|
||||
self.storyTarget = storyTarget
|
||||
self.isForcedTarget = isForcedTarget
|
||||
self.isPeerArchived = isPeerArchived
|
||||
self.transitionOut = transitionOut
|
||||
}
|
||||
|
@ -5383,6 +5383,7 @@ public final class StoryItemSetContainerComponent: Component {
|
||||
|
||||
let externalState = MediaEditorTransitionOutExternalState(
|
||||
storyTarget: nil,
|
||||
isForcedTarget: false,
|
||||
isPeerArchived: false,
|
||||
transitionOut: nil
|
||||
)
|
||||
|
@ -966,14 +966,16 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
guard let peer = strongSelf.presentationInterfaceState.renderedPeer?.peer else {
|
||||
return true
|
||||
}
|
||||
if let peer = peer as? TelegramChannel, peer.hasPermission(.changeInfo) {
|
||||
let _ = (context.engine.peers.getChannelBoostStatus(peerId: peer.id)
|
||||
|> deliverOnMainQueue).start(next: { [weak self] boostStatus in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
self.push(ChannelAppearanceScreen(context: self.context, updatedPresentationData: self.updatedPresentationData, peerId: peer.id, boostStatus: boostStatus))
|
||||
})
|
||||
if let peer = peer as? TelegramChannel {
|
||||
if peer.flags.contains(.isCreator) || peer.adminRights?.rights.contains(.canChangeInfo) == true {
|
||||
let _ = (context.engine.peers.getChannelBoostStatus(peerId: peer.id)
|
||||
|> deliverOnMainQueue).start(next: { [weak self] boostStatus in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
self.push(ChannelAppearanceScreen(context: self.context, updatedPresentationData: self.updatedPresentationData, peerId: peer.id, boostStatus: boostStatus))
|
||||
})
|
||||
}
|
||||
return true
|
||||
}
|
||||
guard message.effectivelyIncoming(strongSelf.context.account.peerId), let peer = strongSelf.presentationInterfaceState.renderedPeer?.peer else {
|
||||
@ -16706,6 +16708,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
|
||||
let externalState = MediaEditorTransitionOutExternalState(
|
||||
storyTarget: nil,
|
||||
isForcedTarget: false,
|
||||
isPeerArchived: false,
|
||||
transitionOut: nil
|
||||
)
|
||||
|
@ -277,6 +277,7 @@ public final class TelegramRootController: NavigationController, TelegramRootCon
|
||||
|
||||
let externalState = MediaEditorTransitionOutExternalState(
|
||||
storyTarget: nil,
|
||||
isForcedTarget: customTarget != nil,
|
||||
isPeerArchived: false,
|
||||
transitionOut: nil
|
||||
)
|
||||
@ -522,13 +523,17 @@ public final class TelegramRootController: NavigationController, TelegramRootCon
|
||||
var viewControllers = self.viewControllers
|
||||
|
||||
let archiveController = ChatListControllerImpl(context: context, location: .chatList(groupId: .archive), controlsHistoryPreload: false, hideNetworkActivityStatus: false, previewing: false, enableDebugActions: false)
|
||||
externalState.transitionOut = archiveController.storyCameraTransitionOut()
|
||||
if !externalState.isForcedTarget {
|
||||
externalState.transitionOut = archiveController.storyCameraTransitionOut()
|
||||
}
|
||||
chatListController = archiveController
|
||||
viewControllers.insert(archiveController, at: 1)
|
||||
self.setViewControllers(viewControllers, animated: false)
|
||||
} else {
|
||||
chatListController = self.chatListController as? ChatListControllerImpl
|
||||
externalState.transitionOut = chatListController?.storyCameraTransitionOut()
|
||||
if !externalState.isForcedTarget {
|
||||
externalState.transitionOut = chatListController?.storyCameraTransitionOut()
|
||||
}
|
||||
}
|
||||
|
||||
if let chatListController {
|
||||
|
Loading…
x
Reference in New Issue
Block a user