diff --git a/Telegram-iOS.xcworkspace/contents.xcworkspacedata b/Telegram-iOS.xcworkspace/contents.xcworkspacedata
index 52c215445a..08888c0f5b 100644
--- a/Telegram-iOS.xcworkspace/contents.xcworkspacedata
+++ b/Telegram-iOS.xcworkspace/contents.xcworkspacedata
@@ -4,12 +4,24 @@
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+ location = "group:submodules/LiveLocationManager/LiveLocationManager_Xcode.xcodeproj">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -105,13 +128,18 @@
+
+
+
+
+
+
-
-
-
-
diff --git a/submodules/AccountContext/AccountContext_Xcode.xcodeproj/project.pbxproj b/submodules/AccountContext/AccountContext_Xcode.xcodeproj/project.pbxproj
index 9d03df44be..8de3624517 100644
--- a/submodules/AccountContext/AccountContext_Xcode.xcodeproj/project.pbxproj
+++ b/submodules/AccountContext/AccountContext_Xcode.xcodeproj/project.pbxproj
@@ -8,6 +8,30 @@
/* Begin PBXBuildFile section */
D06018E722F36A3F00796784 /* TelegramPresentationData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D06018E622F36A3F00796784 /* TelegramPresentationData.framework */; };
+ D0879A4622F651D400C4D6B3 /* LiveLocationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879A4522F651D400C4D6B3 /* LiveLocationManager.swift */; };
+ D0879A4A22F6584B00C4D6B3 /* SharedMediaPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879A4922F6584B00C4D6B3 /* SharedMediaPlayer.swift */; };
+ D0879A4C22F65A7A00C4D6B3 /* UniversalMediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A4B22F65A7A00C4D6B3 /* UniversalMediaPlayer.framework */; };
+ D0879A4E22F65B2A00C4D6B3 /* MediaManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879A4D22F65B2A00C4D6B3 /* MediaManager.swift */; };
+ D0879A5022F65D4D00C4D6B3 /* ChatHistroyLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879A4F22F65D4D00C4D6B3 /* ChatHistroyLocation.swift */; };
+ D0879AA222F6FEC800C4D6B3 /* OverlayAudioPlayerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879AA122F6FEC800C4D6B3 /* OverlayAudioPlayerController.swift */; };
+ D0879B1922F70C7400C4D6B3 /* OpenChatMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B1822F70C7400C4D6B3 /* OpenChatMessage.swift */; };
+ D0879B1B22F70CF400C4D6B3 /* ChatController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B1A22F70CF400C4D6B3 /* ChatController.swift */; };
+ D0879B1D22F7112E00C4D6B3 /* GalleryController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B1C22F7112E00C4D6B3 /* GalleryController.swift */; };
+ D0879B2922F77C8300C4D6B3 /* FetchManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B2822F77C8300C4D6B3 /* FetchManager.swift */; };
+ D0879B2B22F795CC00C4D6B3 /* DeviceLocationManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879B2A22F795CC00C4D6B3 /* DeviceLocationManager.framework */; };
+ D0879B5322F7974800C4D6B3 /* TemporaryCachedPeerDataManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879B5222F7974800C4D6B3 /* TemporaryCachedPeerDataManager.framework */; };
+ D0879B5D22F7A2BE00C4D6B3 /* AsyncDisplayKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879B5C22F7A2BE00C4D6B3 /* AsyncDisplayKit.framework */; };
+ D0879B5F22F7A37100C4D6B3 /* TelegramAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879B5E22F7A37100C4D6B3 /* TelegramAudio.framework */; };
+ D0879B6122F7A7A600C4D6B3 /* UniversalVideoNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B6022F7A7A600C4D6B3 /* UniversalVideoNode.swift */; };
+ D0879B6322F7A97F00C4D6B3 /* OverlayMediaItemNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B6222F7A97F00C4D6B3 /* OverlayMediaItemNode.swift */; };
+ D0879B6522F7AC8700C4D6B3 /* OverlayMediaManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B6422F7AC8700C4D6B3 /* OverlayMediaManager.swift */; };
+ D0879B6722F7AE6400C4D6B3 /* PresentationCallManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B6622F7AE6400C4D6B3 /* PresentationCallManager.swift */; };
+ D0879B6922F7AF2A00C4D6B3 /* DeviceContactDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B6822F7AF2A00C4D6B3 /* DeviceContactDataManager.swift */; };
+ D0879B6B22F7B04400C4D6B3 /* DeviceContactData.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B6A22F7B04400C4D6B3 /* DeviceContactData.swift */; };
+ D0879B6D22F7B05300C4D6B3 /* Contacts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879B6C22F7B05200C4D6B3 /* Contacts.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ D0879B6F22F83F6600C4D6B3 /* DownloadedMediaStoreManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B6E22F83F6600C4D6B3 /* DownloadedMediaStoreManager.swift */; };
+ D0879B7122F8425B00C4D6B3 /* WallpaperUploadManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B7022F8425B00C4D6B3 /* WallpaperUploadManager.swift */; };
+ D0879B7322F842FF00C4D6B3 /* WatchManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B7222F842FF00C4D6B3 /* WatchManager.swift */; };
D0D3285422F329A900D07EE2 /* AccountContext.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D3285222F329A900D07EE2 /* AccountContext.h */; settings = {ATTRIBUTES = (Public, ); }; };
D0D3285F22F335B000D07EE2 /* AccountContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0D3285E22F335B000D07EE2 /* AccountContext.swift */; };
D0D3289D22F3461700D07EE2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0D3289C22F3461700D07EE2 /* Foundation.framework */; };
@@ -19,6 +43,30 @@
/* Begin PBXFileReference section */
D06018E422F36A3900796784 /* DeviceAccess.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = DeviceAccess.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D06018E622F36A3F00796784 /* TelegramPresentationData.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramPresentationData.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A4522F651D400C4D6B3 /* LiveLocationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveLocationManager.swift; sourceTree = ""; };
+ D0879A4922F6584B00C4D6B3 /* SharedMediaPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharedMediaPlayer.swift; sourceTree = ""; };
+ D0879A4B22F65A7A00C4D6B3 /* UniversalMediaPlayer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = UniversalMediaPlayer.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A4D22F65B2A00C4D6B3 /* MediaManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaManager.swift; sourceTree = ""; };
+ D0879A4F22F65D4D00C4D6B3 /* ChatHistroyLocation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatHistroyLocation.swift; sourceTree = ""; };
+ D0879AA122F6FEC800C4D6B3 /* OverlayAudioPlayerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OverlayAudioPlayerController.swift; sourceTree = ""; };
+ D0879B1822F70C7400C4D6B3 /* OpenChatMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenChatMessage.swift; sourceTree = ""; };
+ D0879B1A22F70CF400C4D6B3 /* ChatController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatController.swift; sourceTree = ""; };
+ D0879B1C22F7112E00C4D6B3 /* GalleryController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GalleryController.swift; sourceTree = ""; };
+ D0879B2822F77C8300C4D6B3 /* FetchManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchManager.swift; sourceTree = ""; };
+ D0879B2A22F795CC00C4D6B3 /* DeviceLocationManager.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = DeviceLocationManager.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879B5222F7974800C4D6B3 /* TemporaryCachedPeerDataManager.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TemporaryCachedPeerDataManager.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879B5C22F7A2BE00C4D6B3 /* AsyncDisplayKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = AsyncDisplayKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879B5E22F7A37100C4D6B3 /* TelegramAudio.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramAudio.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879B6022F7A7A600C4D6B3 /* UniversalVideoNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UniversalVideoNode.swift; sourceTree = ""; };
+ D0879B6222F7A97F00C4D6B3 /* OverlayMediaItemNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OverlayMediaItemNode.swift; sourceTree = ""; };
+ D0879B6422F7AC8700C4D6B3 /* OverlayMediaManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OverlayMediaManager.swift; sourceTree = ""; };
+ D0879B6622F7AE6400C4D6B3 /* PresentationCallManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PresentationCallManager.swift; sourceTree = ""; };
+ D0879B6822F7AF2A00C4D6B3 /* DeviceContactDataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceContactDataManager.swift; sourceTree = ""; };
+ D0879B6A22F7B04400C4D6B3 /* DeviceContactData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceContactData.swift; sourceTree = ""; };
+ D0879B6C22F7B05200C4D6B3 /* Contacts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Contacts.framework; path = System/Library/Frameworks/Contacts.framework; sourceTree = SDKROOT; };
+ D0879B6E22F83F6600C4D6B3 /* DownloadedMediaStoreManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadedMediaStoreManager.swift; sourceTree = ""; };
+ D0879B7022F8425B00C4D6B3 /* WallpaperUploadManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WallpaperUploadManager.swift; sourceTree = ""; };
+ D0879B7222F842FF00C4D6B3 /* WatchManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchManager.swift; sourceTree = ""; };
D0D3284F22F329A900D07EE2 /* AccountContext.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AccountContext.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D0D3285222F329A900D07EE2 /* AccountContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccountContext.h; sourceTree = ""; };
D0D3285322F329A900D07EE2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
@@ -34,6 +82,12 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ D0879B6D22F7B05300C4D6B3 /* Contacts.framework in Frameworks */,
+ D0879B5F22F7A37100C4D6B3 /* TelegramAudio.framework in Frameworks */,
+ D0879B5D22F7A2BE00C4D6B3 /* AsyncDisplayKit.framework in Frameworks */,
+ D0879B5322F7974800C4D6B3 /* TemporaryCachedPeerDataManager.framework in Frameworks */,
+ D0879B2B22F795CC00C4D6B3 /* DeviceLocationManager.framework in Frameworks */,
+ D0879A4C22F65A7A00C4D6B3 /* UniversalMediaPlayer.framework in Frameworks */,
D06018E722F36A3F00796784 /* TelegramPresentationData.framework in Frameworks */,
D0D328A322F3462800D07EE2 /* SwiftSignalKit.framework in Frameworks */,
D0D328A122F3462400D07EE2 /* Postbox.framework in Frameworks */,
@@ -68,6 +122,24 @@
children = (
D0D3285222F329A900D07EE2 /* AccountContext.h */,
D0D3285E22F335B000D07EE2 /* AccountContext.swift */,
+ D0879A4522F651D400C4D6B3 /* LiveLocationManager.swift */,
+ D0879A4922F6584B00C4D6B3 /* SharedMediaPlayer.swift */,
+ D0879A4D22F65B2A00C4D6B3 /* MediaManager.swift */,
+ D0879B6422F7AC8700C4D6B3 /* OverlayMediaManager.swift */,
+ D0879B6022F7A7A600C4D6B3 /* UniversalVideoNode.swift */,
+ D0879B6222F7A97F00C4D6B3 /* OverlayMediaItemNode.swift */,
+ D0879A4F22F65D4D00C4D6B3 /* ChatHistroyLocation.swift */,
+ D0879AA122F6FEC800C4D6B3 /* OverlayAudioPlayerController.swift */,
+ D0879B1822F70C7400C4D6B3 /* OpenChatMessage.swift */,
+ D0879B1A22F70CF400C4D6B3 /* ChatController.swift */,
+ D0879B1C22F7112E00C4D6B3 /* GalleryController.swift */,
+ D0879B2822F77C8300C4D6B3 /* FetchManager.swift */,
+ D0879B6622F7AE6400C4D6B3 /* PresentationCallManager.swift */,
+ D0879B6822F7AF2A00C4D6B3 /* DeviceContactDataManager.swift */,
+ D0879B6A22F7B04400C4D6B3 /* DeviceContactData.swift */,
+ D0879B6E22F83F6600C4D6B3 /* DownloadedMediaStoreManager.swift */,
+ D0879B7022F8425B00C4D6B3 /* WallpaperUploadManager.swift */,
+ D0879B7222F842FF00C4D6B3 /* WatchManager.swift */,
);
path = Sources;
sourceTree = "";
@@ -75,6 +147,12 @@
D0D3289B22F3461700D07EE2 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ D0879B6C22F7B05200C4D6B3 /* Contacts.framework */,
+ D0879B5E22F7A37100C4D6B3 /* TelegramAudio.framework */,
+ D0879B5C22F7A2BE00C4D6B3 /* AsyncDisplayKit.framework */,
+ D0879B5222F7974800C4D6B3 /* TemporaryCachedPeerDataManager.framework */,
+ D0879B2A22F795CC00C4D6B3 /* DeviceLocationManager.framework */,
+ D0879A4B22F65A7A00C4D6B3 /* UniversalMediaPlayer.framework */,
D06018E622F36A3F00796784 /* TelegramPresentationData.framework */,
D06018E422F36A3900796784 /* DeviceAccess.framework */,
D0D328A222F3462800D07EE2 /* SwiftSignalKit.framework */,
@@ -165,6 +243,24 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ D0879B6122F7A7A600C4D6B3 /* UniversalVideoNode.swift in Sources */,
+ D0879A4E22F65B2A00C4D6B3 /* MediaManager.swift in Sources */,
+ D0879A4A22F6584B00C4D6B3 /* SharedMediaPlayer.swift in Sources */,
+ D0879B7122F8425B00C4D6B3 /* WallpaperUploadManager.swift in Sources */,
+ D0879B6722F7AE6400C4D6B3 /* PresentationCallManager.swift in Sources */,
+ D0879B2922F77C8300C4D6B3 /* FetchManager.swift in Sources */,
+ D0879B6522F7AC8700C4D6B3 /* OverlayMediaManager.swift in Sources */,
+ D0879B7322F842FF00C4D6B3 /* WatchManager.swift in Sources */,
+ D0879B6F22F83F6600C4D6B3 /* DownloadedMediaStoreManager.swift in Sources */,
+ D0879B6922F7AF2A00C4D6B3 /* DeviceContactDataManager.swift in Sources */,
+ D0879B6322F7A97F00C4D6B3 /* OverlayMediaItemNode.swift in Sources */,
+ D0879B6B22F7B04400C4D6B3 /* DeviceContactData.swift in Sources */,
+ D0879B1922F70C7400C4D6B3 /* OpenChatMessage.swift in Sources */,
+ D0879B1D22F7112E00C4D6B3 /* GalleryController.swift in Sources */,
+ D0879B1B22F70CF400C4D6B3 /* ChatController.swift in Sources */,
+ D0879A5022F65D4D00C4D6B3 /* ChatHistroyLocation.swift in Sources */,
+ D0879A4622F651D400C4D6B3 /* LiveLocationManager.swift in Sources */,
+ D0879AA222F6FEC800C4D6B3 /* OverlayAudioPlayerController.swift in Sources */,
D0D3285F22F335B000D07EE2 /* AccountContext.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
diff --git a/submodules/AccountContext/Sources/AccountContext.swift b/submodules/AccountContext/Sources/AccountContext.swift
index 23d33f4f83..6f286e6a2e 100644
--- a/submodules/AccountContext/Sources/AccountContext.swift
+++ b/submodules/AccountContext/Sources/AccountContext.swift
@@ -5,6 +5,8 @@ import TelegramPresentationData
import TelegramUIPreferences
import SwiftSignalKit
import Display
+import DeviceLocationManager
+import TemporaryCachedPeerDataManager
public final class TelegramApplicationOpenUrlCompletion {
public let completion: (Bool) -> Void
@@ -85,26 +87,83 @@ public enum TextLinkItem {
case hashtag(String?, String)
}
+public final class AccountWithInfo: Equatable {
+ public let account: Account
+ public let peer: Peer
+
+ public init(account: Account, peer: Peer) {
+ self.account = account
+ self.peer = peer
+ }
+
+ public static func ==(lhs: AccountWithInfo, rhs: AccountWithInfo) -> Bool {
+ if lhs.account !== rhs.account {
+ return false
+ }
+ if !arePeersEqual(lhs.peer, rhs.peer) {
+ return false
+ }
+ return true
+ }
+}
+
public protocol SharedAccountContext: class {
+ var basePath: String { get }
+ var mainWindow: Window1? { get }
var accountManager: AccountManager { get }
+
var currentPresentationData: Atomic { get }
var presentationData: Signal { get }
+
+ var currentAutomaticMediaDownloadSettings: Atomic { get }
+ var automaticMediaDownloadSettings: Signal { get }
+ var immediateExperimentalUISettings: ExperimentalUISettings { get }
+ var currentInAppNotificationSettings: Atomic { get }
+ var currentMediaInputSettings: Atomic { get }
+
var applicationBindings: TelegramApplicationBindings { get }
+ var mediaManager: MediaManager { get }
+ var locationManager: DeviceLocationManager? { get }
+ var callManager: PresentationCallManager? { get }
+ var contactDataManager: DeviceContactDataManager? { get }
+
+ var activeAccounts: Signal<(primary: Account?, accounts: [(AccountRecordId, Account, Int32)], currentAuth: UnauthorizedAccount?), NoError> { get }
+ var activeAccountsWithInfo: Signal<(primary: AccountRecordId?, accounts: [AccountWithInfo]), NoError> { get }
+
+ var presentGlobalController: (ViewController, Any?) -> Void { get }
+
+ func makeTempAccountContext(account: Account) -> AccountContext
+
+ func updateNotificationTokensRegistration()
+ func setAccountUserInterfaceInUse(_ id: AccountRecordId) -> Disposable
func handleTextLinkAction(context: AccountContext, peerId: PeerId?, navigateDisposable: MetaDisposable, controller: ViewController, action: TextLinkItemActionType, itemLink: TextLinkItem)
+ func navigateToChat(accountId: AccountRecordId, peerId: PeerId, messageId: MessageId?)
+ func openChatMessage(_ params: OpenChatMessageParams) -> Bool
+ func messageFromPreloadedChatHistoryViewForLocation(id: MessageId, location: ChatHistoryLocationInput, account: Account, chatLocation: ChatLocation, tagMask: MessageTags?) -> Signal<(MessageIndex?, Bool), NoError>
+ func makeOverlayAudioPlayerController(context: AccountContext, peerId: PeerId, type: MediaManagerPlayerType, initialMessageId: MessageId, initialOrder: MusicPlaybackSettingsOrder, parentNavigationController: NavigationController?) -> ViewController & OverlayAudioPlayerController
+
+ func navigateToCurrentCall()
+ var hasOngoingCall: ValuePromise { get }
+ var immediateHasOngoingCall: Bool { get }
+
+ func switchToAccount(id: AccountRecordId, fromSettingsController settingsController: ViewController?, withChatListController chatListController: ViewController?)
+ func beginNewAuth(testingEnvironment: Bool)
}
public protocol AccountContext: class {
- var genericSharedContext: SharedAccountContext { get }
+ var sharedContext: SharedAccountContext { get }
var account: Account { get }
-}
-
-public final class TempAccountContext: AccountContext {
- public let genericSharedContext: SharedAccountContext
- public let account: Account
- init(genericSharedContext: SharedAccountContext, account: Account) {
- self.genericSharedContext = genericSharedContext
- self.account = account
- }
+ var liveLocationManager: LiveLocationManager? { get }
+ var fetchManager: FetchManager { get }
+ var downloadedMediaStoreManager: DownloadedMediaStoreManager { get }
+ var peerChannelMemberCategoriesContextsManager: PeerChannelMemberCategoriesContextsManager { get }
+ var wallpaperUploadManager: WallpaperUploadManager? { get }
+ var watchManager: WatchManager? { get }
+
+ var currentLimitsConfiguration: Atomic { get }
+
+ func storeSecureIdPassword(password: String)
+ func getStoredSecureIdPassword() -> String?
}
diff --git a/submodules/AccountContext/Sources/ChatController.swift b/submodules/AccountContext/Sources/ChatController.swift
new file mode 100644
index 0000000000..b9d594709e
--- /dev/null
+++ b/submodules/AccountContext/Sources/ChatController.swift
@@ -0,0 +1,234 @@
+import Foundation
+import Postbox
+import TextFormat
+
+public enum ChatControllerInitialBotStartBehavior {
+ case interactive
+ case automatic(returnToPeerId: PeerId)
+}
+
+public struct ChatControllerInitialBotStart {
+ public let payload: String
+ public let behavior: ChatControllerInitialBotStartBehavior
+
+ public init(payload: String, behavior: ChatControllerInitialBotStartBehavior) {
+ self.payload = payload
+ self.behavior = behavior
+ }
+}
+
+public enum ChatControllerInteractionNavigateToPeer {
+ case `default`
+ case chat(textInputState: ChatTextInputState?, messageId: MessageId?)
+ case info
+ case withBotStartPayload(ChatControllerInitialBotStart)
+}
+
+public struct ChatTextInputState: PostboxCoding, Equatable {
+ public let inputText: NSAttributedString
+ public let selectionRange: Range
+
+ public static func ==(lhs: ChatTextInputState, rhs: ChatTextInputState) -> Bool {
+ return lhs.inputText.isEqual(to: rhs.inputText) && lhs.selectionRange == rhs.selectionRange
+ }
+
+ public init() {
+ self.inputText = NSAttributedString()
+ self.selectionRange = 0 ..< 0
+ }
+
+ public init(inputText: NSAttributedString, selectionRange: Range) {
+ self.inputText = inputText
+ self.selectionRange = selectionRange
+ }
+
+ public init(inputText: NSAttributedString) {
+ self.inputText = inputText
+ let length = inputText.length
+ self.selectionRange = length ..< length
+ }
+
+ public init(decoder: PostboxDecoder) {
+ self.inputText = ((decoder.decodeObjectForKey("at", decoder: { ChatTextInputStateText(decoder: $0) }) as? ChatTextInputStateText) ?? ChatTextInputStateText()).attributedText()
+ self.selectionRange = Int(decoder.decodeInt32ForKey("as0", orElse: 0)) ..< Int(decoder.decodeInt32ForKey("as1", orElse: 0))
+ }
+
+ public func encode(_ encoder: PostboxEncoder) {
+ encoder.encodeObject(ChatTextInputStateText(attributedText: self.inputText), forKey: "at")
+
+ encoder.encodeInt32(Int32(self.selectionRange.lowerBound), forKey: "as0")
+ encoder.encodeInt32(Int32(self.selectionRange.upperBound), forKey: "as1")
+ }
+}
+
+public enum ChatTextInputStateTextAttributeType: PostboxCoding, Equatable {
+ case bold
+ case italic
+ case monospace
+ case textMention(PeerId)
+ case textUrl(String)
+
+ public init(decoder: PostboxDecoder) {
+ switch decoder.decodeInt32ForKey("t", orElse: 0) {
+ case 0:
+ self = .bold
+ case 1:
+ self = .italic
+ case 2:
+ self = .monospace
+ case 3:
+ self = .textMention(PeerId(decoder.decodeInt64ForKey("peerId", orElse: 0)))
+ case 4:
+ self = .textUrl(decoder.decodeStringForKey("url", orElse: ""))
+ default:
+ assertionFailure()
+ self = .bold
+ }
+ }
+
+ public func encode(_ encoder: PostboxEncoder) {
+ switch self {
+ case .bold:
+ encoder.encodeInt32(0, forKey: "t")
+ case .italic:
+ encoder.encodeInt32(1, forKey: "t")
+ case .monospace:
+ encoder.encodeInt32(2, forKey: "t")
+ case let .textMention(id):
+ encoder.encodeInt32(3, forKey: "t")
+ encoder.encodeInt64(id.toInt64(), forKey: "peerId")
+ case let .textUrl(url):
+ encoder.encodeInt32(4, forKey: "t")
+ encoder.encodeString(url, forKey: "url")
+ }
+ }
+
+ public static func ==(lhs: ChatTextInputStateTextAttributeType, rhs: ChatTextInputStateTextAttributeType) -> Bool {
+ switch lhs {
+ case .bold:
+ if case .bold = rhs {
+ return true
+ } else {
+ return false
+ }
+ case .italic:
+ if case .italic = rhs {
+ return true
+ } else {
+ return false
+ }
+ case .monospace:
+ if case .monospace = rhs {
+ return true
+ } else {
+ return false
+ }
+ case let .textMention(id):
+ if case .textMention(id) = rhs {
+ return true
+ } else {
+ return false
+ }
+ case let .textUrl(url):
+ if case .textUrl(url) = rhs {
+ return true
+ } else {
+ return false
+ }
+ }
+ }
+}
+
+public struct ChatTextInputStateTextAttribute: PostboxCoding, Equatable {
+ public let type: ChatTextInputStateTextAttributeType
+ public let range: Range
+
+ public init(type: ChatTextInputStateTextAttributeType, range: Range) {
+ self.type = type
+ self.range = range
+ }
+
+ public init(decoder: PostboxDecoder) {
+ self.type = decoder.decodeObjectForKey("type", decoder: { ChatTextInputStateTextAttributeType(decoder: $0) }) as! ChatTextInputStateTextAttributeType
+ self.range = Int(decoder.decodeInt32ForKey("range0", orElse: 0)) ..< Int(decoder.decodeInt32ForKey("range1", orElse: 0))
+ }
+
+ public func encode(_ encoder: PostboxEncoder) {
+ encoder.encodeObject(self.type, forKey: "type")
+ encoder.encodeInt32(Int32(self.range.lowerBound), forKey: "range0")
+ encoder.encodeInt32(Int32(self.range.upperBound), forKey: "range1")
+ }
+
+ public static func ==(lhs: ChatTextInputStateTextAttribute, rhs: ChatTextInputStateTextAttribute) -> Bool {
+ return lhs.type == rhs.type && lhs.range == rhs.range
+ }
+}
+
+public struct ChatTextInputStateText: PostboxCoding, Equatable {
+ public let text: String
+ public let attributes: [ChatTextInputStateTextAttribute]
+
+ public init() {
+ self.text = ""
+ self.attributes = []
+ }
+
+ public init(text: String, attributes: [ChatTextInputStateTextAttribute]) {
+ self.text = text
+ self.attributes = attributes
+ }
+
+ public init(attributedText: NSAttributedString) {
+ self.text = attributedText.string
+ var parsedAttributes: [ChatTextInputStateTextAttribute] = []
+ attributedText.enumerateAttributes(in: NSRange(location: 0, length: attributedText.length), options: [], using: { attributes, range, _ in
+ for (key, value) in attributes {
+ if key == ChatTextInputAttributes.bold {
+ parsedAttributes.append(ChatTextInputStateTextAttribute(type: .bold, range: range.location ..< (range.location + range.length)))
+ } else if key == ChatTextInputAttributes.italic {
+ parsedAttributes.append(ChatTextInputStateTextAttribute(type: .italic, range: range.location ..< (range.location + range.length)))
+ } else if key == ChatTextInputAttributes.monospace {
+ parsedAttributes.append(ChatTextInputStateTextAttribute(type: .monospace, range: range.location ..< (range.location + range.length)))
+ } else if key == ChatTextInputAttributes.textMention, let value = value as? ChatTextInputTextMentionAttribute {
+ parsedAttributes.append(ChatTextInputStateTextAttribute(type: .textMention(value.peerId), range: range.location ..< (range.location + range.length)))
+ } else if key == ChatTextInputAttributes.textUrl, let value = value as? ChatTextInputTextUrlAttribute {
+ parsedAttributes.append(ChatTextInputStateTextAttribute(type: .textUrl(value.url), range: range.location ..< (range.location + range.length)))
+ }
+ }
+ })
+ self.attributes = parsedAttributes
+ }
+
+ public init(decoder: PostboxDecoder) {
+ self.text = decoder.decodeStringForKey("text", orElse: "")
+ self.attributes = decoder.decodeObjectArrayWithDecoderForKey("attributes")
+ }
+
+ public func encode(_ encoder: PostboxEncoder) {
+ encoder.encodeString(self.text, forKey: "text")
+ encoder.encodeObjectArray(self.attributes, forKey: "attributes")
+ }
+
+ static public func ==(lhs: ChatTextInputStateText, rhs: ChatTextInputStateText) -> Bool {
+ return lhs.text == rhs.text && lhs.attributes == rhs.attributes
+ }
+
+ public func attributedText() -> NSAttributedString {
+ let result = NSMutableAttributedString(string: self.text)
+ for attribute in self.attributes {
+ switch attribute.type {
+ case .bold:
+ result.addAttribute(ChatTextInputAttributes.bold, value: true as NSNumber, range: NSRange(location: attribute.range.lowerBound, length: attribute.range.count))
+ case .italic:
+ result.addAttribute(ChatTextInputAttributes.italic, value: true as NSNumber, range: NSRange(location: attribute.range.lowerBound, length: attribute.range.count))
+ case .monospace:
+ result.addAttribute(ChatTextInputAttributes.monospace, value: true as NSNumber, range: NSRange(location: attribute.range.lowerBound, length: attribute.range.count))
+ case let .textMention(id):
+ result.addAttribute(ChatTextInputAttributes.textMention, value: ChatTextInputTextMentionAttribute(peerId: id), range: NSRange(location: attribute.range.lowerBound, length: attribute.range.count))
+ case let .textUrl(url):
+ result.addAttribute(ChatTextInputAttributes.textUrl, value: ChatTextInputTextUrlAttribute(url: url), range: NSRange(location: attribute.range.lowerBound, length: attribute.range.count))
+ }
+ }
+ return result
+ }
+}
diff --git a/submodules/AccountContext/Sources/ChatHistroyLocation.swift b/submodules/AccountContext/Sources/ChatHistroyLocation.swift
new file mode 100644
index 0000000000..5541df6c25
--- /dev/null
+++ b/submodules/AccountContext/Sources/ChatHistroyLocation.swift
@@ -0,0 +1,25 @@
+import Foundation
+import Postbox
+import Display
+
+public enum ChatHistoryInitialSearchLocation: Equatable {
+ case index(MessageIndex)
+ case id(MessageId)
+}
+
+public enum ChatHistoryLocation: Equatable {
+ case Initial(count: Int)
+ case InitialSearch(location: ChatHistoryInitialSearchLocation, count: Int)
+ case Navigation(index: MessageHistoryAnchorIndex, anchorIndex: MessageHistoryAnchorIndex, count: Int)
+ case Scroll(index: MessageHistoryAnchorIndex, anchorIndex: MessageHistoryAnchorIndex, sourceIndex: MessageHistoryAnchorIndex, scrollPosition: ListViewScrollPosition, animated: Bool)
+}
+
+public struct ChatHistoryLocationInput: Equatable {
+ public let content: ChatHistoryLocation
+ public let id: Int32
+
+ public init(content: ChatHistoryLocation, id: Int32) {
+ self.content = content
+ self.id = id
+ }
+}
diff --git a/submodules/TelegramUI/TelegramUI/DeviceContactData.swift b/submodules/AccountContext/Sources/DeviceContactData.swift
similarity index 92%
rename from submodules/TelegramUI/TelegramUI/DeviceContactData.swift
rename to submodules/AccountContext/Sources/DeviceContactData.swift
index 09fd35ca80..974dc6dde7 100644
--- a/submodules/TelegramUI/TelegramUI/DeviceContactData.swift
+++ b/submodules/AccountContext/Sources/DeviceContactData.swift
@@ -107,16 +107,14 @@ public final class DeviceContactAddressData: Equatable, Hashable {
return true
}
- public var hashValue: Int {
- var result = 0
- result = result &* 31 &+ self.label.hashValue
- result = result &* 31 &+ self.street1.hashValue
- result = result &* 31 &+ self.street2.hashValue
- result = result &* 31 &+ self.state.hashValue
- result = result &* 31 &+ self.city.hashValue
- result = result &* 31 &+ self.country.hashValue
- result = result &* 31 &+ self.postcode.hashValue
- return result
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.label)
+ hasher.combine(self.street1)
+ hasher.combine(self.street2)
+ hasher.combine(self.state)
+ hasher.combine(self.city)
+ hasher.combine(self.country)
+ hasher.combine(self.postcode)
}
}
@@ -149,13 +147,11 @@ public final class DeviceContactSocialProfileData: Equatable, Hashable {
return true
}
- public var hashValue: Int {
- var result = 0
- result = result &* 31 &+ self.label.hashValue
- result = result &* 31 &+ self.service.hashValue
- result = result &* 31 &+ self.username.hashValue
- result = result &* 31 &+ self.url.hashValue
- return result
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.label)
+ hasher.combine(self.service)
+ hasher.combine(self.username)
+ hasher.combine(self.url)
}
}
@@ -183,12 +179,10 @@ public final class DeviceContactInstantMessagingProfileData: Equatable, Hashable
return true
}
- public var hashValue: Int {
- var result = 0
- result = result &* 31 &+ self.label.hashValue
- result = result &* 31 &+ self.service.hashValue
- result = result &* 31 &+ self.username.hashValue
- return result
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.label)
+ hasher.combine(self.service)
+ hasher.combine(self.username)
}
}
@@ -201,7 +195,7 @@ public extension DeviceContactUrlData {
}
}
-func parseAppSpecificContactReference(_ value: String) -> PeerId? {
+public func parseAppSpecificContactReference(_ value: String) -> PeerId? {
if !value.hasPrefix(phonebookUsernamePrefix) {
return nil
}
@@ -241,7 +235,7 @@ public final class DeviceContactBasicDataWithReference: Equatable {
public let stableId: DeviceContactStableId
public let basicData: DeviceContactBasicData
- init(stableId: DeviceContactStableId, basicData: DeviceContactBasicData) {
+ public init(stableId: DeviceContactStableId, basicData: DeviceContactBasicData) {
self.stableId = stableId
self.basicData = basicData
}
@@ -328,7 +322,7 @@ public final class DeviceContactExtendedData: Equatable {
}
public extension DeviceContactExtendedData {
- public convenience init?(vcard: Data) {
+ convenience init?(vcard: Data) {
if #available(iOSApplicationExtension 9.0, iOS 9.0, *) {
guard let contact = (try? CNContactVCardSerialization.contacts(with: vcard))?.first else {
return nil
@@ -377,7 +371,7 @@ public extension DeviceContactExtendedData {
return contact
}
- public func serializedVCard() -> String? {
+ func serializedVCard() -> String? {
if #available(iOSApplicationExtension 9.0, iOS 9.0, *) {
guard let data = try? CNContactVCardSerialization.data(with: [self.asMutableCNContact()]) else {
return nil
@@ -428,7 +422,7 @@ public extension DeviceContactExtendedData {
self.init(basicData: basicData, middleName: contact.middleName, prefix: contact.namePrefix, suffix: contact.nameSuffix, organization: contact.organizationName, jobTitle: contact.jobTitle, department: contact.departmentName, emailAddresses: emailAddresses, urls: urls, addresses: addresses, birthdayDate: birthdayDate, socialProfiles: socialProfiles, instantMessagingProfiles: instantMessagingProfiles)
}
- public var isPrimitive: Bool {
+ var isPrimitive: Bool {
if self.basicData.phoneNumbers.count > 1 {
return false
}
@@ -463,7 +457,7 @@ public extension DeviceContactExtendedData {
}
}
-extension DeviceContactExtendedData {
+public extension DeviceContactExtendedData {
convenience init?(peer: Peer) {
guard let user = peer as? TelegramUser else {
return nil
diff --git a/submodules/AccountContext/Sources/DeviceContactDataManager.swift b/submodules/AccountContext/Sources/DeviceContactDataManager.swift
new file mode 100644
index 0000000000..10db927b98
--- /dev/null
+++ b/submodules/AccountContext/Sources/DeviceContactDataManager.swift
@@ -0,0 +1,21 @@
+import Foundation
+import Postbox
+import TelegramCore
+import TelegramUIPreferences
+import SwiftSignalKit
+
+public typealias DeviceContactStableId = String
+
+public protocol DeviceContactDataManager: class {
+ func personNameDisplayOrder() -> Signal
+ func basicData() -> Signal<[DeviceContactStableId: DeviceContactBasicData], NoError>
+ func basicDataForNormalizedPhoneNumber(_ normalizedNumber: DeviceContactNormalizedPhoneNumber) -> Signal<[(DeviceContactStableId, DeviceContactBasicData)], NoError>
+ func extendedData(stableId: DeviceContactStableId) -> Signal
+ func importable() -> Signal<[DeviceContactNormalizedPhoneNumber: ImportableDeviceContactData], NoError>
+ func appSpecificReferences() -> Signal<[PeerId: DeviceContactBasicDataWithReference], NoError>
+ func search(query: String) -> Signal<[DeviceContactStableId: (DeviceContactBasicData, PeerId?)], NoError>
+ func appendContactData(_ contactData: DeviceContactExtendedData, to stableId: DeviceContactStableId) -> Signal
+ func appendPhoneNumber(_ phoneNumber: DeviceContactPhoneNumberData, to stableId: DeviceContactStableId) -> Signal
+ func createContactWithData(_ contactData: DeviceContactExtendedData) -> Signal<(DeviceContactStableId, DeviceContactExtendedData)?, NoError>
+ func deleteContactWithAppSpecificReference(peerId: PeerId) -> Signal
+}
diff --git a/submodules/AccountContext/Sources/DownloadedMediaStoreManager.swift b/submodules/AccountContext/Sources/DownloadedMediaStoreManager.swift
new file mode 100644
index 0000000000..05653f8d6d
--- /dev/null
+++ b/submodules/AccountContext/Sources/DownloadedMediaStoreManager.swift
@@ -0,0 +1,21 @@
+import Foundation
+import TelegramCore
+import Postbox
+import TelegramUIPreferences
+import SwiftSignalKit
+
+public protocol DownloadedMediaStoreManager: class {
+ func store(_ media: AnyMediaReference, timestamp: Int32, peerType: MediaAutoDownloadPeerType)
+}
+
+public func storeDownloadedMedia(storeManager: DownloadedMediaStoreManager?, media: AnyMediaReference, peerType: MediaAutoDownloadPeerType) -> Signal {
+ guard case let .message(message, _) = media, let timestamp = message.timestamp, let incoming = message.isIncoming, incoming, let secret = message.isSecret, !secret else {
+ return .complete()
+ }
+
+ return Signal { [weak storeManager] subscriber in
+ storeManager?.store(media, timestamp: timestamp, peerType: peerType)
+ subscriber.putCompletion()
+ return EmptyDisposable
+ }
+}
diff --git a/submodules/AccountContext/Sources/FetchManager.swift b/submodules/AccountContext/Sources/FetchManager.swift
new file mode 100644
index 0000000000..054348169d
--- /dev/null
+++ b/submodules/AccountContext/Sources/FetchManager.swift
@@ -0,0 +1,157 @@
+import Foundation
+import Postbox
+import TelegramCore
+import SwiftSignalKit
+import TelegramUIPreferences
+
+public enum FetchManagerCategory: Int32 {
+ case image
+ case file
+ case voice
+ case animation
+}
+
+public enum FetchManagerLocationKey: Comparable, Hashable {
+ case messageId(MessageId)
+ case free
+
+ public static func <(lhs: FetchManagerLocationKey, rhs: FetchManagerLocationKey) -> Bool {
+ switch lhs {
+ case let .messageId(lhsId):
+ if case let .messageId(rhsId) = rhs {
+ return lhsId < rhsId
+ } else {
+ return true
+ }
+ case .free:
+ if case .free = rhs {
+ return false
+ } else {
+ return false
+ }
+ }
+ }
+}
+
+public struct FetchManagerPriorityKey: Comparable {
+ public let locationKey: FetchManagerLocationKey
+ public let hasElevatedPriority: Bool
+ public let userInitiatedPriority: Int32?
+ public let topReference: FetchManagerPriority?
+
+ public init(locationKey: FetchManagerLocationKey, hasElevatedPriority: Bool, userInitiatedPriority: Int32?, topReference: FetchManagerPriority?) {
+ self.locationKey = locationKey
+ self.hasElevatedPriority = hasElevatedPriority
+ self.userInitiatedPriority = userInitiatedPriority
+ self.topReference = topReference
+ }
+
+ public static func <(lhs: FetchManagerPriorityKey, rhs: FetchManagerPriorityKey) -> Bool {
+ if let lhsUserInitiatedPriority = lhs.userInitiatedPriority, let rhsUserInitiatedPriority = rhs.userInitiatedPriority {
+ if lhsUserInitiatedPriority != rhsUserInitiatedPriority {
+ if lhsUserInitiatedPriority > rhsUserInitiatedPriority {
+ return false
+ } else {
+ return true
+ }
+ }
+ } else if (lhs.userInitiatedPriority != nil) != (rhs.userInitiatedPriority != nil) {
+ if lhs.userInitiatedPriority != nil {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ if lhs.hasElevatedPriority != rhs.hasElevatedPriority {
+ if lhs.hasElevatedPriority {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ if lhs.topReference != rhs.topReference {
+ if let lhsTopReference = lhs.topReference, let rhsTopReference = rhs.topReference {
+ return lhsTopReference < rhsTopReference
+ } else if lhs.topReference != nil {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ return lhs.locationKey < rhs.locationKey
+ }
+}
+
+public enum FetchManagerLocation: Hashable {
+ case chat(PeerId)
+}
+
+public enum FetchManagerForegroundDirection {
+ case toEarlier
+ case toLater
+}
+
+public enum FetchManagerPriority: Comparable {
+ case userInitiated
+ case foregroundPrefetch(direction: FetchManagerForegroundDirection, localOrder: MessageIndex)
+ case backgroundPrefetch(locationOrder: HistoryPreloadIndex, localOrder: MessageIndex)
+
+ public static func <(lhs: FetchManagerPriority, rhs: FetchManagerPriority) -> Bool {
+ switch lhs {
+ case .userInitiated:
+ switch rhs {
+ case .userInitiated:
+ return false
+ case .foregroundPrefetch:
+ return true
+ case .backgroundPrefetch:
+ return true
+ }
+ case let .foregroundPrefetch(lhsDirection, lhsLocalOrder):
+ switch rhs {
+ case .userInitiated:
+ return false
+ case let .foregroundPrefetch(rhsDirection, rhsLocalOrder):
+ if lhsDirection == rhsDirection {
+ switch lhsDirection {
+ case .toEarlier:
+ return lhsLocalOrder > rhsLocalOrder
+ case .toLater:
+ return lhsLocalOrder < rhsLocalOrder
+ }
+ } else {
+ if lhsDirection == .toEarlier {
+ return true
+ } else {
+ return false
+ }
+ }
+ case .backgroundPrefetch:
+ return true
+ }
+ case let .backgroundPrefetch(lhsLocationOrder, lhsLocalOrder):
+ switch rhs {
+ case .userInitiated:
+ return false
+ case .foregroundPrefetch:
+ return false
+ case let .backgroundPrefetch(rhsLocationOrder, rhsLocalOrder):
+ if lhsLocationOrder != rhsLocationOrder {
+ return lhsLocationOrder < rhsLocationOrder
+ }
+ return lhsLocalOrder > rhsLocalOrder
+ }
+ }
+ }
+}
+
+public let FetchCompleteRange = IndexSet(integersIn: 0 ..< Int(Int32.max) as Range)
+
+public protocol FetchManager {
+ func interactivelyFetched(category: FetchManagerCategory, location: FetchManagerLocation, locationKey: FetchManagerLocationKey, mediaReference: AnyMediaReference?, resourceReference: MediaResourceReference, ranges: IndexSet, statsCategory: MediaResourceStatsCategory, elevatedPriority: Bool, userInitiated: Bool, priority: FetchManagerPriority, storeToDownloadsPeerType: MediaAutoDownloadPeerType?) -> Signal
+ func cancelInteractiveFetches(category: FetchManagerCategory, location: FetchManagerLocation, locationKey: FetchManagerLocationKey, resource: MediaResource)
+ func fetchStatus(category: FetchManagerCategory, location: FetchManagerLocation, locationKey: FetchManagerLocationKey, resource: MediaResource) -> Signal
+}
diff --git a/submodules/AccountContext/Sources/GalleryController.swift b/submodules/AccountContext/Sources/GalleryController.swift
new file mode 100644
index 0000000000..8a8012b878
--- /dev/null
+++ b/submodules/AccountContext/Sources/GalleryController.swift
@@ -0,0 +1,22 @@
+import Foundation
+import Postbox
+
+public final class GalleryControllerActionInteraction {
+ public let openUrl: (String, Bool) -> Void
+ public let openUrlIn: (String) -> Void
+ public let openPeerMention: (String) -> Void
+ public let openPeer: (PeerId) -> Void
+ public let openHashtag: (String?, String) -> Void
+ public let openBotCommand: (String) -> Void
+ public let addContact: (String) -> Void
+
+ public init(openUrl: @escaping (String, Bool) -> Void, openUrlIn: @escaping (String) -> Void, openPeerMention: @escaping (String) -> Void, openPeer: @escaping (PeerId) -> Void, openHashtag: @escaping (String?, String) -> Void, openBotCommand: @escaping (String) -> Void, addContact: @escaping (String) -> Void) {
+ self.openUrl = openUrl
+ self.openUrlIn = openUrlIn
+ self.openPeerMention = openPeerMention
+ self.openPeer = openPeer
+ self.openHashtag = openHashtag
+ self.openBotCommand = openBotCommand
+ self.addContact = addContact
+ }
+}
diff --git a/submodules/AccountContext/Sources/LiveLocationManager.swift b/submodules/AccountContext/Sources/LiveLocationManager.swift
new file mode 100644
index 0000000000..e43ba071f0
--- /dev/null
+++ b/submodules/AccountContext/Sources/LiveLocationManager.swift
@@ -0,0 +1,18 @@
+import Foundation
+import TelegramCore
+import Postbox
+import SwiftSignalKit
+
+public protocol LiveLocationSummaryManager {
+ func broadcastingToMessages() -> Signal<[MessageId: Message], NoError>
+ func peersBroadcastingTo(peerId: PeerId) -> Signal<[(Peer, Message)]?, NoError>
+}
+
+public protocol LiveLocationManager {
+ var summaryManager: LiveLocationSummaryManager { get }
+ var isPolling: Signal { get }
+
+ func cancelLiveLocation(peerId: PeerId)
+ func pollOnce()
+ func internalMessageForPeerId(_ peerId: PeerId) -> MessageId?
+}
diff --git a/submodules/AccountContext/Sources/MediaManager.swift b/submodules/AccountContext/Sources/MediaManager.swift
new file mode 100644
index 0000000000..38ef6c68ef
--- /dev/null
+++ b/submodules/AccountContext/Sources/MediaManager.swift
@@ -0,0 +1,107 @@
+import Foundation
+import Postbox
+import TelegramCore
+import SwiftSignalKit
+import UIKit
+import AsyncDisplayKit
+import TelegramAudio
+import UniversalMediaPlayer
+
+public enum MediaManagerPlayerType {
+ case voice
+ case music
+}
+
+public protocol MediaManager: class {
+ var audioSession: ManagedAudioSession { get }
+ var galleryHiddenMediaManager: GalleryHiddenMediaManager { get }
+ var universalVideoManager: UniversalVideoManager { get }
+ var overlayMediaManager: OverlayMediaManager { get }
+
+ var globalMediaPlayerState: Signal<(Account, SharedMediaPlayerItemPlaybackStateOrLoading, MediaManagerPlayerType)?, NoError> { get }
+ var musicMediaPlayerState: Signal<(Account, SharedMediaPlayerItemPlaybackStateOrLoading)?, NoError> { get }
+ var activeGlobalMediaPlayerAccountId: Signal<(AccountRecordId, Bool)?, NoError> { get }
+
+ func setPlaylist(_ playlist: (Account, SharedMediaPlaylist)?, type: MediaManagerPlayerType, control: SharedMediaPlayerControlAction)
+ func playlistControl(_ control: SharedMediaPlayerControlAction, type: MediaManagerPlayerType?)
+
+ func filteredPlaylistState(accountId: AccountRecordId, playlistId: SharedMediaPlaylistId, itemId: SharedMediaPlaylistItemId, type: MediaManagerPlayerType) -> Signal
+
+ func setOverlayVideoNode(_ node: OverlayMediaItemNode?)
+
+ func audioRecorder(beginWithTone: Bool, applicationBindings: TelegramApplicationBindings, beganWithTone: @escaping (Bool) -> Void) -> Signal
+}
+
+public enum GalleryHiddenMediaId: Hashable {
+ case chat(AccountRecordId, MessageId, Media)
+
+ public static func ==(lhs: GalleryHiddenMediaId, rhs: GalleryHiddenMediaId) -> Bool {
+ switch lhs {
+ case let .chat(lhsAccountId ,lhsMessageId, lhsMedia):
+ if case let .chat(rhsAccountId, rhsMessageId, rhsMedia) = rhs, lhsAccountId == rhsAccountId, lhsMessageId == rhsMessageId, lhsMedia.isEqual(to: rhsMedia) {
+ return true
+ } else {
+ return false
+ }
+ }
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ switch self {
+ case let .chat(accountId, messageId, _):
+ hasher.combine(accountId)
+ hasher.combine(messageId)
+ }
+ }
+}
+
+public protocol GalleryHiddenMediaTarget: class {
+ func getTransitionInfo(messageId: MessageId, media: Media) -> ((UIView) -> Void, ASDisplayNode, () -> (UIView?, UIView?))?
+}
+
+public protocol GalleryHiddenMediaManager: class {
+ func hiddenIds() -> Signal, NoError>
+ func addSource(_ signal: Signal) -> Int
+ func removeSource(_ index: Int)
+ func addTarget(_ target: GalleryHiddenMediaTarget)
+ func removeTarget(_ target: GalleryHiddenMediaTarget)
+ func findTarget(messageId: MessageId, media: Media) -> ((UIView) -> Void, ASDisplayNode, () -> (UIView?, UIView?))?
+}
+
+public protocol UniversalVideoManager: class {
+ func attachUniversalVideoContent(content: UniversalVideoContent, priority: UniversalVideoPriority, create: () -> UniversalVideoContentNode & ASDisplayNode, update: @escaping (((UniversalVideoContentNode & ASDisplayNode), Bool)?) -> Void) -> (AnyHashable, Int32)
+ func detachUniversalVideoContent(id: AnyHashable, index: Int32)
+ func withUniversalVideoContent(id: AnyHashable, _ f: ((UniversalVideoContentNode & ASDisplayNode)?) -> Void)
+ func addPlaybackCompleted(id: AnyHashable, _ f: @escaping () -> Void) -> Int
+ func removePlaybackCompleted(id: AnyHashable, index: Int)
+ func statusSignal(content: UniversalVideoContent) -> Signal
+ func bufferingStatusSignal(content: UniversalVideoContent) -> Signal<(IndexSet, Int)?, NoError>
+}
+
+public enum AudioRecordingState: Equatable {
+ case paused(duration: Double)
+ case recording(duration: Double, durationMediaTimestamp: Double)
+ case stopped
+}
+
+public struct RecordedAudioData {
+ public let compressedData: Data
+ public let duration: Double
+ public let waveform: Data?
+
+ public init(compressedData: Data, duration: Double, waveform: Data?) {
+ self.compressedData = compressedData
+ self.duration = duration
+ self.waveform = waveform
+ }
+}
+
+public protocol ManagedAudioRecorder: class {
+ var beginWithTone: Bool { get }
+ var micLevel: Signal { get }
+ var recordingState: Signal { get }
+
+ func start()
+ func stop()
+ func takenRecordedData() -> Signal
+}
diff --git a/submodules/AccountContext/Sources/OpenChatMessage.swift b/submodules/AccountContext/Sources/OpenChatMessage.swift
new file mode 100644
index 0000000000..4f617ca118
--- /dev/null
+++ b/submodules/AccountContext/Sources/OpenChatMessage.swift
@@ -0,0 +1,79 @@
+import Foundation
+import UIKit
+import Postbox
+import TelegramCore
+import SwiftSignalKit
+import Display
+
+public enum ChatControllerInteractionOpenMessageMode {
+ case `default`
+ case stream
+ case automaticPlayback
+ case landscape
+ case timecode(Double)
+ case link
+}
+
+public final class OpenChatMessageParams {
+ public let context: AccountContext
+ public let message: Message
+ public let standalone: Bool
+ public let reverseMessageGalleryOrder: Bool
+ public let mode: ChatControllerInteractionOpenMessageMode
+ public let navigationController: NavigationController?
+ public let modal: Bool
+ public let dismissInput: () -> Void
+ public let present: (ViewController, Any?) -> Void
+ public let transitionNode: (MessageId, Media) -> (ASDisplayNode, () -> (UIView?, UIView?))?
+ public let addToTransitionSurface: (UIView) -> Void
+ public let openUrl: (String) -> Void
+ public let openPeer: (Peer, ChatControllerInteractionNavigateToPeer) -> Void
+ public let callPeer: (PeerId) -> Void
+ public let enqueueMessage: (EnqueueMessage) -> Void
+ public let sendSticker: ((FileMediaReference, ASDisplayNode, CGRect) -> Bool)?
+ public let setupTemporaryHiddenMedia: (Signal, Int, Media) -> Void
+ public let chatAvatarHiddenMedia: (Signal, Media) -> Void
+ public let actionInteraction: GalleryControllerActionInteraction?
+
+ public init(
+ context: AccountContext,
+ message: Message,
+ standalone: Bool,
+ reverseMessageGalleryOrder: Bool,
+ mode: ChatControllerInteractionOpenMessageMode = .default,
+ navigationController: NavigationController?,
+ modal: Bool = false,
+ dismissInput: @escaping () -> Void,
+ present: @escaping (ViewController, Any?) -> Void,
+ transitionNode: @escaping (MessageId, Media) -> (ASDisplayNode, () -> (UIView?, UIView?))?,
+ addToTransitionSurface: @escaping (UIView) -> Void,
+ openUrl: @escaping (String) -> Void,
+ openPeer: @escaping (Peer, ChatControllerInteractionNavigateToPeer) -> Void,
+ callPeer: @escaping (PeerId) -> Void,
+ enqueueMessage: @escaping (EnqueueMessage) -> Void,
+ sendSticker: ((FileMediaReference, ASDisplayNode, CGRect) -> Bool)?,
+ setupTemporaryHiddenMedia: @escaping (Signal, Int, Media) -> Void,
+ chatAvatarHiddenMedia: @escaping (Signal, Media) -> Void,
+ actionInteraction: GalleryControllerActionInteraction? = nil
+ ) {
+ self.context = context
+ self.message = message
+ self.standalone = standalone
+ self.reverseMessageGalleryOrder = reverseMessageGalleryOrder
+ self.mode = mode
+ self.navigationController = navigationController
+ self.modal = modal
+ self.dismissInput = dismissInput
+ self.present = present
+ self.transitionNode = transitionNode
+ self.addToTransitionSurface = addToTransitionSurface
+ self.openUrl = openUrl
+ self.openPeer = openPeer
+ self.callPeer = callPeer
+ self.enqueueMessage = enqueueMessage
+ self.sendSticker = sendSticker
+ self.setupTemporaryHiddenMedia = setupTemporaryHiddenMedia
+ self.chatAvatarHiddenMedia = chatAvatarHiddenMedia
+ self.actionInteraction = actionInteraction
+ }
+}
diff --git a/submodules/AccountContext/Sources/OverlayAudioPlayerController.swift b/submodules/AccountContext/Sources/OverlayAudioPlayerController.swift
new file mode 100644
index 0000000000..a3257e0740
--- /dev/null
+++ b/submodules/AccountContext/Sources/OverlayAudioPlayerController.swift
@@ -0,0 +1,5 @@
+import Foundation
+
+public protocol OverlayAudioPlayerController: class {
+
+}
diff --git a/submodules/AccountContext/Sources/OverlayMediaItemNode.swift b/submodules/AccountContext/Sources/OverlayMediaItemNode.swift
new file mode 100644
index 0000000000..4913f5301b
--- /dev/null
+++ b/submodules/AccountContext/Sources/OverlayMediaItemNode.swift
@@ -0,0 +1,61 @@
+import Foundation
+import UIKit
+import AsyncDisplayKit
+
+public struct OverlayMediaItemNodeGroup: Hashable, RawRepresentable {
+ public var rawValue: Int32
+
+ public init(rawValue: Int32) {
+ self.rawValue = rawValue
+ }
+}
+
+public enum OverlayMediaItemMinimizationEdge {
+ case left
+ case right
+}
+
+open class OverlayMediaItemNode: ASDisplayNode {
+ open var hasAttachedContextUpdated: ((Bool) -> Void)?
+ open var hasAttachedContext: Bool = false
+
+ open var unminimize: (() -> Void)?
+
+ open var group: OverlayMediaItemNodeGroup? {
+ return nil
+ }
+
+ open var tempExtendedTopInset: Bool {
+ return false
+ }
+
+ open var isMinimizeable: Bool {
+ return false
+ }
+
+ open var customTransition: Bool = false
+
+ open func setShouldAcquireContext(_ value: Bool) {
+ }
+
+ open func preferredSizeForOverlayDisplay() -> CGSize {
+ return CGSize(width: 50.0, height: 50.0)
+ }
+
+ open func updateLayout(_ size: CGSize) {
+ }
+
+ open func dismiss() {
+ }
+
+ open func updateMinimizedEdge(_ edge: OverlayMediaItemMinimizationEdge?, adjusting: Bool) {
+ }
+
+ open func performCustomTransitionIn() -> Bool {
+ return false
+ }
+
+ open func performCustomTransitionOut() -> Bool {
+ return false
+ }
+}
diff --git a/submodules/AccountContext/Sources/OverlayMediaManager.swift b/submodules/AccountContext/Sources/OverlayMediaManager.swift
new file mode 100644
index 0000000000..15edac8a7d
--- /dev/null
+++ b/submodules/AccountContext/Sources/OverlayMediaManager.swift
@@ -0,0 +1,19 @@
+import Foundation
+import Display
+
+public protocol OverlayMediaController: class {
+ var hasNodes: Bool { get }
+ func addNode(_ node: OverlayMediaItemNode, customTransition: Bool)
+ func removeNode(_ node: OverlayMediaItemNode, customTransition: Bool)
+}
+
+public final class OverlayMediaManager {
+ public var controller: (OverlayMediaController & ViewController)?
+
+ public init() {
+ }
+
+ public func attachOverlayMediaController(_ controller: OverlayMediaController & ViewController) {
+ self.controller = controller
+ }
+}
diff --git a/submodules/AccountContext/Sources/PresentationCallManager.swift b/submodules/AccountContext/Sources/PresentationCallManager.swift
new file mode 100644
index 0000000000..e90cbcf31c
--- /dev/null
+++ b/submodules/AccountContext/Sources/PresentationCallManager.swift
@@ -0,0 +1,52 @@
+import Foundation
+import Postbox
+import TelegramCore
+import SwiftSignalKit
+import TelegramAudio
+
+public enum RequestCallResult {
+ case requested
+ case alreadyInProgress(PeerId)
+}
+
+public enum PresentationCallState: Equatable {
+ case waiting
+ case ringing
+ case requesting(Bool)
+ case connecting(Data?)
+ case active(Double, Int32?, Data)
+ case terminating
+ case terminated(CallId?, CallSessionTerminationReason?, Bool)
+}
+
+public protocol PresentationCall: class {
+ var account: Account { get }
+ var isIntegratedWithCallKit: Bool { get }
+ var internalId: CallSessionInternalId { get }
+ var peerId: PeerId { get }
+ var isOutgoing: Bool { get }
+ var peer: Peer? { get }
+
+ var state: Signal { get }
+
+ var isMuted: Signal { get }
+
+ var audioOutputState: Signal<([AudioSessionOutput], AudioSessionOutput?), NoError> { get }
+
+ var canBeRemoved: Signal { get }
+
+ func answer()
+ func hangUp() -> Signal
+ func rejectBusy()
+
+ func toggleIsMuted()
+ func setIsMuted(_ value: Bool)
+ func setCurrentAudioOutput(_ output: AudioSessionOutput)
+ func debugInfo() -> Signal<(String, String), NoError>
+}
+
+public protocol PresentationCallManager: class {
+ var currentCallSignal: Signal { get }
+
+ func requestCall(account: Account, peerId: PeerId, endCurrentIfAny: Bool) -> RequestCallResult
+}
diff --git a/submodules/AccountContext/Sources/SharedMediaPlayer.swift b/submodules/AccountContext/Sources/SharedMediaPlayer.swift
new file mode 100644
index 0000000000..1f3bd04142
--- /dev/null
+++ b/submodules/AccountContext/Sources/SharedMediaPlayer.swift
@@ -0,0 +1,311 @@
+import Foundation
+import TelegramCore
+import Postbox
+import TelegramUIPreferences
+import SwiftSignalKit
+import UniversalMediaPlayer
+
+public enum SharedMediaPlaybackDataType {
+ case music
+ case voice
+ case instantVideo
+}
+
+public enum SharedMediaPlaybackDataSource: Equatable {
+ case telegramFile(FileMediaReference)
+
+ public static func ==(lhs: SharedMediaPlaybackDataSource, rhs: SharedMediaPlaybackDataSource) -> Bool {
+ switch lhs {
+ case let .telegramFile(lhsFileReference):
+ if case let .telegramFile(rhsFileReference) = rhs {
+ if !lhsFileReference.media.isEqual(to: rhsFileReference.media) {
+ return false
+ }
+ return true
+ } else {
+ return false
+ }
+ }
+ }
+}
+
+public struct SharedMediaPlaybackData: Equatable {
+ public let type: SharedMediaPlaybackDataType
+ public let source: SharedMediaPlaybackDataSource
+
+ public init(type: SharedMediaPlaybackDataType, source: SharedMediaPlaybackDataSource) {
+ self.type = type
+ self.source = source
+ }
+
+ public static func ==(lhs: SharedMediaPlaybackData, rhs: SharedMediaPlaybackData) -> Bool {
+ return lhs.type == rhs.type && lhs.source == rhs.source
+ }
+}
+
+public struct SharedMediaPlaybackAlbumArt: Equatable {
+ public let thumbnailResource: TelegramMediaResource
+ public let fullSizeResource: TelegramMediaResource
+
+ public init(thumbnailResource: TelegramMediaResource, fullSizeResource: TelegramMediaResource) {
+ self.thumbnailResource = thumbnailResource
+ self.fullSizeResource = fullSizeResource
+ }
+
+ public static func ==(lhs: SharedMediaPlaybackAlbumArt, rhs: SharedMediaPlaybackAlbumArt) -> Bool {
+ if !lhs.thumbnailResource.isEqual(to: rhs.thumbnailResource) {
+ return false
+ }
+
+ if !lhs.fullSizeResource.isEqual(to: rhs.fullSizeResource) {
+ return false
+ }
+
+ return true
+ }
+}
+
+public enum SharedMediaPlaybackDisplayData: Equatable {
+ case music(title: String?, performer: String?, albumArt: SharedMediaPlaybackAlbumArt?)
+ case voice(author: Peer?, peer: Peer?)
+ case instantVideo(author: Peer?, peer: Peer?, timestamp: Int32)
+
+ public static func ==(lhs: SharedMediaPlaybackDisplayData, rhs: SharedMediaPlaybackDisplayData) -> Bool {
+ switch lhs {
+ case let .music(lhsTitle, lhsPerformer, lhsAlbumArt):
+ if case let .music(rhsTitle, rhsPerformer, rhsAlbumArt) = rhs, lhsTitle == rhsTitle, lhsPerformer == rhsPerformer, lhsAlbumArt == rhsAlbumArt {
+ return true
+ } else {
+ return false
+ }
+ case let .voice(lhsAuthor, lhsPeer):
+ if case let .voice(rhsAuthor, rhsPeer) = rhs, arePeersEqual(lhsAuthor, rhsAuthor), arePeersEqual(lhsPeer, rhsPeer) {
+ return true
+ } else {
+ return false
+ }
+ case let .instantVideo(lhsAuthor, lhsPeer, lhsTimestamp):
+ if case let .instantVideo(rhsAuthor, rhsPeer, rhsTimestamp) = rhs, arePeersEqual(lhsAuthor, rhsAuthor), arePeersEqual(lhsPeer, rhsPeer), lhsTimestamp == rhsTimestamp {
+ return true
+ } else {
+ return false
+ }
+ }
+ }
+}
+
+public protocol SharedMediaPlaylistItem {
+ var stableId: AnyHashable { get }
+ var id: SharedMediaPlaylistItemId { get }
+ var playbackData: SharedMediaPlaybackData? { get }
+ var displayData: SharedMediaPlaybackDisplayData? { get }
+}
+
+public func arePlaylistItemsEqual(_ lhs: SharedMediaPlaylistItem?, _ rhs: SharedMediaPlaylistItem?) -> Bool {
+ if lhs?.stableId != rhs?.stableId {
+ return false
+ }
+ if lhs?.playbackData != rhs?.playbackData {
+ return false
+ }
+ if lhs?.displayData != rhs?.displayData {
+ return false
+ }
+ return true
+}
+
+public protocol SharedMediaPlaylistId {
+ func isEqual(to: SharedMediaPlaylistId) -> Bool
+}
+
+public protocol SharedMediaPlaylistItemId {
+ func isEqual(to: SharedMediaPlaylistItemId) -> Bool
+}
+
+public func areSharedMediaPlaylistItemIdsEqual(_ lhs: SharedMediaPlaylistItemId?, _ rhs: SharedMediaPlaylistItemId?) -> Bool {
+ if let lhs = lhs, let rhs = rhs {
+ return lhs.isEqual(to: rhs)
+ } else if (lhs != nil) != (rhs != nil) {
+ return false
+ } else {
+ return true
+ }
+}
+
+public struct PeerMessagesMediaPlaylistItemId: SharedMediaPlaylistItemId {
+ public let messageId: MessageId
+
+ public init(messageId: MessageId) {
+ self.messageId = messageId
+ }
+
+ public func isEqual(to: SharedMediaPlaylistItemId) -> Bool {
+ if let to = to as? PeerMessagesMediaPlaylistItemId {
+ if self.messageId != to.messageId {
+ return false
+ }
+ return true
+ }
+ return false
+ }
+}
+
+public protocol SharedMediaPlaylistLocation {
+ func isEqual(to: SharedMediaPlaylistLocation) -> Bool
+}
+
+public protocol SharedMediaPlaylist: class {
+ var id: SharedMediaPlaylistId { get }
+ var location: SharedMediaPlaylistLocation { get }
+ var state: Signal { get }
+ var looping: MusicPlaybackSettingsLooping { get }
+ var currentItemDisappeared: (() -> Void)? { get set }
+
+ func control(_ action: SharedMediaPlaylistControlAction)
+ func setOrder(_ order: MusicPlaybackSettingsOrder)
+ func setLooping(_ looping: MusicPlaybackSettingsLooping)
+
+ func onItemPlaybackStarted(_ item: SharedMediaPlaylistItem)
+}
+
+public enum SharedMediaPlayerPlaybackControlAction {
+ case play
+ case pause
+ case togglePlayPause
+}
+
+public enum SharedMediaPlayerControlAction {
+ case next
+ case previous
+ case playback(SharedMediaPlayerPlaybackControlAction)
+ case seek(Double)
+ case setOrder(MusicPlaybackSettingsOrder)
+ case setLooping(MusicPlaybackSettingsLooping)
+ case setBaseRate(AudioPlaybackRate)
+}
+
+public enum SharedMediaPlaylistControlAction {
+ case next
+ case previous
+}
+
+public final class SharedMediaPlaylistState: Equatable {
+ public let loading: Bool
+ public let playedToEnd: Bool
+ public let item: SharedMediaPlaylistItem?
+ public let nextItem: SharedMediaPlaylistItem?
+ public let previousItem: SharedMediaPlaylistItem?
+ public let order: MusicPlaybackSettingsOrder
+ public let looping: MusicPlaybackSettingsLooping
+
+ public init(loading: Bool, playedToEnd: Bool, item: SharedMediaPlaylistItem?, nextItem: SharedMediaPlaylistItem?, previousItem: SharedMediaPlaylistItem?, order: MusicPlaybackSettingsOrder, looping: MusicPlaybackSettingsLooping) {
+ self.loading = loading
+ self.playedToEnd = playedToEnd
+ self.item = item
+ self.nextItem = nextItem
+ self.previousItem = previousItem
+ self.order = order
+ self.looping = looping
+ }
+
+ public static func ==(lhs: SharedMediaPlaylistState, rhs: SharedMediaPlaylistState) -> Bool {
+ if lhs.loading != rhs.loading {
+ return false
+ }
+ if !arePlaylistItemsEqual(lhs.item, rhs.item) {
+ return false
+ }
+ if !arePlaylistItemsEqual(lhs.nextItem, rhs.nextItem) {
+ return false
+ }
+ if !arePlaylistItemsEqual(lhs.previousItem, rhs.previousItem) {
+ return false
+ }
+ if lhs.order != rhs.order {
+ return false
+ }
+ if lhs.looping != rhs.looping {
+ return false
+ }
+ return true
+ }
+}
+
+public final class SharedMediaPlayerItemPlaybackState: Equatable {
+ public let playlistId: SharedMediaPlaylistId
+ public let playlistLocation: SharedMediaPlaylistLocation
+ public let item: SharedMediaPlaylistItem
+ public let previousItem: SharedMediaPlaylistItem?
+ public let nextItem: SharedMediaPlaylistItem?
+ public let status: MediaPlayerStatus
+ public let order: MusicPlaybackSettingsOrder
+ public let looping: MusicPlaybackSettingsLooping
+ public let playerIndex: Int32
+
+ public init(playlistId: SharedMediaPlaylistId, playlistLocation: SharedMediaPlaylistLocation, item: SharedMediaPlaylistItem, previousItem: SharedMediaPlaylistItem?, nextItem: SharedMediaPlaylistItem?, status: MediaPlayerStatus, order: MusicPlaybackSettingsOrder, looping: MusicPlaybackSettingsLooping, playerIndex: Int32) {
+ self.playlistId = playlistId
+ self.playlistLocation = playlistLocation
+ self.item = item
+ self.previousItem = previousItem
+ self.nextItem = nextItem
+ self.status = status
+ self.order = order
+ self.looping = looping
+ self.playerIndex = playerIndex
+ }
+
+ public static func ==(lhs: SharedMediaPlayerItemPlaybackState, rhs: SharedMediaPlayerItemPlaybackState) -> Bool {
+ if !lhs.playlistId.isEqual(to: rhs.playlistId) {
+ return false
+ }
+ if !arePlaylistItemsEqual(lhs.item, rhs.item) {
+ return false
+ }
+ if !arePlaylistItemsEqual(lhs.previousItem, rhs.previousItem) {
+ return false
+ }
+ if !arePlaylistItemsEqual(lhs.nextItem, rhs.nextItem) {
+ return false
+ }
+ if lhs.status != rhs.status {
+ return false
+ }
+ if lhs.playerIndex != rhs.playerIndex {
+ return false
+ }
+ if lhs.order != rhs.order {
+ return false
+ }
+ if lhs.looping != rhs.looping {
+ return false
+ }
+ return true
+ }
+}
+
+public enum SharedMediaPlayerState: Equatable {
+ case loading
+ case item(SharedMediaPlayerItemPlaybackState)
+
+ public static func ==(lhs: SharedMediaPlayerState, rhs: SharedMediaPlayerState) -> Bool {
+ switch lhs {
+ case .loading:
+ if case .loading = rhs {
+ return true
+ } else {
+ return false
+ }
+ case let .item(item):
+ if case .item(item) = rhs {
+ return true
+ } else {
+ return false
+ }
+ }
+ }
+}
+
+public enum SharedMediaPlayerItemPlaybackStateOrLoading: Equatable {
+ case state(SharedMediaPlayerItemPlaybackState)
+ case loading
+}
diff --git a/submodules/TelegramUI/TelegramUI/UniversalVideoNode.swift b/submodules/AccountContext/Sources/UniversalVideoNode.swift
similarity index 83%
rename from submodules/TelegramUI/TelegramUI/UniversalVideoNode.swift
rename to submodules/AccountContext/Sources/UniversalVideoNode.swift
index a6113d3b22..686fcc711e 100644
--- a/submodules/TelegramUI/TelegramUI/UniversalVideoNode.swift
+++ b/submodules/AccountContext/Sources/UniversalVideoNode.swift
@@ -8,7 +8,7 @@ import Display
import TelegramAudio
import UniversalMediaPlayer
-protocol UniversalVideoContentNode: class {
+public protocol UniversalVideoContentNode: class {
var ready: Signal { get }
var status: Signal { get }
var bufferingStatus: Signal<(IndexSet, Int)?, NoError> { get }
@@ -30,7 +30,7 @@ protocol UniversalVideoContentNode: class {
func fetchControl(_ control: UniversalVideoNodeFetchControl)
}
-protocol UniversalVideoContent {
+public protocol UniversalVideoContent {
var id: AnyHashable { get }
var dimensions: CGSize { get }
var duration: Int32 { get }
@@ -40,13 +40,13 @@ protocol UniversalVideoContent {
func isEqual(to other: UniversalVideoContent) -> Bool
}
-extension UniversalVideoContent {
+public extension UniversalVideoContent {
func isEqual(to other: UniversalVideoContent) -> Bool {
return false
}
}
-protocol UniversalVideoDecoration: class {
+public protocol UniversalVideoDecoration: class {
var backgroundNode: ASDisplayNode? { get }
var contentContainerNode: ASDisplayNode { get }
var foregroundNode: ASDisplayNode? { get }
@@ -59,33 +59,29 @@ protocol UniversalVideoDecoration: class {
func tap()
}
-enum UniversalVideoPriority: Int32, Comparable {
+public enum UniversalVideoPriority: Int32, Comparable {
case secondaryOverlay = 0
case embedded = 1
case gallery = 2
case overlay = 3
- static func <(lhs: UniversalVideoPriority, rhs: UniversalVideoPriority) -> Bool {
+ public static func <(lhs: UniversalVideoPriority, rhs: UniversalVideoPriority) -> Bool {
return lhs.rawValue < rhs.rawValue
}
-
- static func ==(lhs: UniversalVideoPriority, rhs: UniversalVideoPriority) -> Bool {
- return lhs.rawValue == rhs.rawValue
- }
}
-enum UniversalVideoNodeFetchControl {
+public enum UniversalVideoNodeFetchControl {
case fetch
case cancel
}
-final class UniversalVideoNode: ASDisplayNode {
+public final class UniversalVideoNode: ASDisplayNode {
private let postbox: Postbox
private let audioSession: ManagedAudioSession
- private let manager: UniversalVideoContentManager
+ private let manager: UniversalVideoManager
private let content: UniversalVideoContent
private let priority: UniversalVideoPriority
- let decoration: UniversalVideoDecoration
+ public let decoration: UniversalVideoDecoration
private let autoplay: Bool
private let snapshotContentWhenGone: Bool
@@ -95,27 +91,27 @@ final class UniversalVideoNode: ASDisplayNode {
private var playbackCompletedIndex: Int?
private var contentRequestIndex: (AnyHashable, Int32)?
- var playbackCompleted: (() -> Void)?
+ public var playbackCompleted: (() -> Void)?
- private(set) var ownsContentNode: Bool = false
- var ownsContentNodeUpdated: ((Bool) -> Void)?
+ public private(set) var ownsContentNode: Bool = false
+ public var ownsContentNodeUpdated: ((Bool) -> Void)?
private let _status = Promise()
- var status: Signal {
+ public var status: Signal {
return self._status.get()
}
private let _bufferingStatus = Promise<(IndexSet, Int)?>()
- var bufferingStatus: Signal<(IndexSet, Int)?, NoError> {
+ public var bufferingStatus: Signal<(IndexSet, Int)?, NoError> {
return self._bufferingStatus.get()
}
private let _ready = Promise()
- var ready: Signal {
+ public var ready: Signal {
return self._ready.get()
}
- var canAttachContent: Bool = false {
+ public var canAttachContent: Bool = false {
didSet {
if self.canAttachContent != oldValue {
if self.canAttachContent {
@@ -142,11 +138,11 @@ final class UniversalVideoNode: ASDisplayNode {
}
}
- var hasAttachedContext: Bool {
+ public var hasAttachedContext: Bool {
return self.contentNode != nil
}
- init(postbox: Postbox, audioSession: ManagedAudioSession, manager: UniversalVideoContentManager, decoration: UniversalVideoDecoration, content: UniversalVideoContent, priority: UniversalVideoPriority, autoplay: Bool = false, snapshotContentWhenGone: Bool = false) {
+ public init(postbox: Postbox, audioSession: ManagedAudioSession, manager: UniversalVideoManager, decoration: UniversalVideoDecoration, content: UniversalVideoContent, priority: UniversalVideoPriority, autoplay: Bool = false, snapshotContentWhenGone: Bool = false) {
self.postbox = postbox
self.audioSession = audioSession
self.manager = manager
@@ -178,7 +174,7 @@ final class UniversalVideoNode: ASDisplayNode {
}
}
- override func didLoad() {
+ override public func didLoad() {
super.didLoad()
self.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.tapGesture(_:))))
@@ -230,11 +226,11 @@ final class UniversalVideoNode: ASDisplayNode {
}
}
- func updateLayout(size: CGSize, transition: ContainedViewLayoutTransition) {
+ public func updateLayout(size: CGSize, transition: ContainedViewLayoutTransition) {
self.decoration.updateLayout(size: size, transition: transition)
}
- func play() {
+ public func play() {
self.manager.withUniversalVideoContent(id: self.content.id, { contentNode in
if let contentNode = contentNode {
contentNode.play()
@@ -242,7 +238,7 @@ final class UniversalVideoNode: ASDisplayNode {
})
}
- func pause() {
+ public func pause() {
self.manager.withUniversalVideoContent(id: self.content.id, { contentNode in
if let contentNode = contentNode {
contentNode.pause()
@@ -250,7 +246,7 @@ final class UniversalVideoNode: ASDisplayNode {
})
}
- func togglePlayPause() {
+ public func togglePlayPause() {
self.manager.withUniversalVideoContent(id: self.content.id, { contentNode in
if let contentNode = contentNode {
contentNode.togglePlayPause()
@@ -258,7 +254,7 @@ final class UniversalVideoNode: ASDisplayNode {
})
}
- func setSoundEnabled(_ value: Bool) {
+ public func setSoundEnabled(_ value: Bool) {
self.manager.withUniversalVideoContent(id: self.content.id, { contentNode in
if let contentNode = contentNode {
contentNode.setSoundEnabled(value)
@@ -266,7 +262,7 @@ final class UniversalVideoNode: ASDisplayNode {
})
}
- func seek(_ timestamp: Double) {
+ public func seek(_ timestamp: Double) {
self.manager.withUniversalVideoContent(id: self.content.id, { contentNode in
if let contentNode = contentNode {
contentNode.seek(timestamp)
@@ -274,7 +270,7 @@ final class UniversalVideoNode: ASDisplayNode {
})
}
- func playOnceWithSound(playAndRecord: Bool, seek: MediaPlayerSeek = .start, actionAtEnd: MediaPlayerPlayOnceWithSoundActionAtEnd = .loopDisablingSound) {
+ public func playOnceWithSound(playAndRecord: Bool, seek: MediaPlayerSeek = .start, actionAtEnd: MediaPlayerPlayOnceWithSoundActionAtEnd = .loopDisablingSound) {
self.manager.withUniversalVideoContent(id: self.content.id, { contentNode in
if let contentNode = contentNode {
contentNode.playOnceWithSound(playAndRecord: playAndRecord, seek: seek, actionAtEnd: actionAtEnd)
@@ -282,7 +278,7 @@ final class UniversalVideoNode: ASDisplayNode {
})
}
- func setContinuePlayingWithoutSoundOnLostAudioSession(_ value: Bool) {
+ public func setContinuePlayingWithoutSoundOnLostAudioSession(_ value: Bool) {
self.manager.withUniversalVideoContent(id: self.content.id, { contentNode in
if let contentNode = contentNode {
contentNode.setContinuePlayingWithoutSoundOnLostAudioSession(value)
@@ -290,7 +286,7 @@ final class UniversalVideoNode: ASDisplayNode {
})
}
- func setForceAudioToSpeaker(_ forceAudioToSpeaker: Bool) {
+ public func setForceAudioToSpeaker(_ forceAudioToSpeaker: Bool) {
self.manager.withUniversalVideoContent(id: self.content.id, { contentNode in
if let contentNode = contentNode {
contentNode.setForceAudioToSpeaker(forceAudioToSpeaker)
@@ -298,7 +294,7 @@ final class UniversalVideoNode: ASDisplayNode {
})
}
- func setBaseRate(_ baseRate: Double) {
+ public func setBaseRate(_ baseRate: Double) {
self.manager.withUniversalVideoContent(id: self.content.id, { contentNode in
if let contentNode = contentNode {
contentNode.setBaseRate(baseRate)
@@ -306,7 +302,7 @@ final class UniversalVideoNode: ASDisplayNode {
})
}
- func continuePlayingWithoutSound(actionAtEnd: MediaPlayerPlayOnceWithSoundActionAtEnd = .loopDisablingSound) {
+ public func continuePlayingWithoutSound(actionAtEnd: MediaPlayerPlayOnceWithSoundActionAtEnd = .loopDisablingSound) {
self.manager.withUniversalVideoContent(id: self.content.id, { contentNode in
if let contentNode = contentNode {
contentNode.continuePlayingWithoutSound(actionAtEnd: actionAtEnd)
@@ -314,7 +310,7 @@ final class UniversalVideoNode: ASDisplayNode {
})
}
- func fetchControl(_ control: UniversalVideoNodeFetchControl) {
+ public func fetchControl(_ control: UniversalVideoNodeFetchControl) {
self.manager.withUniversalVideoContent(id: self.content.id, { contentNode in
if let contentNode = contentNode {
contentNode.fetchControl(control)
@@ -322,7 +318,7 @@ final class UniversalVideoNode: ASDisplayNode {
})
}
- @objc func tapGesture(_ recognizer: UITapGestureRecognizer) {
+ @objc private func tapGesture(_ recognizer: UITapGestureRecognizer) {
if case .ended = recognizer.state {
self.decoration.tap()
}
diff --git a/submodules/AccountContext/Sources/WallpaperUploadManager.swift b/submodules/AccountContext/Sources/WallpaperUploadManager.swift
new file mode 100644
index 0000000000..5c3a67f351
--- /dev/null
+++ b/submodules/AccountContext/Sources/WallpaperUploadManager.swift
@@ -0,0 +1,24 @@
+import Foundation
+import SwiftSignalKit
+import TelegramCore
+import TelegramPresentationData
+
+public enum WallpaperUploadManagerStatus {
+ case none
+ case uploading(TelegramWallpaper, Float)
+ case uploaded(TelegramWallpaper, TelegramWallpaper)
+
+ public var wallpaper: TelegramWallpaper? {
+ switch self {
+ case let .uploading(wallpaper, _), let .uploaded(wallpaper, _):
+ return wallpaper
+ default:
+ return nil
+ }
+ }
+}
+
+public protocol WallpaperUploadManager: class {
+ func stateSignal() -> Signal
+ func presentationDataUpdated(_ presentationData: PresentationData)
+}
diff --git a/submodules/AccountContext/Sources/WatchManager.swift b/submodules/AccountContext/Sources/WatchManager.swift
new file mode 100644
index 0000000000..b7574c28f8
--- /dev/null
+++ b/submodules/AccountContext/Sources/WatchManager.swift
@@ -0,0 +1,23 @@
+import Foundation
+import SwiftSignalKit
+import Postbox
+
+public struct WatchRunningTasks: Equatable {
+ public let running: Bool
+ public let version: Int32
+
+ public init(running: Bool, version: Int32) {
+ self.running = running
+ self.version = version
+ }
+
+ public static func ==(lhs: WatchRunningTasks, rhs: WatchRunningTasks) -> Bool {
+ return lhs.running == rhs.running && lhs.version == rhs.version
+ }
+}
+
+public protocol WatchManager: class {
+ var watchAppInstalled: Signal { get }
+ var navigateToMessageRequested: Signal { get }
+ var runningTasks: Signal { get }
+}
diff --git a/submodules/AnimationUI/Sources/FrameworkBundle.swift b/submodules/AnimationUI/Sources/FrameworkBundle.swift
index 0ff8e5a0cc..2d6a4df5c4 100644
--- a/submodules/AnimationUI/Sources/FrameworkBundle.swift
+++ b/submodules/AnimationUI/Sources/FrameworkBundle.swift
@@ -1,5 +1,4 @@
import Foundation
-import UIKit
private class FrameworkBundleClass: NSObject {
}
diff --git a/submodules/AvatarNode/AvatarNode_Xcode.xcodeproj/project.pbxproj b/submodules/AvatarNode/AvatarNode_Xcode.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..ecbd956d77
--- /dev/null
+++ b/submodules/AvatarNode/AvatarNode_Xcode.xcodeproj/project.pbxproj
@@ -0,0 +1,571 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 50;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ D0879AF722F7079F00C4D6B3 /* AvatarNode.h in Headers */ = {isa = PBXBuildFile; fileRef = D0879AF522F7079F00C4D6B3 /* AvatarNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ D0879B0222F7087800C4D6B3 /* AvatarNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B0122F7087800C4D6B3 /* AvatarNode.swift */; };
+ D0879B0522F7087F00C4D6B3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879B0422F7087F00C4D6B3 /* Foundation.framework */; };
+ D0879B0722F7088400C4D6B3 /* Postbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879B0622F7088400C4D6B3 /* Postbox.framework */; };
+ D0879B0922F7088700C4D6B3 /* TelegramCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879B0822F7088700C4D6B3 /* TelegramCore.framework */; };
+ D0879B0B22F7088B00C4D6B3 /* AsyncDisplayKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879B0A22F7088B00C4D6B3 /* AsyncDisplayKit.framework */; };
+ D0879B0D22F7088F00C4D6B3 /* Display.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879B0C22F7088F00C4D6B3 /* Display.framework */; };
+ D0879B0F22F7089400C4D6B3 /* TelegramPresentationData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879B0E22F7089400C4D6B3 /* TelegramPresentationData.framework */; };
+ D0879B1522F70BAF00C4D6B3 /* PeerAvatar.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B1422F70BAF00C4D6B3 /* PeerAvatar.swift */; };
+ D0879B1722F70BFB00C4D6B3 /* FrameworkBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879B1622F70BFB00C4D6B3 /* FrameworkBundle.swift */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ D0879AF222F7079F00C4D6B3 /* AvatarNode.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AvatarNode.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879AF522F7079F00C4D6B3 /* AvatarNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AvatarNode.h; sourceTree = ""; };
+ D0879AF622F7079F00C4D6B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ D0879B0122F7087800C4D6B3 /* AvatarNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AvatarNode.swift; sourceTree = ""; };
+ D0879B0422F7087F00C4D6B3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ D0879B0622F7088400C4D6B3 /* Postbox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Postbox.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879B0822F7088700C4D6B3 /* TelegramCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879B0A22F7088B00C4D6B3 /* AsyncDisplayKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = AsyncDisplayKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879B0C22F7088F00C4D6B3 /* Display.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Display.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879B0E22F7089400C4D6B3 /* TelegramPresentationData.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramPresentationData.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879B1422F70BAF00C4D6B3 /* PeerAvatar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PeerAvatar.swift; sourceTree = ""; };
+ D0879B1622F70BFB00C4D6B3 /* FrameworkBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrameworkBundle.swift; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ D0879AEF22F7079F00C4D6B3 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879B0F22F7089400C4D6B3 /* TelegramPresentationData.framework in Frameworks */,
+ D0879B0D22F7088F00C4D6B3 /* Display.framework in Frameworks */,
+ D0879B0B22F7088B00C4D6B3 /* AsyncDisplayKit.framework in Frameworks */,
+ D0879B0922F7088700C4D6B3 /* TelegramCore.framework in Frameworks */,
+ D0879B0722F7088400C4D6B3 /* Postbox.framework in Frameworks */,
+ D0879B0522F7087F00C4D6B3 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ D0879AE822F7079F00C4D6B3 = {
+ isa = PBXGroup;
+ children = (
+ D0879AF622F7079F00C4D6B3 /* Info.plist */,
+ D0879AF422F7079F00C4D6B3 /* Sources */,
+ D0879AF322F7079F00C4D6B3 /* Products */,
+ D0879B0322F7087F00C4D6B3 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ D0879AF322F7079F00C4D6B3 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ D0879AF222F7079F00C4D6B3 /* AvatarNode.framework */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ D0879AF422F7079F00C4D6B3 /* Sources */ = {
+ isa = PBXGroup;
+ children = (
+ D0879B1422F70BAF00C4D6B3 /* PeerAvatar.swift */,
+ D0879B0122F7087800C4D6B3 /* AvatarNode.swift */,
+ D0879B1622F70BFB00C4D6B3 /* FrameworkBundle.swift */,
+ D0879AF522F7079F00C4D6B3 /* AvatarNode.h */,
+ );
+ path = Sources;
+ sourceTree = "";
+ };
+ D0879B0322F7087F00C4D6B3 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ D0879B0E22F7089400C4D6B3 /* TelegramPresentationData.framework */,
+ D0879B0C22F7088F00C4D6B3 /* Display.framework */,
+ D0879B0A22F7088B00C4D6B3 /* AsyncDisplayKit.framework */,
+ D0879B0822F7088700C4D6B3 /* TelegramCore.framework */,
+ D0879B0622F7088400C4D6B3 /* Postbox.framework */,
+ D0879B0422F7087F00C4D6B3 /* Foundation.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ D0879AED22F7079F00C4D6B3 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879AF722F7079F00C4D6B3 /* AvatarNode.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ D0879AF122F7079F00C4D6B3 /* AvatarNode */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D0879AFA22F7079F00C4D6B3 /* Build configuration list for PBXNativeTarget "AvatarNode" */;
+ buildPhases = (
+ D0879AED22F7079F00C4D6B3 /* Headers */,
+ D0879AEE22F7079F00C4D6B3 /* Sources */,
+ D0879AEF22F7079F00C4D6B3 /* Frameworks */,
+ D0879AF022F7079F00C4D6B3 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = AvatarNode;
+ productName = AvatarNode;
+ productReference = D0879AF222F7079F00C4D6B3 /* AvatarNode.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ D0879AE922F7079F00C4D6B3 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ DefaultBuildSystemTypeForWorkspace = Latest;
+ LastUpgradeCheck = 1030;
+ ORGANIZATIONNAME = "Telegram Messenger LLP";
+ TargetAttributes = {
+ D0879AF122F7079F00C4D6B3 = {
+ CreatedOnToolsVersion = 10.3;
+ LastSwiftMigration = 1030;
+ };
+ };
+ };
+ buildConfigurationList = D0879AEC22F7079F00C4D6B3 /* Build configuration list for PBXProject "AvatarNode_Xcode" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = D0879AE822F7079F00C4D6B3;
+ productRefGroup = D0879AF322F7079F00C4D6B3 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ D0879AF122F7079F00C4D6B3 /* AvatarNode */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ D0879AF022F7079F00C4D6B3 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ D0879AEE22F7079F00C4D6B3 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879B1522F70BAF00C4D6B3 /* PeerAvatar.swift in Sources */,
+ D0879B0222F7087800C4D6B3 /* AvatarNode.swift in Sources */,
+ D0879B1722F70BFB00C4D6B3 /* FrameworkBundle.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ D0879AF822F7079F00C4D6B3 /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0879AF922F7079F00C4D6B3 /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0879AFB22F7079F00C4D6B3 /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.AvatarNode;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0879AFC22F7079F00C4D6B3 /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.AvatarNode;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0879AFD22F707BB00C4D6B3 /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugHockeyapp;
+ };
+ D0879AFE22F707BB00C4D6B3 /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.AvatarNode;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugHockeyapp;
+ };
+ D0879AFF22F707C700C4D6B3 /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+ D0879B0022F707C700C4D6B3 /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.AvatarNode;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ D0879AEC22F7079F00C4D6B3 /* Build configuration list for PBXProject "AvatarNode_Xcode" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0879AF822F7079F00C4D6B3 /* DebugAppStoreLLC */,
+ D0879AFD22F707BB00C4D6B3 /* DebugHockeyapp */,
+ D0879AF922F7079F00C4D6B3 /* ReleaseAppStoreLLC */,
+ D0879AFF22F707C700C4D6B3 /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+ D0879AFA22F7079F00C4D6B3 /* Build configuration list for PBXNativeTarget "AvatarNode" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0879AFB22F7079F00C4D6B3 /* DebugAppStoreLLC */,
+ D0879AFE22F707BB00C4D6B3 /* DebugHockeyapp */,
+ D0879AFC22F7079F00C4D6B3 /* ReleaseAppStoreLLC */,
+ D0879B0022F707C700C4D6B3 /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = D0879AE922F7079F00C4D6B3 /* Project object */;
+}
diff --git a/submodules/AvatarNode/Info.plist b/submodules/AvatarNode/Info.plist
new file mode 100644
index 0000000000..e1fe4cfb7b
--- /dev/null
+++ b/submodules/AvatarNode/Info.plist
@@ -0,0 +1,22 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ $(CURRENT_PROJECT_VERSION)
+
+
diff --git a/submodules/AvatarNode/Sources/AvatarNode.h b/submodules/AvatarNode/Sources/AvatarNode.h
new file mode 100644
index 0000000000..999cedcf3d
--- /dev/null
+++ b/submodules/AvatarNode/Sources/AvatarNode.h
@@ -0,0 +1,19 @@
+//
+// AvatarNode.h
+// AvatarNode
+//
+// Created by Peter on 8/4/19.
+// Copyright © 2019 Telegram Messenger LLP. All rights reserved.
+//
+
+#import
+
+//! Project version number for AvatarNode.
+FOUNDATION_EXPORT double AvatarNodeVersionNumber;
+
+//! Project version string for AvatarNode.
+FOUNDATION_EXPORT const unsigned char AvatarNodeVersionString[];
+
+// In this header, you should import all the public headers of your framework using statements like #import
+
+
diff --git a/submodules/TelegramUI/TelegramUI/AvatarNode.swift b/submodules/AvatarNode/Sources/AvatarNode.swift
similarity index 99%
rename from submodules/TelegramUI/TelegramUI/AvatarNode.swift
rename to submodules/AvatarNode/Sources/AvatarNode.swift
index 69200b7cd5..ce9632d16f 100644
--- a/submodules/TelegramUI/TelegramUI/AvatarNode.swift
+++ b/submodules/AvatarNode/Sources/AvatarNode.swift
@@ -160,7 +160,7 @@ public final class AvatarEditOverlayNode: ASDisplayNode {
}
public final class AvatarNode: ASDisplayNode {
- var font: UIFont {
+ public var font: UIFont {
didSet {
if oldValue !== font {
if let parameters = self.parameters {
@@ -176,10 +176,10 @@ public final class AvatarNode: ASDisplayNode {
private var parameters: AvatarNodeParameters?
private var theme: PresentationTheme?
private var overrideImage: AvatarNodeImageOverride?
- let imageNode: ImageNode
+ public let imageNode: ImageNode
private var animationBackgroundNode: ImageNode?
private var animationNode: AnimationNode?
- var editOverlayNode: AvatarEditOverlayNode?
+ public var editOverlayNode: AvatarEditOverlayNode?
private let imageReadyDisposable = MetaDisposable()
private var state: AvatarNodeState = .empty
@@ -540,7 +540,7 @@ public final class AvatarNode: ASDisplayNode {
}
}
-func drawPeerAvatarLetters(context: CGContext, size: CGSize, font: UIFont, letters: [String], accountPeerId: PeerId, peerId: PeerId) {
+public func drawPeerAvatarLetters(context: CGContext, size: CGSize, font: UIFont, letters: [String], accountPeerId: PeerId, peerId: PeerId) {
context.beginPath()
context.addEllipse(in: CGRect(x: 0.0, y: 0.0, width: size.width, height:
size.height))
diff --git a/submodules/AvatarNode/Sources/FrameworkBundle.swift b/submodules/AvatarNode/Sources/FrameworkBundle.swift
new file mode 100644
index 0000000000..8ca13d7d92
--- /dev/null
+++ b/submodules/AvatarNode/Sources/FrameworkBundle.swift
@@ -0,0 +1,13 @@
+import Foundation
+import UIKit
+
+private class FrameworkBundleClass: NSObject {
+}
+
+let frameworkBundle: Bundle = Bundle(for: FrameworkBundleClass.self)
+
+extension UIImage {
+ convenience init?(bundleImageName: String) {
+ self.init(named: bundleImageName, in: frameworkBundle, compatibleWith: nil)
+ }
+}
diff --git a/submodules/TelegramUI/TelegramUI/PeerAvatar.swift b/submodules/AvatarNode/Sources/PeerAvatar.swift
similarity index 94%
rename from submodules/TelegramUI/TelegramUI/PeerAvatar.swift
rename to submodules/AvatarNode/Sources/PeerAvatar.swift
index 53f5581b2b..1e74de1103 100644
--- a/submodules/TelegramUI/TelegramUI/PeerAvatar.swift
+++ b/submodules/AvatarNode/Sources/PeerAvatar.swift
@@ -63,7 +63,7 @@ public func peerAvatarImageData(account: Account, peer: Peer, authorOfMessage: M
}
}
-func peerAvatarImage(account: Account, peer: Peer, authorOfMessage: MessageReference?, representation: TelegramMediaImageRepresentation?, displayDimensions: CGSize = CGSize(width: 60.0, height: 60.0), emptyColor: UIColor? = nil, synchronousLoad: Bool = false) -> Signal? {
+public func peerAvatarImage(account: Account, peer: Peer, authorOfMessage: MessageReference?, representation: TelegramMediaImageRepresentation?, displayDimensions: CGSize = CGSize(width: 60.0, height: 60.0), emptyColor: UIColor? = nil, synchronousLoad: Bool = false) -> Signal? {
if let imageData = peerAvatarImageData(account: account, peer: peer, authorOfMessage: authorOfMessage, representation: representation, synchronousLoad: synchronousLoad) {
return imageData
|> mapToSignal { data -> Signal in
diff --git a/submodules/DeviceLocationManager/DeviceLocationManager_Xcode.xcodeproj/project.pbxproj b/submodules/DeviceLocationManager/DeviceLocationManager_Xcode.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..45d54e8af4
--- /dev/null
+++ b/submodules/DeviceLocationManager/DeviceLocationManager_Xcode.xcodeproj/project.pbxproj
@@ -0,0 +1,557 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 50;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ D0879A0022F64CA900C4D6B3 /* DeviceLocationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = D08799FE22F64CA900C4D6B3 /* DeviceLocationManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ D0879A0B22F64DDD00C4D6B3 /* DeviceLocationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879A0A22F64DDD00C4D6B3 /* DeviceLocationManager.swift */; };
+ D0879A1022F64E5800C4D6B3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A0F22F64E5800C4D6B3 /* Foundation.framework */; };
+ D0879A1222F64E5B00C4D6B3 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A1122F64E5B00C4D6B3 /* CoreLocation.framework */; };
+ D0879A1422F64E8D00C4D6B3 /* SwiftSignalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A1322F64E8D00C4D6B3 /* SwiftSignalKit.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ D08799FB22F64CA900C4D6B3 /* DeviceLocationManager.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DeviceLocationManager.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D08799FE22F64CA900C4D6B3 /* DeviceLocationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DeviceLocationManager.h; sourceTree = ""; };
+ D08799FF22F64CA900C4D6B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ D0879A0A22F64DDD00C4D6B3 /* DeviceLocationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceLocationManager.swift; sourceTree = ""; };
+ D0879A0F22F64E5800C4D6B3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ D0879A1122F64E5B00C4D6B3 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
+ D0879A1322F64E8D00C4D6B3 /* SwiftSignalKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SwiftSignalKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A1522F64EA200C4D6B3 /* TelegramCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ D08799F822F64CA900C4D6B3 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879A1222F64E5B00C4D6B3 /* CoreLocation.framework in Frameworks */,
+ D0879A1422F64E8D00C4D6B3 /* SwiftSignalKit.framework in Frameworks */,
+ D0879A1022F64E5800C4D6B3 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ D08799F122F64CA900C4D6B3 = {
+ isa = PBXGroup;
+ children = (
+ D08799FF22F64CA900C4D6B3 /* Info.plist */,
+ D08799FD22F64CA900C4D6B3 /* Sources */,
+ D08799FC22F64CA900C4D6B3 /* Products */,
+ D0879A0E22F64E5700C4D6B3 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ D08799FC22F64CA900C4D6B3 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ D08799FB22F64CA900C4D6B3 /* DeviceLocationManager.framework */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ D08799FD22F64CA900C4D6B3 /* Sources */ = {
+ isa = PBXGroup;
+ children = (
+ D0879A0A22F64DDD00C4D6B3 /* DeviceLocationManager.swift */,
+ D08799FE22F64CA900C4D6B3 /* DeviceLocationManager.h */,
+ );
+ path = Sources;
+ sourceTree = "";
+ };
+ D0879A0E22F64E5700C4D6B3 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ D0879A1522F64EA200C4D6B3 /* TelegramCore.framework */,
+ D0879A1322F64E8D00C4D6B3 /* SwiftSignalKit.framework */,
+ D0879A1122F64E5B00C4D6B3 /* CoreLocation.framework */,
+ D0879A0F22F64E5800C4D6B3 /* Foundation.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ D08799F622F64CA900C4D6B3 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879A0022F64CA900C4D6B3 /* DeviceLocationManager.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ D08799FA22F64CA900C4D6B3 /* DeviceLocationManager */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D0879A0322F64CA900C4D6B3 /* Build configuration list for PBXNativeTarget "DeviceLocationManager" */;
+ buildPhases = (
+ D08799F622F64CA900C4D6B3 /* Headers */,
+ D08799F722F64CA900C4D6B3 /* Sources */,
+ D08799F822F64CA900C4D6B3 /* Frameworks */,
+ D08799F922F64CA900C4D6B3 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = DeviceLocationManager;
+ productName = DeviceLocationManager;
+ productReference = D08799FB22F64CA900C4D6B3 /* DeviceLocationManager.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ D08799F222F64CA900C4D6B3 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ DefaultBuildSystemTypeForWorkspace = Latest;
+ LastUpgradeCheck = 1030;
+ ORGANIZATIONNAME = "Telegram Messenger LLP";
+ TargetAttributes = {
+ D08799FA22F64CA900C4D6B3 = {
+ CreatedOnToolsVersion = 10.3;
+ LastSwiftMigration = 1030;
+ };
+ };
+ };
+ buildConfigurationList = D08799F522F64CA900C4D6B3 /* Build configuration list for PBXProject "DeviceLocationManager_Xcode" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = D08799F122F64CA900C4D6B3;
+ productRefGroup = D08799FC22F64CA900C4D6B3 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ D08799FA22F64CA900C4D6B3 /* DeviceLocationManager */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ D08799F922F64CA900C4D6B3 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ D08799F722F64CA900C4D6B3 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879A0B22F64DDD00C4D6B3 /* DeviceLocationManager.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ D0879A0122F64CA900C4D6B3 /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0879A0222F64CA900C4D6B3 /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0879A0422F64CA900C4D6B3 /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.DeviceLocationManager;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0879A0522F64CA900C4D6B3 /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.DeviceLocationManager;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0879A0622F64DA200C4D6B3 /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugHockeyapp;
+ };
+ D0879A0722F64DA200C4D6B3 /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.DeviceLocationManager;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugHockeyapp;
+ };
+ D0879A0822F64DAE00C4D6B3 /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+ D0879A0922F64DAE00C4D6B3 /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.DeviceLocationManager;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ D08799F522F64CA900C4D6B3 /* Build configuration list for PBXProject "DeviceLocationManager_Xcode" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0879A0122F64CA900C4D6B3 /* DebugAppStoreLLC */,
+ D0879A0622F64DA200C4D6B3 /* DebugHockeyapp */,
+ D0879A0222F64CA900C4D6B3 /* ReleaseAppStoreLLC */,
+ D0879A0822F64DAE00C4D6B3 /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+ D0879A0322F64CA900C4D6B3 /* Build configuration list for PBXNativeTarget "DeviceLocationManager" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0879A0422F64CA900C4D6B3 /* DebugAppStoreLLC */,
+ D0879A0722F64DA200C4D6B3 /* DebugHockeyapp */,
+ D0879A0522F64CA900C4D6B3 /* ReleaseAppStoreLLC */,
+ D0879A0922F64DAE00C4D6B3 /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = D08799F222F64CA900C4D6B3 /* Project object */;
+}
diff --git a/submodules/DeviceLocationManager/Info.plist b/submodules/DeviceLocationManager/Info.plist
new file mode 100644
index 0000000000..e1fe4cfb7b
--- /dev/null
+++ b/submodules/DeviceLocationManager/Info.plist
@@ -0,0 +1,22 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ $(CURRENT_PROJECT_VERSION)
+
+
diff --git a/submodules/DeviceLocationManager/Sources/DeviceLocationManager.h b/submodules/DeviceLocationManager/Sources/DeviceLocationManager.h
new file mode 100644
index 0000000000..56286ed2cf
--- /dev/null
+++ b/submodules/DeviceLocationManager/Sources/DeviceLocationManager.h
@@ -0,0 +1,19 @@
+//
+// DeviceLocationManager.h
+// DeviceLocationManager
+//
+// Created by Peter on 8/4/19.
+// Copyright © 2019 Telegram Messenger LLP. All rights reserved.
+//
+
+#import
+
+//! Project version number for DeviceLocationManager.
+FOUNDATION_EXPORT double DeviceLocationManagerVersionNumber;
+
+//! Project version string for DeviceLocationManager.
+FOUNDATION_EXPORT const unsigned char DeviceLocationManagerVersionString[];
+
+// In this header, you should import all the public headers of your framework using statements like #import
+
+
diff --git a/submodules/TelegramUI/TelegramUI/DeviceLocationManager.swift b/submodules/DeviceLocationManager/Sources/DeviceLocationManager.swift
similarity index 78%
rename from submodules/TelegramUI/TelegramUI/DeviceLocationManager.swift
rename to submodules/DeviceLocationManager/Sources/DeviceLocationManager.swift
index 4099490a9f..b4b052d256 100644
--- a/submodules/TelegramUI/TelegramUI/DeviceLocationManager.swift
+++ b/submodules/DeviceLocationManager/Sources/DeviceLocationManager.swift
@@ -1,9 +1,8 @@
import Foundation
import CoreLocation
import SwiftSignalKit
-import TelegramCore
-enum DeviceLocationMode: Int32 {
+public enum DeviceLocationMode: Int32 {
case precise = 0
}
@@ -29,8 +28,9 @@ private func getTopMode(subscribers: [DeviceLocationSubscriber]) -> DeviceLocati
return mode
}
-final class DeviceLocationManager: NSObject, CLLocationManagerDelegate {
+public final class DeviceLocationManager: NSObject {
private let queue: Queue
+ private let log: ((String) -> Void)?
private let manager: CLLocationManager
private var requestedAuthorization = false
@@ -41,10 +41,11 @@ final class DeviceLocationManager: NSObject, CLLocationManagerDelegate {
private var currentLocation: CLLocationCoordinate2D?
- init(queue: Queue) {
+ public init(queue: Queue, log: ((String) -> Void)? = nil) {
assert(queue.isCurrent())
self.queue = queue
+ self.log = log
self.manager = CLLocationManager()
super.init()
@@ -59,7 +60,7 @@ final class DeviceLocationManager: NSObject, CLLocationManagerDelegate {
self.manager.pausesLocationUpdatesAutomatically = false
}
- func push(mode: DeviceLocationMode, updated: @escaping (CLLocationCoordinate2D) -> Void) -> Disposable {
+ public func push(mode: DeviceLocationMode, updated: @escaping (CLLocationCoordinate2D) -> Void) -> Disposable {
assert(self.queue.isCurrent())
let id = self.nextSubscriberId
@@ -99,7 +100,7 @@ final class DeviceLocationManager: NSObject, CLLocationManagerDelegate {
if topMode != previousTopMode {
self.currentTopMode = topMode
if let topMode = topMode {
- Logger.shared.log("DeviceLocation", "setting mode \(topMode)")
+ self.log?("setting mode \(topMode)")
if previousTopMode == nil {
if !self.requestedAuthorization {
self.requestedAuthorization = true
@@ -110,12 +111,14 @@ final class DeviceLocationManager: NSObject, CLLocationManagerDelegate {
} else {
self.currentLocation = nil
self.manager.stopUpdatingLocation()
- Logger.shared.log("DeviceLocation", "stopped")
+ self.log?("stopped")
}
}
}
-
- func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
+}
+
+extension DeviceLocationManager: CLLocationManagerDelegate {
+ public func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
assert(self.queue.isCurrent())
if let location = locations.first {
@@ -129,13 +132,16 @@ final class DeviceLocationManager: NSObject, CLLocationManagerDelegate {
}
}
-func currentLocationManagerCoordinate(manager: DeviceLocationManager, timeout timeoutValue: Double) -> Signal {
- return (Signal { subscriber in
- let disposable = manager.push(mode: .precise, updated: { coordinate in
- subscriber.putNext(coordinate)
- subscriber.putCompletion()
- })
- return disposable
- } |> runOn(Queue.mainQueue()))
+public func currentLocationManagerCoordinate(manager: DeviceLocationManager, timeout timeoutValue: Double) -> Signal {
+ return (
+ Signal { subscriber in
+ let disposable = manager.push(mode: .precise, updated: { coordinate in
+ subscriber.putNext(coordinate)
+ subscriber.putCompletion()
+ })
+ return disposable
+ }
+ |> runOn(Queue.mainQueue())
+ )
|> timeout(timeoutValue, queue: Queue.mainQueue(), alternate: .single(nil))
}
diff --git a/submodules/Display/Display/Accessibility.swift b/submodules/Display/Display/Accessibility.swift
index cdda8f2de8..5127c84ca3 100644
--- a/submodules/Display/Display/Accessibility.swift
+++ b/submodules/Display/Display/Accessibility.swift
@@ -1,6 +1,7 @@
import Foundation
import UIKit
import AsyncDisplayKit
+import SwiftSignalKit
public func addAccessibilityChildren(of node: ASDisplayNode, container: Any, to list: inout [Any]) {
if node.isAccessibilityElement {
@@ -19,3 +20,43 @@ public func addAccessibilityChildren(of node: ASDisplayNode, container: Any, to
}
}
+public func smartInvertColorsEnabled() -> Bool {
+ if #available(iOSApplicationExtension 11.0, iOS 11.0, *), UIAccessibility.isInvertColorsEnabled {
+ return true
+ } else {
+ return false
+ }
+}
+
+public func reduceMotionEnabled() -> Signal {
+ return Signal { subscriber in
+ subscriber.putNext(UIAccessibility.isReduceMotionEnabled)
+
+ let observer = NotificationCenter.default.addObserver(forName: UIAccessibility.reduceMotionStatusDidChangeNotification, object: nil, queue: .main, using: { _ in
+ subscriber.putNext(UIAccessibility.isReduceMotionEnabled)
+ })
+
+ return ActionDisposable {
+ Queue.mainQueue().async {
+ NotificationCenter.default.removeObserver(observer)
+ }
+ }
+ } |> runOn(Queue.mainQueue())
+}
+
+func boldTextEnabled() -> Signal {
+ return Signal { subscriber in
+ subscriber.putNext(UIAccessibility.isBoldTextEnabled)
+
+ let observer = NotificationCenter.default.addObserver(forName: UIAccessibility.boldTextStatusDidChangeNotification, object: nil, queue: .main, using: { _ in
+ subscriber.putNext(UIAccessibility.isBoldTextEnabled)
+ })
+
+ return ActionDisposable {
+ Queue.mainQueue().async {
+ NotificationCenter.default.removeObserver(observer)
+ }
+ }
+ }
+ |> runOn(Queue.mainQueue())
+}
diff --git a/submodules/ItemListUI/Sources/ItemListController.swift b/submodules/ItemListUI/Sources/ItemListController.swift
index ec1af48c4c..20edf03b49 100644
--- a/submodules/ItemListUI/Sources/ItemListController.swift
+++ b/submodules/ItemListUI/Sources/ItemListController.swift
@@ -212,7 +212,7 @@ open class ItemListController: ViewController, KeyShor
public var didDisappear: ((Bool) -> Void)?
convenience public init(context: AccountContext, state: Signal<(ItemListControllerState, (ItemListNodeState, Entry.ItemGenerationArguments)), NoError>, tabBarItem: Signal? = nil) {
- self.init(sharedContext: context.genericSharedContext, state: state, tabBarItem: tabBarItem)
+ self.init(sharedContext: context.sharedContext, state: state, tabBarItem: tabBarItem)
}
convenience public init(sharedContext: SharedAccountContext, state: Signal<(ItemListControllerState, (ItemListNodeState, Entry.ItemGenerationArguments)), NoError>, tabBarItem: Signal? = nil) {
diff --git a/submodules/LiveLocationManager/Info.plist b/submodules/LiveLocationManager/Info.plist
new file mode 100644
index 0000000000..e1fe4cfb7b
--- /dev/null
+++ b/submodules/LiveLocationManager/Info.plist
@@ -0,0 +1,22 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ $(CURRENT_PROJECT_VERSION)
+
+
diff --git a/submodules/LiveLocationManager/LiveLocationManager_Xcode.xcodeproj/project.pbxproj b/submodules/LiveLocationManager/LiveLocationManager_Xcode.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..a355886f74
--- /dev/null
+++ b/submodules/LiveLocationManager/LiveLocationManager_Xcode.xcodeproj/project.pbxproj
@@ -0,0 +1,571 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 50;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ D0879A2822F64F6E00C4D6B3 /* LiveLocationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = D0879A2622F64F6E00C4D6B3 /* LiveLocationManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ D0879A3422F64FED00C4D6B3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A3322F64FED00C4D6B3 /* Foundation.framework */; };
+ D0879A3622F64FF800C4D6B3 /* Postbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A3522F64FF800C4D6B3 /* Postbox.framework */; };
+ D0879A3822F64FFD00C4D6B3 /* TelegramCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A3722F64FFD00C4D6B3 /* TelegramCore.framework */; };
+ D0879A3A22F6500900C4D6B3 /* SwiftSignalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A3922F6500900C4D6B3 /* SwiftSignalKit.framework */; };
+ D0879A3C22F6500F00C4D6B3 /* DeviceLocationManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A3B22F6500F00C4D6B3 /* DeviceLocationManager.framework */; };
+ D0879A3F22F6502600C4D6B3 /* LiveLocationSummaryManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879A3D22F6502500C4D6B3 /* LiveLocationSummaryManager.swift */; };
+ D0879A4022F6502600C4D6B3 /* LiveLocationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879A3E22F6502600C4D6B3 /* LiveLocationManager.swift */; };
+ D0879A4422F6504800C4D6B3 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A4322F6504800C4D6B3 /* CoreLocation.framework */; };
+ D0879A4822F6533900C4D6B3 /* AccountContext.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A4722F6533900C4D6B3 /* AccountContext.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ D0879A2322F64F6E00C4D6B3 /* LiveLocationManager.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LiveLocationManager.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A2622F64F6E00C4D6B3 /* LiveLocationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LiveLocationManager.h; sourceTree = ""; };
+ D0879A2722F64F6E00C4D6B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ D0879A3322F64FED00C4D6B3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ D0879A3522F64FF800C4D6B3 /* Postbox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Postbox.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A3722F64FFD00C4D6B3 /* TelegramCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A3922F6500900C4D6B3 /* SwiftSignalKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SwiftSignalKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A3B22F6500F00C4D6B3 /* DeviceLocationManager.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = DeviceLocationManager.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A3D22F6502500C4D6B3 /* LiveLocationSummaryManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveLocationSummaryManager.swift; sourceTree = ""; };
+ D0879A3E22F6502600C4D6B3 /* LiveLocationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveLocationManager.swift; sourceTree = ""; };
+ D0879A4322F6504800C4D6B3 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
+ D0879A4722F6533900C4D6B3 /* AccountContext.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = AccountContext.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ D0879A2022F64F6E00C4D6B3 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879A4822F6533900C4D6B3 /* AccountContext.framework in Frameworks */,
+ D0879A4422F6504800C4D6B3 /* CoreLocation.framework in Frameworks */,
+ D0879A3C22F6500F00C4D6B3 /* DeviceLocationManager.framework in Frameworks */,
+ D0879A3A22F6500900C4D6B3 /* SwiftSignalKit.framework in Frameworks */,
+ D0879A3822F64FFD00C4D6B3 /* TelegramCore.framework in Frameworks */,
+ D0879A3622F64FF800C4D6B3 /* Postbox.framework in Frameworks */,
+ D0879A3422F64FED00C4D6B3 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ D0879A1922F64F6E00C4D6B3 = {
+ isa = PBXGroup;
+ children = (
+ D0879A2722F64F6E00C4D6B3 /* Info.plist */,
+ D0879A2522F64F6E00C4D6B3 /* Sources */,
+ D0879A2422F64F6E00C4D6B3 /* Products */,
+ D0879A3222F64FED00C4D6B3 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ D0879A2422F64F6E00C4D6B3 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ D0879A2322F64F6E00C4D6B3 /* LiveLocationManager.framework */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ D0879A2522F64F6E00C4D6B3 /* Sources */ = {
+ isa = PBXGroup;
+ children = (
+ D0879A3E22F6502600C4D6B3 /* LiveLocationManager.swift */,
+ D0879A3D22F6502500C4D6B3 /* LiveLocationSummaryManager.swift */,
+ D0879A2622F64F6E00C4D6B3 /* LiveLocationManager.h */,
+ );
+ path = Sources;
+ sourceTree = "";
+ };
+ D0879A3222F64FED00C4D6B3 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ D0879A4722F6533900C4D6B3 /* AccountContext.framework */,
+ D0879A4322F6504800C4D6B3 /* CoreLocation.framework */,
+ D0879A3B22F6500F00C4D6B3 /* DeviceLocationManager.framework */,
+ D0879A3922F6500900C4D6B3 /* SwiftSignalKit.framework */,
+ D0879A3722F64FFD00C4D6B3 /* TelegramCore.framework */,
+ D0879A3522F64FF800C4D6B3 /* Postbox.framework */,
+ D0879A3322F64FED00C4D6B3 /* Foundation.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ D0879A1E22F64F6E00C4D6B3 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879A2822F64F6E00C4D6B3 /* LiveLocationManager.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ D0879A2222F64F6E00C4D6B3 /* LiveLocationManager */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D0879A2B22F64F6E00C4D6B3 /* Build configuration list for PBXNativeTarget "LiveLocationManager" */;
+ buildPhases = (
+ D0879A1E22F64F6E00C4D6B3 /* Headers */,
+ D0879A1F22F64F6E00C4D6B3 /* Sources */,
+ D0879A2022F64F6E00C4D6B3 /* Frameworks */,
+ D0879A2122F64F6E00C4D6B3 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = LiveLocationManager;
+ productName = LiveLocationManager;
+ productReference = D0879A2322F64F6E00C4D6B3 /* LiveLocationManager.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ D0879A1A22F64F6E00C4D6B3 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ DefaultBuildSystemTypeForWorkspace = Latest;
+ LastUpgradeCheck = 1030;
+ ORGANIZATIONNAME = "Telegram Messenger LLP";
+ TargetAttributes = {
+ D0879A2222F64F6E00C4D6B3 = {
+ CreatedOnToolsVersion = 10.3;
+ LastSwiftMigration = 1030;
+ };
+ };
+ };
+ buildConfigurationList = D0879A1D22F64F6E00C4D6B3 /* Build configuration list for PBXProject "LiveLocationManager_Xcode" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = D0879A1922F64F6E00C4D6B3;
+ productRefGroup = D0879A2422F64F6E00C4D6B3 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ D0879A2222F64F6E00C4D6B3 /* LiveLocationManager */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ D0879A2122F64F6E00C4D6B3 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ D0879A1F22F64F6E00C4D6B3 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879A4022F6502600C4D6B3 /* LiveLocationManager.swift in Sources */,
+ D0879A3F22F6502600C4D6B3 /* LiveLocationSummaryManager.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ D0879A2922F64F6E00C4D6B3 /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0879A2A22F64F6E00C4D6B3 /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0879A2C22F64F6E00C4D6B3 /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.LiveLocationManager;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0879A2D22F64F6E00C4D6B3 /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.LiveLocationManager;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0879A2E22F64F9A00C4D6B3 /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugHockeyapp;
+ };
+ D0879A2F22F64F9A00C4D6B3 /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.LiveLocationManager;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugHockeyapp;
+ };
+ D0879A3022F64FA700C4D6B3 /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+ D0879A3122F64FA700C4D6B3 /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.LiveLocationManager;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ D0879A1D22F64F6E00C4D6B3 /* Build configuration list for PBXProject "LiveLocationManager_Xcode" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0879A2922F64F6E00C4D6B3 /* DebugAppStoreLLC */,
+ D0879A2E22F64F9A00C4D6B3 /* DebugHockeyapp */,
+ D0879A2A22F64F6E00C4D6B3 /* ReleaseAppStoreLLC */,
+ D0879A3022F64FA700C4D6B3 /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+ D0879A2B22F64F6E00C4D6B3 /* Build configuration list for PBXNativeTarget "LiveLocationManager" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0879A2C22F64F6E00C4D6B3 /* DebugAppStoreLLC */,
+ D0879A2F22F64F9A00C4D6B3 /* DebugHockeyapp */,
+ D0879A2D22F64F6E00C4D6B3 /* ReleaseAppStoreLLC */,
+ D0879A3122F64FA700C4D6B3 /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = D0879A1A22F64F6E00C4D6B3 /* Project object */;
+}
diff --git a/submodules/LiveLocationManager/Sources/LiveLocationManager.h b/submodules/LiveLocationManager/Sources/LiveLocationManager.h
new file mode 100644
index 0000000000..e679dc36ad
--- /dev/null
+++ b/submodules/LiveLocationManager/Sources/LiveLocationManager.h
@@ -0,0 +1,19 @@
+//
+// LiveLocationManager.h
+// LiveLocationManager
+//
+// Created by Peter on 8/4/19.
+// Copyright © 2019 Telegram Messenger LLP. All rights reserved.
+//
+
+#import
+
+//! Project version number for LiveLocationManager.
+FOUNDATION_EXPORT double LiveLocationManagerVersionNumber;
+
+//! Project version string for LiveLocationManager.
+FOUNDATION_EXPORT const unsigned char LiveLocationManagerVersionString[];
+
+// In this header, you should import all the public headers of your framework using statements like #import
+
+
diff --git a/submodules/TelegramUI/TelegramUI/LiveLocationManager.swift b/submodules/LiveLocationManager/Sources/LiveLocationManager.swift
similarity index 93%
rename from submodules/TelegramUI/TelegramUI/LiveLocationManager.swift
rename to submodules/LiveLocationManager/Sources/LiveLocationManager.swift
index 51fbc71b86..d63f359847 100644
--- a/submodules/TelegramUI/TelegramUI/LiveLocationManager.swift
+++ b/submodules/LiveLocationManager/Sources/LiveLocationManager.swift
@@ -3,8 +3,10 @@ import TelegramCore
import Postbox
import SwiftSignalKit
import CoreLocation
+import DeviceLocationManager
+import AccountContext
-public final class LiveLocationManager {
+public final class LiveLocationManagerImpl: LiveLocationManager {
private let queue = Queue.mainQueue()
private let postbox: Postbox
@@ -12,7 +14,10 @@ public final class LiveLocationManager {
private let stateManager: AccountStateManager
private let locationManager: DeviceLocationManager
- let summaryManager: LiveLocationSummaryManager
+ private let summaryManagerImpl: LiveLocationSummaryManagerImpl
+ public var summaryManager: LiveLocationSummaryManager {
+ return self.summaryManagerImpl
+ }
private var requiredLocationTypeDisposable: Disposable?
private let hasActiveMessagesToBroadcast = ValuePromise(false, ignoreRepeated: true)
@@ -37,13 +42,13 @@ public final class LiveLocationManager {
private var invalidationTimer: (SwiftSignalKit.Timer, Int32)?
- init(postbox: Postbox, network: Network, accountPeerId: PeerId, viewTracker: AccountViewTracker, stateManager: AccountStateManager, locationManager: DeviceLocationManager, inForeground: Signal) {
+ public init(postbox: Postbox, network: Network, accountPeerId: PeerId, viewTracker: AccountViewTracker, stateManager: AccountStateManager, locationManager: DeviceLocationManager, inForeground: Signal) {
self.postbox = postbox
self.network = network
self.stateManager = stateManager
self.locationManager = locationManager
- self.summaryManager = LiveLocationSummaryManager(queue: self.queue, postbox: postbox, accountPeerId: accountPeerId, viewTracker: viewTracker)
+ self.summaryManagerImpl = LiveLocationSummaryManagerImpl(queue: self.queue, postbox: postbox, accountPeerId: accountPeerId, viewTracker: viewTracker)
let viewKey: PostboxViewKey = .localMessageTag(.OutgoingLiveLocation)
self.messagesDisposable = (postbox.combinedView(keys: [viewKey])
@@ -130,7 +135,7 @@ public final class LiveLocationManager {
let validBroadcastToMessageIds = Set(broadcastToMessageIds.keys)
if self.broadcastToMessageIds != broadcastToMessageIds {
- self.summaryManager.update(messageIds: validBroadcastToMessageIds)
+ self.summaryManagerImpl.update(messageIds: validBroadcastToMessageIds)
}
let wasEmpty = self.broadcastToMessageIds.isEmpty
@@ -225,7 +230,7 @@ public final class LiveLocationManager {
}
}
- func cancelLiveLocation(peerId: PeerId) {
+ public func cancelLiveLocation(peerId: PeerId) {
assert(self.queue.isCurrent())
let ids = self.broadcastToMessageIds.keys.filter({ $0.peerId == peerId })
@@ -257,7 +262,7 @@ public final class LiveLocationManager {
}
}
- func internalMessageForPeerId(_ peerId: PeerId) -> MessageId? {
+ public func internalMessageForPeerId(_ peerId: PeerId) -> MessageId? {
for id in self.broadcastToMessageIds.keys {
if id.peerId == peerId {
return id
diff --git a/submodules/TelegramUI/TelegramUI/LiveLocationSummaryManager.swift b/submodules/LiveLocationManager/Sources/LiveLocationSummaryManager.swift
similarity index 96%
rename from submodules/TelegramUI/TelegramUI/LiveLocationSummaryManager.swift
rename to submodules/LiveLocationManager/Sources/LiveLocationSummaryManager.swift
index 7b4c33a703..0918406d93 100644
--- a/submodules/TelegramUI/TelegramUI/LiveLocationSummaryManager.swift
+++ b/submodules/LiveLocationManager/Sources/LiveLocationSummaryManager.swift
@@ -2,6 +2,7 @@ import Foundation
import Postbox
import TelegramCore
import SwiftSignalKit
+import AccountContext
private final class LiveLocationSummaryContext {
private let queue: Queue
@@ -183,7 +184,7 @@ private final class LiveLocationPeerSummaryContext {
}
}
-final class LiveLocationSummaryManager {
+public final class LiveLocationSummaryManagerImpl: LiveLocationSummaryManager {
private let queue: Queue
private let postbox: Postbox
private let accountPeerId: PeerId
@@ -226,11 +227,11 @@ final class LiveLocationSummaryManager {
self.globalContext.messageIds = messageIds
}
- func broadcastingToMessages() -> Signal<[MessageId: Message], NoError> {
+ public func broadcastingToMessages() -> Signal<[MessageId: Message], NoError> {
return self.globalContext.subscribe()
}
- func peersBroadcastingTo(peerId: PeerId) -> Signal<[(Peer, Message)]?, NoError> {
+ public func peersBroadcastingTo(peerId: PeerId) -> Signal<[(Peer, Message)]?, NoError> {
let queue = self.queue
return Signal { [weak self] subscriber in
let disposable = MetaDisposable()
diff --git a/submodules/LiveLocationTimerNode/Info.plist b/submodules/LiveLocationTimerNode/Info.plist
new file mode 100644
index 0000000000..e1fe4cfb7b
--- /dev/null
+++ b/submodules/LiveLocationTimerNode/Info.plist
@@ -0,0 +1,22 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ $(CURRENT_PROJECT_VERSION)
+
+
diff --git a/submodules/LiveLocationTimerNode/LiveLocationTimerNode_Xcode.xcodeproj/project.pbxproj b/submodules/LiveLocationTimerNode/LiveLocationTimerNode_Xcode.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..3192c861ff
--- /dev/null
+++ b/submodules/LiveLocationTimerNode/LiveLocationTimerNode_Xcode.xcodeproj/project.pbxproj
@@ -0,0 +1,559 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 50;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ D0879A8822F6F91000C4D6B3 /* LiveLocationTimerNode.h in Headers */ = {isa = PBXBuildFile; fileRef = D0879A8622F6F91000C4D6B3 /* LiveLocationTimerNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ D0879A9322F6FA2300C4D6B3 /* ChatMessageLiveLocationTimerNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879A9222F6FA2300C4D6B3 /* ChatMessageLiveLocationTimerNode.swift */; };
+ D0879A9622F6FA8600C4D6B3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A9522F6FA8600C4D6B3 /* Foundation.framework */; };
+ D0879A9822F6FA8900C4D6B3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A9722F6FA8900C4D6B3 /* UIKit.framework */; };
+ D0879A9A22F6FA9300C4D6B3 /* AsyncDisplayKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A9922F6FA9300C4D6B3 /* AsyncDisplayKit.framework */; };
+ D0879A9C22F6FA9800C4D6B3 /* Display.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A9B22F6FA9800C4D6B3 /* Display.framework */; };
+ D0879A9E22F6FA9E00C4D6B3 /* TelegramPresentationData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A9D22F6FA9E00C4D6B3 /* TelegramPresentationData.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ D0879A8322F6F91000C4D6B3 /* LiveLocationTimerNode.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LiveLocationTimerNode.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A8622F6F91000C4D6B3 /* LiveLocationTimerNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LiveLocationTimerNode.h; sourceTree = ""; };
+ D0879A8722F6F91000C4D6B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ D0879A9222F6FA2300C4D6B3 /* ChatMessageLiveLocationTimerNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChatMessageLiveLocationTimerNode.swift; sourceTree = ""; };
+ D0879A9522F6FA8600C4D6B3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ D0879A9722F6FA8900C4D6B3 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ D0879A9922F6FA9300C4D6B3 /* AsyncDisplayKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = AsyncDisplayKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A9B22F6FA9800C4D6B3 /* Display.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Display.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A9D22F6FA9E00C4D6B3 /* TelegramPresentationData.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramPresentationData.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ D0879A8022F6F91000C4D6B3 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879A9E22F6FA9E00C4D6B3 /* TelegramPresentationData.framework in Frameworks */,
+ D0879A9C22F6FA9800C4D6B3 /* Display.framework in Frameworks */,
+ D0879A9A22F6FA9300C4D6B3 /* AsyncDisplayKit.framework in Frameworks */,
+ D0879A9822F6FA8900C4D6B3 /* UIKit.framework in Frameworks */,
+ D0879A9622F6FA8600C4D6B3 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ D0879A7922F6F91000C4D6B3 = {
+ isa = PBXGroup;
+ children = (
+ D0879A8722F6F91000C4D6B3 /* Info.plist */,
+ D0879A8522F6F91000C4D6B3 /* Sources */,
+ D0879A8422F6F91000C4D6B3 /* Products */,
+ D0879A9422F6FA8600C4D6B3 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ D0879A8422F6F91000C4D6B3 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ D0879A8322F6F91000C4D6B3 /* LiveLocationTimerNode.framework */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ D0879A8522F6F91000C4D6B3 /* Sources */ = {
+ isa = PBXGroup;
+ children = (
+ D0879A9222F6FA2300C4D6B3 /* ChatMessageLiveLocationTimerNode.swift */,
+ D0879A8622F6F91000C4D6B3 /* LiveLocationTimerNode.h */,
+ );
+ path = Sources;
+ sourceTree = "";
+ };
+ D0879A9422F6FA8600C4D6B3 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ D0879A9D22F6FA9E00C4D6B3 /* TelegramPresentationData.framework */,
+ D0879A9B22F6FA9800C4D6B3 /* Display.framework */,
+ D0879A9922F6FA9300C4D6B3 /* AsyncDisplayKit.framework */,
+ D0879A9722F6FA8900C4D6B3 /* UIKit.framework */,
+ D0879A9522F6FA8600C4D6B3 /* Foundation.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ D0879A7E22F6F91000C4D6B3 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879A8822F6F91000C4D6B3 /* LiveLocationTimerNode.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ D0879A8222F6F91000C4D6B3 /* LiveLocationTimerNode */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D0879A8B22F6F91000C4D6B3 /* Build configuration list for PBXNativeTarget "LiveLocationTimerNode" */;
+ buildPhases = (
+ D0879A7E22F6F91000C4D6B3 /* Headers */,
+ D0879A7F22F6F91000C4D6B3 /* Sources */,
+ D0879A8022F6F91000C4D6B3 /* Frameworks */,
+ D0879A8122F6F91000C4D6B3 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = LiveLocationTimerNode;
+ productName = LiveLocationTimerNode;
+ productReference = D0879A8322F6F91000C4D6B3 /* LiveLocationTimerNode.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ D0879A7A22F6F91000C4D6B3 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ DefaultBuildSystemTypeForWorkspace = Latest;
+ LastUpgradeCheck = 1030;
+ ORGANIZATIONNAME = "Telegram Messenger LLP";
+ TargetAttributes = {
+ D0879A8222F6F91000C4D6B3 = {
+ CreatedOnToolsVersion = 10.3;
+ LastSwiftMigration = 1030;
+ };
+ };
+ };
+ buildConfigurationList = D0879A7D22F6F91000C4D6B3 /* Build configuration list for PBXProject "LiveLocationTimerNode_Xcode" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = D0879A7922F6F91000C4D6B3;
+ productRefGroup = D0879A8422F6F91000C4D6B3 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ D0879A8222F6F91000C4D6B3 /* LiveLocationTimerNode */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ D0879A8122F6F91000C4D6B3 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ D0879A7F22F6F91000C4D6B3 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879A9322F6FA2300C4D6B3 /* ChatMessageLiveLocationTimerNode.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ D0879A8922F6F91000C4D6B3 /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0879A8A22F6F91000C4D6B3 /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0879A8C22F6F91000C4D6B3 /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.LiveLocationTimerNode;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0879A8D22F6F91000C4D6B3 /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.LiveLocationTimerNode;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0879A8E22F6F92E00C4D6B3 /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugHockeyapp;
+ };
+ D0879A8F22F6F92E00C4D6B3 /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.LiveLocationTimerNode;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugHockeyapp;
+ };
+ D0879A9022F6F93B00C4D6B3 /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+ D0879A9122F6F93B00C4D6B3 /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.LiveLocationTimerNode;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ D0879A7D22F6F91000C4D6B3 /* Build configuration list for PBXProject "LiveLocationTimerNode_Xcode" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0879A8922F6F91000C4D6B3 /* DebugAppStoreLLC */,
+ D0879A8E22F6F92E00C4D6B3 /* DebugHockeyapp */,
+ D0879A8A22F6F91000C4D6B3 /* ReleaseAppStoreLLC */,
+ D0879A9022F6F93B00C4D6B3 /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+ D0879A8B22F6F91000C4D6B3 /* Build configuration list for PBXNativeTarget "LiveLocationTimerNode" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0879A8C22F6F91000C4D6B3 /* DebugAppStoreLLC */,
+ D0879A8F22F6F92E00C4D6B3 /* DebugHockeyapp */,
+ D0879A8D22F6F91000C4D6B3 /* ReleaseAppStoreLLC */,
+ D0879A9122F6F93B00C4D6B3 /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = D0879A7A22F6F91000C4D6B3 /* Project object */;
+}
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageLiveLocationTimerNode.swift b/submodules/LiveLocationTimerNode/Sources/ChatMessageLiveLocationTimerNode.swift
similarity index 98%
rename from submodules/TelegramUI/TelegramUI/ChatMessageLiveLocationTimerNode.swift
rename to submodules/LiveLocationTimerNode/Sources/ChatMessageLiveLocationTimerNode.swift
index f710ba497a..eb11af5b82 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageLiveLocationTimerNode.swift
+++ b/submodules/LiveLocationTimerNode/Sources/ChatMessageLiveLocationTimerNode.swift
@@ -37,11 +37,11 @@ private final class RadialTimeoutNodeTimer: NSObject {
}
}
-final class ChatMessageLiveLocationTimerNode: ASDisplayNode {
+public final class ChatMessageLiveLocationTimerNode: ASDisplayNode {
private var timeoutAndColors: (UIColor, UIColor, UIColor, Double, Double, PresentationStrings)?
private var animationTimer: Timer?
- override init() {
+ override public init() {
super.init()
self.isOpaque = false
diff --git a/submodules/LiveLocationTimerNode/Sources/LiveLocationTimerNode.h b/submodules/LiveLocationTimerNode/Sources/LiveLocationTimerNode.h
new file mode 100644
index 0000000000..278ea3e891
--- /dev/null
+++ b/submodules/LiveLocationTimerNode/Sources/LiveLocationTimerNode.h
@@ -0,0 +1,19 @@
+//
+// LiveLocationTimerNode.h
+// LiveLocationTimerNode
+//
+// Created by Peter on 8/4/19.
+// Copyright © 2019 Telegram Messenger LLP. All rights reserved.
+//
+
+#import
+
+//! Project version number for LiveLocationTimerNode.
+FOUNDATION_EXPORT double LiveLocationTimerNodeVersionNumber;
+
+//! Project version string for LiveLocationTimerNode.
+FOUNDATION_EXPORT const unsigned char LiveLocationTimerNodeVersionString[];
+
+// In this header, you should import all the public headers of your framework using statements like #import
+
+
diff --git a/submodules/OverlayStatusController/Info.plist b/submodules/OverlayStatusController/Info.plist
new file mode 100644
index 0000000000..e1fe4cfb7b
--- /dev/null
+++ b/submodules/OverlayStatusController/Info.plist
@@ -0,0 +1,22 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ $(CURRENT_PROJECT_VERSION)
+
+
diff --git a/submodules/OverlayStatusController/OverlayStatusController_Xcode.xcodeproj/project.pbxproj b/submodules/OverlayStatusController/OverlayStatusController_Xcode.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..62e14acc52
--- /dev/null
+++ b/submodules/OverlayStatusController/OverlayStatusController_Xcode.xcodeproj/project.pbxproj
@@ -0,0 +1,559 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 50;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ D0879A6022F6F71D00C4D6B3 /* OverlayStatusController.h in Headers */ = {isa = PBXBuildFile; fileRef = D0879A5E22F6F71D00C4D6B3 /* OverlayStatusController.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ D0879A6B22F6F80500C4D6B3 /* OverlayStatusController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879A6A22F6F80400C4D6B3 /* OverlayStatusController.swift */; };
+ D0879A6E22F6F80F00C4D6B3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A6D22F6F80E00C4D6B3 /* Foundation.framework */; };
+ D0879A7022F6F81200C4D6B3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A6F22F6F81200C4D6B3 /* UIKit.framework */; };
+ D0879A7222F6F82400C4D6B3 /* TelegramPresentationData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A7122F6F82400C4D6B3 /* TelegramPresentationData.framework */; };
+ D0879A7422F6F82A00C4D6B3 /* LegacyComponents.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A7322F6F82A00C4D6B3 /* LegacyComponents.framework */; };
+ D0879A7622F6F83D00C4D6B3 /* Display.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A7522F6F83D00C4D6B3 /* Display.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ D0879A5B22F6F71D00C4D6B3 /* OverlayStatusController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OverlayStatusController.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A5E22F6F71D00C4D6B3 /* OverlayStatusController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OverlayStatusController.h; sourceTree = ""; };
+ D0879A5F22F6F71D00C4D6B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ D0879A6A22F6F80400C4D6B3 /* OverlayStatusController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OverlayStatusController.swift; sourceTree = ""; };
+ D0879A6D22F6F80E00C4D6B3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ D0879A6F22F6F81200C4D6B3 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ D0879A7122F6F82400C4D6B3 /* TelegramPresentationData.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramPresentationData.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A7322F6F82A00C4D6B3 /* LegacyComponents.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = LegacyComponents.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A7522F6F83D00C4D6B3 /* Display.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Display.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ D0879A5822F6F71D00C4D6B3 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879A7622F6F83D00C4D6B3 /* Display.framework in Frameworks */,
+ D0879A7422F6F82A00C4D6B3 /* LegacyComponents.framework in Frameworks */,
+ D0879A7222F6F82400C4D6B3 /* TelegramPresentationData.framework in Frameworks */,
+ D0879A7022F6F81200C4D6B3 /* UIKit.framework in Frameworks */,
+ D0879A6E22F6F80F00C4D6B3 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ D0879A5122F6F71D00C4D6B3 = {
+ isa = PBXGroup;
+ children = (
+ D0879A5F22F6F71D00C4D6B3 /* Info.plist */,
+ D0879A5D22F6F71D00C4D6B3 /* Sources */,
+ D0879A5C22F6F71D00C4D6B3 /* Products */,
+ D0879A6C22F6F80E00C4D6B3 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ D0879A5C22F6F71D00C4D6B3 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ D0879A5B22F6F71D00C4D6B3 /* OverlayStatusController.framework */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ D0879A5D22F6F71D00C4D6B3 /* Sources */ = {
+ isa = PBXGroup;
+ children = (
+ D0879A6A22F6F80400C4D6B3 /* OverlayStatusController.swift */,
+ D0879A5E22F6F71D00C4D6B3 /* OverlayStatusController.h */,
+ );
+ path = Sources;
+ sourceTree = "";
+ };
+ D0879A6C22F6F80E00C4D6B3 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ D0879A7522F6F83D00C4D6B3 /* Display.framework */,
+ D0879A7322F6F82A00C4D6B3 /* LegacyComponents.framework */,
+ D0879A7122F6F82400C4D6B3 /* TelegramPresentationData.framework */,
+ D0879A6F22F6F81200C4D6B3 /* UIKit.framework */,
+ D0879A6D22F6F80E00C4D6B3 /* Foundation.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ D0879A5622F6F71D00C4D6B3 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879A6022F6F71D00C4D6B3 /* OverlayStatusController.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ D0879A5A22F6F71D00C4D6B3 /* OverlayStatusController */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D0879A6322F6F71D00C4D6B3 /* Build configuration list for PBXNativeTarget "OverlayStatusController" */;
+ buildPhases = (
+ D0879A5622F6F71D00C4D6B3 /* Headers */,
+ D0879A5722F6F71D00C4D6B3 /* Sources */,
+ D0879A5822F6F71D00C4D6B3 /* Frameworks */,
+ D0879A5922F6F71D00C4D6B3 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = OverlayStatusController;
+ productName = OverlayStatusController;
+ productReference = D0879A5B22F6F71D00C4D6B3 /* OverlayStatusController.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ D0879A5222F6F71D00C4D6B3 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ DefaultBuildSystemTypeForWorkspace = Latest;
+ LastUpgradeCheck = 1030;
+ ORGANIZATIONNAME = "Telegram Messenger LLP";
+ TargetAttributes = {
+ D0879A5A22F6F71D00C4D6B3 = {
+ CreatedOnToolsVersion = 10.3;
+ LastSwiftMigration = 1030;
+ };
+ };
+ };
+ buildConfigurationList = D0879A5522F6F71D00C4D6B3 /* Build configuration list for PBXProject "OverlayStatusController_Xcode" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = D0879A5122F6F71D00C4D6B3;
+ productRefGroup = D0879A5C22F6F71D00C4D6B3 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ D0879A5A22F6F71D00C4D6B3 /* OverlayStatusController */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ D0879A5922F6F71D00C4D6B3 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ D0879A5722F6F71D00C4D6B3 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879A6B22F6F80500C4D6B3 /* OverlayStatusController.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ D0879A6122F6F71D00C4D6B3 /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0879A6222F6F71D00C4D6B3 /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0879A6422F6F71D00C4D6B3 /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.OverlayStatusController;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0879A6522F6F71D00C4D6B3 /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.OverlayStatusController;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0879A6622F6F7A400C4D6B3 /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugHockeyapp;
+ };
+ D0879A6722F6F7A400C4D6B3 /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.OverlayStatusController;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugHockeyapp;
+ };
+ D0879A6822F6F7AF00C4D6B3 /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+ D0879A6922F6F7AF00C4D6B3 /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.OverlayStatusController;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ D0879A5522F6F71D00C4D6B3 /* Build configuration list for PBXProject "OverlayStatusController_Xcode" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0879A6122F6F71D00C4D6B3 /* DebugAppStoreLLC */,
+ D0879A6622F6F7A400C4D6B3 /* DebugHockeyapp */,
+ D0879A6222F6F71D00C4D6B3 /* ReleaseAppStoreLLC */,
+ D0879A6822F6F7AF00C4D6B3 /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+ D0879A6322F6F71D00C4D6B3 /* Build configuration list for PBXNativeTarget "OverlayStatusController" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0879A6422F6F71D00C4D6B3 /* DebugAppStoreLLC */,
+ D0879A6722F6F7A400C4D6B3 /* DebugHockeyapp */,
+ D0879A6522F6F71D00C4D6B3 /* ReleaseAppStoreLLC */,
+ D0879A6922F6F7AF00C4D6B3 /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = D0879A5222F6F71D00C4D6B3 /* Project object */;
+}
diff --git a/submodules/OverlayStatusController/Sources/OverlayStatusController.h b/submodules/OverlayStatusController/Sources/OverlayStatusController.h
new file mode 100644
index 0000000000..6662916b18
--- /dev/null
+++ b/submodules/OverlayStatusController/Sources/OverlayStatusController.h
@@ -0,0 +1,19 @@
+//
+// OverlayStatusController.h
+// OverlayStatusController
+//
+// Created by Peter on 8/4/19.
+// Copyright © 2019 Telegram Messenger LLP. All rights reserved.
+//
+
+#import
+
+//! Project version number for OverlayStatusController.
+FOUNDATION_EXPORT double OverlayStatusControllerVersionNumber;
+
+//! Project version string for OverlayStatusController.
+FOUNDATION_EXPORT const unsigned char OverlayStatusControllerVersionString[];
+
+// In this header, you should import all the public headers of your framework using statements like #import
+
+
diff --git a/submodules/TelegramUI/TelegramUI/OverlayStatusController.swift b/submodules/OverlayStatusController/Sources/OverlayStatusController.swift
similarity index 93%
rename from submodules/TelegramUI/TelegramUI/OverlayStatusController.swift
rename to submodules/OverlayStatusController/Sources/OverlayStatusController.swift
index 172ac6a3fe..79cbc52e35 100644
--- a/submodules/TelegramUI/TelegramUI/OverlayStatusController.swift
+++ b/submodules/OverlayStatusController/Sources/OverlayStatusController.swift
@@ -4,7 +4,7 @@ import Display
import TelegramPresentationData
import LegacyComponents
-enum OverlayStatusControllerType {
+public enum OverlayStatusControllerType {
case loading(cancelled: (() -> Void)?)
case success
case shieldSuccess(String, Bool)
@@ -129,7 +129,7 @@ private final class OverlayStatusControllerNode: ViewControllerTracingNode {
}
}
-final class OverlayStatusController: ViewController {
+public final class OverlayStatusController: ViewController {
private let theme: PresentationTheme
private let strings: PresentationStrings
private let type: OverlayStatusControllerType
@@ -140,7 +140,7 @@ final class OverlayStatusController: ViewController {
return self.displayNode as! OverlayStatusControllerNode
}
- init(theme: PresentationTheme, strings: PresentationStrings, type: OverlayStatusControllerType) {
+ public init(theme: PresentationTheme, strings: PresentationStrings, type: OverlayStatusControllerType) {
self.theme = theme
self.strings = strings
self.type = type
@@ -154,7 +154,7 @@ final class OverlayStatusController: ViewController {
fatalError("init(coder:) has not been implemented")
}
- override func loadDisplayNode() {
+ override public func loadDisplayNode() {
self.displayNode = OverlayStatusControllerNode(theme: self.theme, strings: self.strings, type: self.type, dismissed: { [weak self] in
self?.presentingViewController?.dismiss(animated: false, completion: nil)
})
@@ -162,13 +162,13 @@ final class OverlayStatusController: ViewController {
self.displayNodeDidLoad()
}
- override func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) {
+ override public func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) {
super.containerLayoutUpdated(layout, transition: transition)
self.controllerNode.containerLayoutUpdated(layout, transition: transition)
}
- override func viewDidAppear(_ animated: Bool) {
+ override public func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if !self.animatedDidAppear {
@@ -177,7 +177,7 @@ final class OverlayStatusController: ViewController {
}
}
- func dismiss() {
+ public func dismiss() {
self.controllerNode.dismiss()
}
}
diff --git a/submodules/TelegramBaseController/Info.plist b/submodules/TelegramBaseController/Info.plist
new file mode 100644
index 0000000000..e1fe4cfb7b
--- /dev/null
+++ b/submodules/TelegramBaseController/Info.plist
@@ -0,0 +1,22 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ $(CURRENT_PROJECT_VERSION)
+
+
diff --git a/submodules/TelegramUI/TelegramUI/LocationBroadcastActionSheetItem.swift b/submodules/TelegramBaseController/Sources/LocationBroadcastActionSheetItem.swift
similarity index 94%
rename from submodules/TelegramUI/TelegramUI/LocationBroadcastActionSheetItem.swift
rename to submodules/TelegramBaseController/Sources/LocationBroadcastActionSheetItem.swift
index f528d012e1..5d46787ba2 100644
--- a/submodules/TelegramUI/TelegramUI/LocationBroadcastActionSheetItem.swift
+++ b/submodules/TelegramBaseController/Sources/LocationBroadcastActionSheetItem.swift
@@ -5,9 +5,12 @@ import Display
import TelegramCore
import Postbox
import TelegramPresentationData
+import AccountContext
+import LiveLocationTimerNode
+import AvatarNode
public class LocationBroadcastActionSheetItem: ActionSheetItem {
- public let context: AccountContextImpl
+ public let context: AccountContext
public let peer: Peer
public let title: String
public let beginTimestamp: Double
@@ -15,7 +18,7 @@ public class LocationBroadcastActionSheetItem: ActionSheetItem {
public let strings: PresentationStrings
public let action: () -> Void
- public init(context: AccountContextImpl, peer: Peer, title: String, beginTimestamp: Double, timeout: Double, strings: PresentationStrings, action: @escaping () -> Void) {
+ public init(context: AccountContext, peer: Peer, title: String, beginTimestamp: Double, timeout: Double, strings: PresentationStrings, action: @escaping () -> Void) {
self.context = context
self.peer = peer
self.title = title
diff --git a/submodules/TelegramUI/TelegramUI/LocationBroadcastNavigationAccessoryPanel.swift b/submodules/TelegramBaseController/Sources/LocationBroadcastNavigationAccessoryPanel.swift
similarity index 100%
rename from submodules/TelegramUI/TelegramUI/LocationBroadcastNavigationAccessoryPanel.swift
rename to submodules/TelegramBaseController/Sources/LocationBroadcastNavigationAccessoryPanel.swift
diff --git a/submodules/TelegramUI/TelegramUI/LocationBroadcastPanelWavesNode.swift b/submodules/TelegramBaseController/Sources/LocationBroadcastPanelWavesNode.swift
similarity index 100%
rename from submodules/TelegramUI/TelegramUI/LocationBroadcastPanelWavesNode.swift
rename to submodules/TelegramBaseController/Sources/LocationBroadcastPanelWavesNode.swift
diff --git a/submodules/TelegramUI/TelegramUI/MediaNavigationAccessoryContainerNode.swift b/submodules/TelegramBaseController/Sources/MediaNavigationAccessoryContainerNode.swift
similarity index 97%
rename from submodules/TelegramUI/TelegramUI/MediaNavigationAccessoryContainerNode.swift
rename to submodules/TelegramBaseController/Sources/MediaNavigationAccessoryContainerNode.swift
index dfa047e50b..1afdbc34b3 100644
--- a/submodules/TelegramUI/TelegramUI/MediaNavigationAccessoryContainerNode.swift
+++ b/submodules/TelegramBaseController/Sources/MediaNavigationAccessoryContainerNode.swift
@@ -4,6 +4,7 @@ import AsyncDisplayKit
import Display
import TelegramCore
import TelegramPresentationData
+import AccountContext
final class MediaNavigationAccessoryContainerNode: ASDisplayNode, UIGestureRecognizerDelegate {
let backgroundNode: ASDisplayNode
@@ -13,7 +14,7 @@ final class MediaNavigationAccessoryContainerNode: ASDisplayNode, UIGestureRecog
private var presentationData: PresentationData
- init(context: AccountContextImpl) {
+ init(context: AccountContext) {
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
self.backgroundNode = ASDisplayNode()
diff --git a/submodules/TelegramUI/TelegramUI/MediaNavigationAccessoryHeaderNode.swift b/submodules/TelegramBaseController/Sources/MediaNavigationAccessoryHeaderNode.swift
similarity index 99%
rename from submodules/TelegramUI/TelegramUI/MediaNavigationAccessoryHeaderNode.swift
rename to submodules/TelegramBaseController/Sources/MediaNavigationAccessoryHeaderNode.swift
index 9251ad8115..00f3e3faca 100644
--- a/submodules/TelegramUI/TelegramUI/MediaNavigationAccessoryHeaderNode.swift
+++ b/submodules/TelegramBaseController/Sources/MediaNavigationAccessoryHeaderNode.swift
@@ -7,6 +7,8 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import UniversalMediaPlayer
+import AccountContext
+import TelegramStringFormatting
private let titleFont = Font.regular(12.0)
private let subtitleFont = Font.regular(10.0)
diff --git a/submodules/TelegramUI/TelegramUI/MediaNavigationAccessoryPanel.swift b/submodules/TelegramBaseController/Sources/MediaNavigationAccessoryPanel.swift
similarity index 98%
rename from submodules/TelegramUI/TelegramUI/MediaNavigationAccessoryPanel.swift
rename to submodules/TelegramBaseController/Sources/MediaNavigationAccessoryPanel.swift
index e136c18632..07c6a01c08 100644
--- a/submodules/TelegramUI/TelegramUI/MediaNavigationAccessoryPanel.swift
+++ b/submodules/TelegramBaseController/Sources/MediaNavigationAccessoryPanel.swift
@@ -3,6 +3,7 @@ import UIKit
import Display
import AsyncDisplayKit
import TelegramCore
+import AccountContext
final class MediaNavigationAccessoryPanel: ASDisplayNode {
let containerNode: MediaNavigationAccessoryContainerNode
@@ -14,7 +15,7 @@ final class MediaNavigationAccessoryPanel: ASDisplayNode {
var playPrevious: (() -> Void)?
var playNext: (() -> Void)?
- init(context: AccountContextImpl) {
+ init(context: AccountContext) {
self.containerNode = MediaNavigationAccessoryContainerNode(context: context)
super.init()
diff --git a/submodules/TelegramBaseController/Sources/TelegramBaseController.h b/submodules/TelegramBaseController/Sources/TelegramBaseController.h
new file mode 100644
index 0000000000..cc52b070ec
--- /dev/null
+++ b/submodules/TelegramBaseController/Sources/TelegramBaseController.h
@@ -0,0 +1,19 @@
+//
+// TelegramBaseController.h
+// TelegramBaseController
+//
+// Created by Peter on 8/3/19.
+// Copyright © 2019 Telegram Messenger LLP. All rights reserved.
+//
+
+#import
+
+//! Project version number for TelegramBaseController.
+FOUNDATION_EXPORT double TelegramBaseControllerVersionNumber;
+
+//! Project version string for TelegramBaseController.
+FOUNDATION_EXPORT const unsigned char TelegramBaseControllerVersionString[];
+
+// In this header, you should import all the public headers of your framework using statements like #import
+
+
diff --git a/submodules/TelegramUI/TelegramUI/TelegramController.swift b/submodules/TelegramBaseController/Sources/TelegramBaseController.swift
similarity index 91%
rename from submodules/TelegramUI/TelegramUI/TelegramController.swift
rename to submodules/TelegramBaseController/Sources/TelegramBaseController.swift
index c76842d72c..cd66aa00b9 100644
--- a/submodules/TelegramUI/TelegramUI/TelegramController.swift
+++ b/submodules/TelegramBaseController/Sources/TelegramBaseController.swift
@@ -8,23 +8,25 @@ import Postbox
import TelegramPresentationData
import TelegramUIPreferences
import UniversalMediaPlayer
+import AccountContext
+import OverlayStatusController
-enum MediaAccessoryPanelVisibility {
+public enum MediaAccessoryPanelVisibility {
case none
case specific(size: ContainerViewLayoutSizeClass)
case always
}
-enum LocationBroadcastPanelSource {
+public enum LocationBroadcastPanelSource {
case none
case summary
case peer(PeerId)
}
-private func presentLiveLocationController(context: AccountContextImpl, peerId: PeerId, controller: ViewController) {
+private func presentLiveLocationController(context: AccountContext, peerId: PeerId, controller: ViewController) {
let presentImpl: (Message?) -> Void = { [weak controller] message in
if let message = message, let strongController = controller {
- let _ = openChatMessage(context: context, message: message, standalone: false, reverseMessageGalleryOrder: false, navigationController: strongController.navigationController as? NavigationController, modal: true, dismissInput: {
+ let _ = context.sharedContext.openChatMessage(OpenChatMessageParams(context: context, message: message, standalone: false, reverseMessageGalleryOrder: false, navigationController: strongController.navigationController as? NavigationController, modal: true, dismissInput: {
controller?.view.endEditing(true)
}, present: { c, a in
controller?.present(c, in: .window(.root), with: a, blockInteraction: true)
@@ -35,7 +37,10 @@ private func presentLiveLocationController(context: AccountContextImpl, peerId:
}, openPeer: { peer, navigation in
}, callPeer: { _ in
}, enqueueMessage: { _ in
- }, sendSticker: nil, setupTemporaryHiddenMedia: { _, _, _ in }, chatAvatarHiddenMedia: { _, _ in})
+ }, sendSticker: nil,
+ setupTemporaryHiddenMedia: { _, _, _ in
+ }, chatAvatarHiddenMedia: { _, _ in
+ }))
}
}
if let id = context.liveLocationManager?.internalMessageForPeerId(peerId) {
@@ -51,19 +56,19 @@ private func presentLiveLocationController(context: AccountContextImpl, peerId:
}
}
-public class TelegramController: ViewController, KeyShortcutResponder {
- private let context: AccountContextImpl
+open class TelegramBaseController: ViewController, KeyShortcutResponder {
+ private let context: AccountContext
- let mediaAccessoryPanelVisibility: MediaAccessoryPanelVisibility
- let locationBroadcastPanelSource: LocationBroadcastPanelSource
+ public let mediaAccessoryPanelVisibility: MediaAccessoryPanelVisibility
+ public let locationBroadcastPanelSource: LocationBroadcastPanelSource
private var mediaStatusDisposable: Disposable?
private var locationBroadcastDisposable: Disposable?
- private(set) var playlistStateAndType: (SharedMediaPlaylistItem, SharedMediaPlaylistItem?, SharedMediaPlaylistItem?, MusicPlaybackSettingsOrder, MediaManagerPlayerType, Account)?
+ public private(set) var playlistStateAndType: (SharedMediaPlaylistItem, SharedMediaPlaylistItem?, SharedMediaPlaylistItem?, MusicPlaybackSettingsOrder, MediaManagerPlayerType, Account)?
- var tempVoicePlaylistEnded: (() -> Void)?
- var tempVoicePlaylistItemChanged: ((SharedMediaPlaylistItem?, SharedMediaPlaylistItem?) -> Void)?
+ public var tempVoicePlaylistEnded: (() -> Void)?
+ public var tempVoicePlaylistItemChanged: ((SharedMediaPlaylistItem?, SharedMediaPlaylistItem?) -> Void)?
private var mediaAccessoryPanel: (MediaNavigationAccessoryPanel, MediaManagerPlayerType)?
@@ -78,15 +83,15 @@ public class TelegramController: ViewController, KeyShortcutResponder {
private var presentationDataDisposable: Disposable?
private var playlistPreloadDisposable: Disposable?
- override public var navigationHeight: CGFloat {
+ override open var navigationHeight: CGFloat {
return super.navigationHeight + self.additionalHeight
}
- override public var navigationInsetHeight: CGFloat {
+ override open var navigationInsetHeight: CGFloat {
return super.navigationInsetHeight + self.additionalHeight
}
- override public var visualNavigationInsetHeight: CGFloat {
+ override open var visualNavigationInsetHeight: CGFloat {
return super.visualNavigationInsetHeight + self.additionalHeight
}
@@ -101,11 +106,11 @@ public class TelegramController: ViewController, KeyShortcutResponder {
return height
}
- public var primaryNavigationHeight: CGFloat {
+ open var primaryNavigationHeight: CGFloat {
return super.navigationHeight
}
- init(context: AccountContextImpl, navigationBarPresentationData: NavigationBarPresentationData?, mediaAccessoryPanelVisibility: MediaAccessoryPanelVisibility, locationBroadcastPanelSource: LocationBroadcastPanelSource) {
+ public init(context: AccountContext, navigationBarPresentationData: NavigationBarPresentationData?, mediaAccessoryPanelVisibility: MediaAccessoryPanelVisibility, locationBroadcastPanelSource: LocationBroadcastPanelSource) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
self.mediaAccessoryPanelVisibility = mediaAccessoryPanelVisibility
@@ -267,7 +272,7 @@ public class TelegramController: ViewController, KeyShortcutResponder {
fatalError("init(coder:) has not been implemented")
}
- public override func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) {
+ override open func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) {
super.containerLayoutUpdated(layout, transition: transition)
var navigationHeight = super.navigationHeight
@@ -499,7 +504,7 @@ public class TelegramController: ViewController, KeyShortcutResponder {
mediaAccessoryPanel.containerNode.headerNode.displayScrubber = type != .voice
mediaAccessoryPanel.close = { [weak self] in
if let strongSelf = self, let (_, _, _, _, type, _) = strongSelf.playlistStateAndType {
- strongSelf.context.sharedContext.mediaManager.setPlaylist(nil, type: type)
+ strongSelf.context.sharedContext.mediaManager.setPlaylist(nil, type: type, control: SharedMediaPlayerControlAction.playback(.pause))
}
}
mediaAccessoryPanel.toggleRate = {
@@ -550,24 +555,7 @@ public class TelegramController: ViewController, KeyShortcutResponder {
}
if let id = state.id as? PeerMessagesMediaPlaylistItemId {
if type == .music {
- let historyView = preloadedChatHistoryViewForLocation(ChatHistoryLocationInput(content: .InitialSearch(location: .id(id.messageId), count: 60), id: 0), account: account, chatLocation: .peer(id.messageId.peerId), fixedCombinedReadStates: nil, tagMask: MessageTags.music, additionalData: [])
- let signal = historyView
- |> mapToSignal { historyView -> Signal<(MessageIndex?, Bool), NoError> in
- switch historyView {
- case .Loading:
- return .single((nil, true))
- case let .HistoryView(view, _, _, _, _, _, _):
- for entry in view.entries {
- if entry.message.id == id.messageId {
- return .single((entry.message.index, false))
- }
- }
- return .single((nil, false))
- }
- }
- |> take(until: { index in
- return SignalTakeAction(passthrough: true, complete: !index.1)
- })
+ let signal = strongSelf.context.sharedContext.messageFromPreloadedChatHistoryViewForLocation(id: id.messageId, location: ChatHistoryLocationInput(content: .InitialSearch(location: .id(id.messageId), count: 60), id: 0), account: account, chatLocation: .peer(id.messageId.peerId), tagMask: MessageTags.music)
var cancelImpl: (() -> Void)?
let presentationData = strongSelf.context.sharedContext.currentPresentationData.with { $0 }
@@ -598,7 +586,13 @@ public class TelegramController: ViewController, KeyShortcutResponder {
return
}
if let _ = index.0 {
- let controller = OverlayPlayerController(context: account.id == strongSelf.context.account.id ? strongSelf.context : AccountContextImpl(sharedContext: strongSelf.context.sharedContext, account: account, limitsConfiguration: .defaultValue), peerId: id.messageId.peerId, type: type, initialMessageId: id.messageId, initialOrder: order, parentNavigationController: strongSelf.navigationController as? NavigationController)
+ let controllerContext: AccountContext
+ if account.id == strongSelf.context.account.id {
+ controllerContext = strongSelf.context
+ } else {
+ controllerContext = strongSelf.context.sharedContext.makeTempAccountContext(account: account)
+ }
+ let controller = strongSelf.context.sharedContext.makeOverlayAudioPlayerController(context: controllerContext, peerId: id.messageId.peerId, type: type, initialMessageId: id.messageId, initialOrder: order, parentNavigationController: strongSelf.navigationController as? NavigationController)
strongSelf.displayNode.view.window?.endEditing(true)
strongSelf.present(controller, in: .window(.root))
} else if index.1 {
@@ -657,7 +651,7 @@ public class TelegramController: ViewController, KeyShortcutResponder {
}
}
- public var keyShortcuts: [KeyShortcut] {
+ open var keyShortcuts: [KeyShortcut] {
return [KeyShortcut(input: UIKeyCommand.inputEscape, action: { [weak self] in
if !(self?.navigationController?.topViewController is TabBarController) {
_ = self?.navigationBar?.executeBack()
diff --git a/submodules/TelegramBaseController/TelegramBaseController_Xcode.xcodeproj/project.pbxproj b/submodules/TelegramBaseController/TelegramBaseController_Xcode.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..dbce9c6f72
--- /dev/null
+++ b/submodules/TelegramBaseController/TelegramBaseController_Xcode.xcodeproj/project.pbxproj
@@ -0,0 +1,609 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 50;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ D08799DB22F648D100C4D6B3 /* MediaNavigationAccessoryHeaderNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D08799D422F648D000C4D6B3 /* MediaNavigationAccessoryHeaderNode.swift */; };
+ D08799DC22F648D100C4D6B3 /* LocationBroadcastNavigationAccessoryPanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D08799D522F648D100C4D6B3 /* LocationBroadcastNavigationAccessoryPanel.swift */; };
+ D08799DD22F648D100C4D6B3 /* TelegramBaseController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D08799D622F648D100C4D6B3 /* TelegramBaseController.swift */; };
+ D08799DE22F648D100C4D6B3 /* MediaNavigationAccessoryContainerNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D08799D722F648D100C4D6B3 /* MediaNavigationAccessoryContainerNode.swift */; };
+ D08799DF22F648D100C4D6B3 /* LocationBroadcastPanelWavesNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D08799D822F648D100C4D6B3 /* LocationBroadcastPanelWavesNode.swift */; };
+ D08799E022F648D100C4D6B3 /* LocationBroadcastActionSheetItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = D08799D922F648D100C4D6B3 /* LocationBroadcastActionSheetItem.swift */; };
+ D08799E122F648D100C4D6B3 /* MediaNavigationAccessoryPanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D08799DA22F648D100C4D6B3 /* MediaNavigationAccessoryPanel.swift */; };
+ D08799E422F6490D00C4D6B3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D08799E322F6490D00C4D6B3 /* Foundation.framework */; };
+ D08799E622F6491200C4D6B3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D08799E522F6491200C4D6B3 /* UIKit.framework */; };
+ D08799E822F6496B00C4D6B3 /* AccountContext.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D08799E722F6496B00C4D6B3 /* AccountContext.framework */; };
+ D08799EA22F6497000C4D6B3 /* Postbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D08799E922F6497000C4D6B3 /* Postbox.framework */; };
+ D08799EC22F6499000C4D6B3 /* TelegramCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D08799EB22F6499000C4D6B3 /* TelegramCore.framework */; };
+ D08799EE22F6499800C4D6B3 /* SwiftSignalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D08799ED22F6499800C4D6B3 /* SwiftSignalKit.framework */; };
+ D0879A4222F6503C00C4D6B3 /* LiveLocationManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A4122F6503C00C4D6B3 /* LiveLocationManager.framework */; };
+ D0879A7822F6F84A00C4D6B3 /* OverlayStatusController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A7722F6F84A00C4D6B3 /* OverlayStatusController.framework */; };
+ D0879AA022F6FAAF00C4D6B3 /* LiveLocationTimerNode.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879A9F22F6FAAF00C4D6B3 /* LiveLocationTimerNode.framework */; };
+ D0879AC822F7061100C4D6B3 /* TelegramStringFormatting.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879AC722F7061100C4D6B3 /* TelegramStringFormatting.framework */; };
+ D0879B1122F708A600C4D6B3 /* AvatarNode.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879B1022F708A600C4D6B3 /* AvatarNode.framework */; };
+ D0FBC81522F61F8F00DB1A7A /* TelegramBaseController.h in Headers */ = {isa = PBXBuildFile; fileRef = D0FBC81322F61F8F00DB1A7A /* TelegramBaseController.h */; settings = {ATTRIBUTES = (Public, ); }; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ D08799D422F648D000C4D6B3 /* MediaNavigationAccessoryHeaderNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaNavigationAccessoryHeaderNode.swift; sourceTree = ""; };
+ D08799D522F648D100C4D6B3 /* LocationBroadcastNavigationAccessoryPanel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationBroadcastNavigationAccessoryPanel.swift; sourceTree = ""; };
+ D08799D622F648D100C4D6B3 /* TelegramBaseController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelegramBaseController.swift; sourceTree = ""; };
+ D08799D722F648D100C4D6B3 /* MediaNavigationAccessoryContainerNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaNavigationAccessoryContainerNode.swift; sourceTree = ""; };
+ D08799D822F648D100C4D6B3 /* LocationBroadcastPanelWavesNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationBroadcastPanelWavesNode.swift; sourceTree = ""; };
+ D08799D922F648D100C4D6B3 /* LocationBroadcastActionSheetItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationBroadcastActionSheetItem.swift; sourceTree = ""; };
+ D08799DA22F648D100C4D6B3 /* MediaNavigationAccessoryPanel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaNavigationAccessoryPanel.swift; sourceTree = ""; };
+ D08799E322F6490D00C4D6B3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ D08799E522F6491200C4D6B3 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ D08799E722F6496B00C4D6B3 /* AccountContext.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = AccountContext.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D08799E922F6497000C4D6B3 /* Postbox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Postbox.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D08799EB22F6499000C4D6B3 /* TelegramCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D08799ED22F6499800C4D6B3 /* SwiftSignalKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SwiftSignalKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A1722F64EE700C4D6B3 /* DeviceLocationManager.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = DeviceLocationManager.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A4122F6503C00C4D6B3 /* LiveLocationManager.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = LiveLocationManager.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A7722F6F84A00C4D6B3 /* OverlayStatusController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = OverlayStatusController.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879A9F22F6FAAF00C4D6B3 /* LiveLocationTimerNode.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = LiveLocationTimerNode.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879AC722F7061100C4D6B3 /* TelegramStringFormatting.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramStringFormatting.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879B1022F708A600C4D6B3 /* AvatarNode.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = AvatarNode.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0FBC81022F61F8F00DB1A7A /* TelegramBaseController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TelegramBaseController.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0FBC81322F61F8F00DB1A7A /* TelegramBaseController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TelegramBaseController.h; sourceTree = ""; };
+ D0FBC81422F61F8F00DB1A7A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ D0FBC80D22F61F8F00DB1A7A /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879B1122F708A600C4D6B3 /* AvatarNode.framework in Frameworks */,
+ D0879AC822F7061100C4D6B3 /* TelegramStringFormatting.framework in Frameworks */,
+ D0879AA022F6FAAF00C4D6B3 /* LiveLocationTimerNode.framework in Frameworks */,
+ D0879A7822F6F84A00C4D6B3 /* OverlayStatusController.framework in Frameworks */,
+ D0879A4222F6503C00C4D6B3 /* LiveLocationManager.framework in Frameworks */,
+ D08799EE22F6499800C4D6B3 /* SwiftSignalKit.framework in Frameworks */,
+ D08799EC22F6499000C4D6B3 /* TelegramCore.framework in Frameworks */,
+ D08799EA22F6497000C4D6B3 /* Postbox.framework in Frameworks */,
+ D08799E822F6496B00C4D6B3 /* AccountContext.framework in Frameworks */,
+ D08799E622F6491200C4D6B3 /* UIKit.framework in Frameworks */,
+ D08799E422F6490D00C4D6B3 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ D08799E222F6490D00C4D6B3 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ D0879B1022F708A600C4D6B3 /* AvatarNode.framework */,
+ D0879AC722F7061100C4D6B3 /* TelegramStringFormatting.framework */,
+ D0879A9F22F6FAAF00C4D6B3 /* LiveLocationTimerNode.framework */,
+ D0879A7722F6F84A00C4D6B3 /* OverlayStatusController.framework */,
+ D0879A4122F6503C00C4D6B3 /* LiveLocationManager.framework */,
+ D0879A1722F64EE700C4D6B3 /* DeviceLocationManager.framework */,
+ D08799ED22F6499800C4D6B3 /* SwiftSignalKit.framework */,
+ D08799EB22F6499000C4D6B3 /* TelegramCore.framework */,
+ D08799E922F6497000C4D6B3 /* Postbox.framework */,
+ D08799E722F6496B00C4D6B3 /* AccountContext.framework */,
+ D08799E522F6491200C4D6B3 /* UIKit.framework */,
+ D08799E322F6490D00C4D6B3 /* Foundation.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ D0FBC80622F61F8F00DB1A7A = {
+ isa = PBXGroup;
+ children = (
+ D0FBC81422F61F8F00DB1A7A /* Info.plist */,
+ D0FBC81222F61F8F00DB1A7A /* Sources */,
+ D0FBC81122F61F8F00DB1A7A /* Products */,
+ D08799E222F6490D00C4D6B3 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ D0FBC81122F61F8F00DB1A7A /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ D0FBC81022F61F8F00DB1A7A /* TelegramBaseController.framework */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ D0FBC81222F61F8F00DB1A7A /* Sources */ = {
+ isa = PBXGroup;
+ children = (
+ D08799D922F648D100C4D6B3 /* LocationBroadcastActionSheetItem.swift */,
+ D08799D522F648D100C4D6B3 /* LocationBroadcastNavigationAccessoryPanel.swift */,
+ D08799D822F648D100C4D6B3 /* LocationBroadcastPanelWavesNode.swift */,
+ D08799D722F648D100C4D6B3 /* MediaNavigationAccessoryContainerNode.swift */,
+ D08799D422F648D000C4D6B3 /* MediaNavigationAccessoryHeaderNode.swift */,
+ D08799DA22F648D100C4D6B3 /* MediaNavigationAccessoryPanel.swift */,
+ D08799D622F648D100C4D6B3 /* TelegramBaseController.swift */,
+ D0FBC81322F61F8F00DB1A7A /* TelegramBaseController.h */,
+ );
+ path = Sources;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ D0FBC80B22F61F8F00DB1A7A /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0FBC81522F61F8F00DB1A7A /* TelegramBaseController.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ D0FBC80F22F61F8F00DB1A7A /* TelegramBaseController */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D0FBC81822F61F8F00DB1A7A /* Build configuration list for PBXNativeTarget "TelegramBaseController" */;
+ buildPhases = (
+ D0FBC80B22F61F8F00DB1A7A /* Headers */,
+ D0FBC80C22F61F8F00DB1A7A /* Sources */,
+ D0FBC80D22F61F8F00DB1A7A /* Frameworks */,
+ D0FBC80E22F61F8F00DB1A7A /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = TelegramBaseController;
+ productName = TelegramBaseController;
+ productReference = D0FBC81022F61F8F00DB1A7A /* TelegramBaseController.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ D0FBC80722F61F8F00DB1A7A /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ DefaultBuildSystemTypeForWorkspace = Latest;
+ LastUpgradeCheck = 1030;
+ ORGANIZATIONNAME = "Telegram Messenger LLP";
+ TargetAttributes = {
+ D0FBC80F22F61F8F00DB1A7A = {
+ CreatedOnToolsVersion = 10.3;
+ LastSwiftMigration = 1030;
+ };
+ };
+ };
+ buildConfigurationList = D0FBC80A22F61F8F00DB1A7A /* Build configuration list for PBXProject "TelegramBaseController_Xcode" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = D0FBC80622F61F8F00DB1A7A;
+ productRefGroup = D0FBC81122F61F8F00DB1A7A /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ D0FBC80F22F61F8F00DB1A7A /* TelegramBaseController */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ D0FBC80E22F61F8F00DB1A7A /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ D0FBC80C22F61F8F00DB1A7A /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D08799E122F648D100C4D6B3 /* MediaNavigationAccessoryPanel.swift in Sources */,
+ D08799DF22F648D100C4D6B3 /* LocationBroadcastPanelWavesNode.swift in Sources */,
+ D08799DD22F648D100C4D6B3 /* TelegramBaseController.swift in Sources */,
+ D08799DC22F648D100C4D6B3 /* LocationBroadcastNavigationAccessoryPanel.swift in Sources */,
+ D08799E022F648D100C4D6B3 /* LocationBroadcastActionSheetItem.swift in Sources */,
+ D08799DB22F648D100C4D6B3 /* MediaNavigationAccessoryHeaderNode.swift in Sources */,
+ D08799DE22F648D100C4D6B3 /* MediaNavigationAccessoryContainerNode.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ D0FBC81622F61F8F00DB1A7A /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0FBC81722F61F8F00DB1A7A /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0FBC81922F61F8F00DB1A7A /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.TelegramBaseController;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0FBC81A22F61F8F00DB1A7A /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.TelegramBaseController;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0FBC81B22F61FCB00DB1A7A /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+ D0FBC81C22F61FCB00DB1A7A /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.TelegramBaseController;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+ D0FBC81D22F61FCE00DB1A7A /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugHockeyapp;
+ };
+ D0FBC81E22F61FCE00DB1A7A /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.TelegramBaseController;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugHockeyapp;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ D0FBC80A22F61F8F00DB1A7A /* Build configuration list for PBXProject "TelegramBaseController_Xcode" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0FBC81622F61F8F00DB1A7A /* DebugAppStoreLLC */,
+ D0FBC81D22F61FCE00DB1A7A /* DebugHockeyapp */,
+ D0FBC81722F61F8F00DB1A7A /* ReleaseAppStoreLLC */,
+ D0FBC81B22F61FCB00DB1A7A /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+ D0FBC81822F61F8F00DB1A7A /* Build configuration list for PBXNativeTarget "TelegramBaseController" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0FBC81922F61F8F00DB1A7A /* DebugAppStoreLLC */,
+ D0FBC81E22F61FCE00DB1A7A /* DebugHockeyapp */,
+ D0FBC81A22F61F8F00DB1A7A /* ReleaseAppStoreLLC */,
+ D0FBC81C22F61FCB00DB1A7A /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = D0FBC80722F61F8F00DB1A7A /* Project object */;
+}
diff --git a/submodules/TelegramCallsUI/Sources/PresentationCall.swift b/submodules/TelegramCallsUI/Sources/PresentationCall.swift
index d2da2030b7..e2dc012cf2 100644
--- a/submodules/TelegramCallsUI/Sources/PresentationCall.swift
+++ b/submodules/TelegramCallsUI/Sources/PresentationCall.swift
@@ -10,16 +10,7 @@ import TelegramUIPreferences
import TelegramPresentationData
import DeviceAccess
import UniversalMediaPlayer
-
-public enum PresentationCallState: Equatable {
- case waiting
- case ringing
- case requesting(Bool)
- case connecting(Data?)
- case active(Double, Int32?, Data)
- case terminating
- case terminated(CallId?, CallSessionTerminationReason?, Bool)
-}
+import AccountContext
private final class PresentationCallToneRenderer {
let queue: Queue
@@ -159,7 +150,7 @@ private final class PresentationCallToneRenderer {
}
}
-public final class PresentationCall {
+public final class PresentationCallImpl: PresentationCall {
public let account: Account
private let audioSession: ManagedAudioSession
private let callSessionManager: CallSessionManager
@@ -208,7 +199,7 @@ public final class PresentationCall {
private let canBeRemovedPromise = Promise(false)
private var didSetCanBeRemoved = false
- var canBeRemoved: Signal {
+ public var canBeRemoved: Signal {
return self.canBeRemovedPromise.get()
}
diff --git a/submodules/TelegramCallsUI/Sources/PresentationCallManager.swift b/submodules/TelegramCallsUI/Sources/PresentationCallManager.swift
index e9e19294e1..0834ce2425 100644
--- a/submodules/TelegramCallsUI/Sources/PresentationCallManager.swift
+++ b/submodules/TelegramCallsUI/Sources/PresentationCallManager.swift
@@ -3,12 +3,12 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import Display
-
import DeviceAccess
import TelegramPresentationData
import TelegramAudio
import TelegramVoip
import TelegramUIPreferences
+import AccountContext
private func callKitIntegrationIfEnabled(_ integration: CallKitIntegration?, settings: VoiceCallSettings?) -> CallKitIntegration? {
let enabled = settings?.enableSystemIntegration ?? true
@@ -32,19 +32,14 @@ private enum CurrentCall {
}
}
-public enum RequestCallResult {
- case requested
- case alreadyInProgress(PeerId)
-}
-
-public final class PresentationCallManager {
+public final class PresentationCallManagerImpl: PresentationCallManager {
private let getDeviceAccessData: () -> (presentationData: PresentationData, present: (ViewController, Any?) -> Void, openSettings: () -> Void)
private let accountManager: AccountManager
private let audioSession: ManagedAudioSession
private let callKitIntegration: CallKitIntegration?
- private var currentCall: PresentationCall?
+ private var currentCall: PresentationCallImpl?
private var currentCallDisposable = MetaDisposable()
private let removeCurrentCallDisposable = MetaDisposable()
@@ -240,7 +235,7 @@ public final class PresentationCallManager {
let derivedState = preferences.values[ApplicationSpecificPreferencesKeys.voipDerivedState] as? VoipDerivedState ?? .default
let autodownloadSettings = sharedData.entries[SharedDataKeys.autodownloadSettings] as? AutodownloadSettings ?? .defaultSettings
- let call = PresentationCall(account: firstState.0, audioSession: strongSelf.audioSession, callSessionManager: firstState.0.callSessionManager, callKitIntegration: enableCallKit ? callKitIntegrationIfEnabled(strongSelf.callKitIntegration, settings: strongSelf.callSettings) : nil, serializedData: configuration.serializedData, dataSaving: effectiveDataSaving(for: strongSelf.callSettings, autodownloadSettings: autodownloadSettings), derivedState: derivedState, getDeviceAccessData: strongSelf.getDeviceAccessData, internalId: firstState.2.id, peerId: firstState.2.peerId, isOutgoing: false, peer: firstState.1, proxyServer: strongSelf.proxyServer, currentNetworkType: firstState.4, updatedNetworkType: firstState.0.networkType)
+ let call = PresentationCallImpl(account: firstState.0, audioSession: strongSelf.audioSession, callSessionManager: firstState.0.callSessionManager, callKitIntegration: enableCallKit ? callKitIntegrationIfEnabled(strongSelf.callKitIntegration, settings: strongSelf.callSettings) : nil, serializedData: configuration.serializedData, dataSaving: effectiveDataSaving(for: strongSelf.callSettings, autodownloadSettings: autodownloadSettings), derivedState: derivedState, getDeviceAccessData: strongSelf.getDeviceAccessData, internalId: firstState.2.id, peerId: firstState.2.peerId, isOutgoing: false, peer: firstState.1, proxyServer: strongSelf.proxyServer, currentNetworkType: firstState.4, updatedNetworkType: firstState.0.networkType)
strongSelf.currentCall = call
strongSelf.currentCallPromise.set(.single(call))
strongSelf.hasActiveCallsPromise.set(true)
@@ -370,7 +365,7 @@ public final class PresentationCallManager {
let derivedState = preferences.values[ApplicationSpecificPreferencesKeys.voipDerivedState] as? VoipDerivedState ?? .default
let autodownloadSettings = sharedData.entries[SharedDataKeys.autodownloadSettings] as? AutodownloadSettings ?? .defaultSettings
- let call = PresentationCall(account: account, audioSession: strongSelf.audioSession, callSessionManager: account.callSessionManager, callKitIntegration: callKitIntegrationIfEnabled(strongSelf.callKitIntegration, settings: strongSelf.callSettings), serializedData: configuration.serializedData, dataSaving: effectiveDataSaving(for: strongSelf.callSettings, autodownloadSettings: autodownloadSettings), derivedState: derivedState, getDeviceAccessData: strongSelf.getDeviceAccessData, internalId: internalId, peerId: peerId, isOutgoing: true, peer: nil, proxyServer: strongSelf.proxyServer, currentNetworkType: currentNetworkType, updatedNetworkType: account.networkType)
+ let call = PresentationCallImpl(account: account, audioSession: strongSelf.audioSession, callSessionManager: account.callSessionManager, callKitIntegration: callKitIntegrationIfEnabled(strongSelf.callKitIntegration, settings: strongSelf.callSettings), serializedData: configuration.serializedData, dataSaving: effectiveDataSaving(for: strongSelf.callSettings, autodownloadSettings: autodownloadSettings), derivedState: derivedState, getDeviceAccessData: strongSelf.getDeviceAccessData, internalId: internalId, peerId: peerId, isOutgoing: true, peer: nil, proxyServer: strongSelf.proxyServer, currentNetworkType: currentNetworkType, updatedNetworkType: account.networkType)
strongSelf.currentCall = call
strongSelf.currentCallPromise.set(.single(call))
strongSelf.hasActiveCallsPromise.set(true)
diff --git a/submodules/TelegramStringFormatting/Info.plist b/submodules/TelegramStringFormatting/Info.plist
new file mode 100644
index 0000000000..e1fe4cfb7b
--- /dev/null
+++ b/submodules/TelegramStringFormatting/Info.plist
@@ -0,0 +1,22 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ $(CURRENT_PROJECT_VERSION)
+
+
diff --git a/submodules/TelegramStringFormatting/Sources/DateFormat.swift b/submodules/TelegramStringFormatting/Sources/DateFormat.swift
new file mode 100644
index 0000000000..2dd50a37ab
--- /dev/null
+++ b/submodules/TelegramStringFormatting/Sources/DateFormat.swift
@@ -0,0 +1,111 @@
+import Foundation
+import TelegramPresentationData
+import TelegramUIPreferences
+
+public func stringForShortTimestamp(hours: Int32, minutes: Int32, dateTimeFormat: PresentationDateTimeFormat) -> String {
+ switch dateTimeFormat.timeFormat {
+ case .regular:
+ let hourString: String
+ if hours == 0 {
+ hourString = "12"
+ } else if hours > 12 {
+ hourString = "\(hours - 12)"
+ } else {
+ hourString = "\(hours)"
+ }
+
+ let periodString: String
+ if hours >= 12 {
+ periodString = "PM"
+ } else {
+ periodString = "AM"
+ }
+ if minutes >= 10 {
+ return "\(hourString):\(minutes) \(periodString)"
+ } else {
+ return "\(hourString):0\(minutes) \(periodString)"
+ }
+ case .military:
+ return String(format: "%02d:%02d", arguments: [Int(hours), Int(minutes)])
+ }
+}
+
+public func stringForMessageTimestamp(timestamp: Int32, dateTimeFormat: PresentationDateTimeFormat, local: Bool = true) -> String {
+ var t = Int(timestamp)
+ var timeinfo = tm()
+ if local {
+ localtime_r(&t, &timeinfo)
+ } else {
+ gmtime_r(&t, &timeinfo)
+ }
+
+ return stringForShortTimestamp(hours: timeinfo.tm_hour, minutes: timeinfo.tm_min, dateTimeFormat: dateTimeFormat)
+}
+
+public func stringForFullDate(timestamp: Int32, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat) -> String {
+ var t: time_t = Int(timestamp)
+ var timeinfo = tm()
+ localtime_r(&t, &timeinfo);
+
+ switch timeinfo.tm_mon + 1 {
+ case 1:
+ return strings.Time_PreciseDate_m1("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
+ case 2:
+ return strings.Time_PreciseDate_m2("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
+ case 3:
+ return strings.Time_PreciseDate_m3("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
+ case 4:
+ return strings.Time_PreciseDate_m4("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
+ case 5:
+ return strings.Time_PreciseDate_m5("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
+ case 6:
+ return strings.Time_PreciseDate_m6("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
+ case 7:
+ return strings.Time_PreciseDate_m7("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
+ case 8:
+ return strings.Time_PreciseDate_m8("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
+ case 9:
+ return strings.Time_PreciseDate_m9("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
+ case 10:
+ return strings.Time_PreciseDate_m10("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
+ case 11:
+ return strings.Time_PreciseDate_m11("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
+ case 12:
+ return strings.Time_PreciseDate_m12("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
+ default:
+ return ""
+ }
+}
+
+public func stringForDate(timestamp: Int32, strings: PresentationStrings) -> String {
+ let formatter = DateFormatter()
+ formatter.timeStyle = .none
+ formatter.dateStyle = .medium
+ formatter.timeZone = TimeZone(secondsFromGMT: 0)
+ formatter.locale = localeWithStrings(strings)
+ return formatter.string(from: Date(timeIntervalSince1970: Double(timestamp)))
+}
+
+public func stringForDateWithoutYear(date: Date, strings: PresentationStrings) -> String {
+ let formatter = DateFormatter()
+ formatter.timeStyle = .none
+ formatter.timeZone = TimeZone(secondsFromGMT: 0)
+ formatter.locale = localeWithStrings(strings)
+ formatter.setLocalizedDateFormatFromTemplate("MMMMd")
+ return formatter.string(from: date)
+}
+
+public func roundDateToDays(_ timestamp: Int32) -> Int32 {
+ var calendar = Calendar(identifier: .gregorian)
+ calendar.timeZone = TimeZone(secondsFromGMT: 0)!
+ var components = calendar.dateComponents(Set([.era, .year, .month, .day]), from: Date(timeIntervalSince1970: Double(timestamp)))
+ components.hour = 0
+ components.minute = 0
+ components.second = 0
+
+ guard let date = calendar.date(from: components) else {
+ assertionFailure()
+ return timestamp
+ }
+ return Int32(date.timeIntervalSince1970)
+}
diff --git a/submodules/TelegramUI/TelegramUI/Locale.swift b/submodules/TelegramStringFormatting/Sources/Locale.swift
similarity index 76%
rename from submodules/TelegramUI/TelegramUI/Locale.swift
rename to submodules/TelegramStringFormatting/Sources/Locale.swift
index c8d6425612..468bd87bfc 100644
--- a/submodules/TelegramUI/TelegramUI/Locale.swift
+++ b/submodules/TelegramStringFormatting/Sources/Locale.swift
@@ -10,9 +10,9 @@ private let systemLocaleRegionSuffix: String = {
}
}()
-let usEnglishLocale = Locale(identifier: "en_US")
+public let usEnglishLocale = Locale(identifier: "en_US")
-func localeWithStrings(_ strings: PresentationStrings) -> Locale {
+public func localeWithStrings(_ strings: PresentationStrings) -> Locale {
let languageCode = strings.baseLanguageCode
let code = languageCode + systemLocaleRegionSuffix
return Locale(identifier: code)
diff --git a/submodules/TelegramStringFormatting/Sources/PresenceStrings.swift b/submodules/TelegramStringFormatting/Sources/PresenceStrings.swift
new file mode 100644
index 0000000000..5a3b88568c
--- /dev/null
+++ b/submodules/TelegramStringFormatting/Sources/PresenceStrings.swift
@@ -0,0 +1,404 @@
+import Foundation
+import Postbox
+import TelegramCore
+import TelegramPresentationData
+
+public func stringForTimestamp(day: Int32, month: Int32, year: Int32, dateTimeFormat: PresentationDateTimeFormat) -> String {
+ let separator = dateTimeFormat.dateSeparator
+ switch dateTimeFormat.dateFormat {
+ case .monthFirst:
+ return String(format: "%d%@%d%@%02d", month, separator, day, separator, year - 100)
+ case .dayFirst:
+ return String(format: "%d%@%02d%@%02d", day, separator, month, separator, year - 100)
+ }
+}
+
+public func stringForTimestamp(day: Int32, month: Int32, dateTimeFormat: PresentationDateTimeFormat) -> String {
+ let separator = dateTimeFormat.dateSeparator
+ switch dateTimeFormat.dateFormat {
+ case .monthFirst:
+ return String(format: "%d%@%d", month, separator, day)
+ case .dayFirst:
+ return String(format: "%d%@%02d", day, separator, month)
+ }
+}
+
+public func shortStringForDayOfWeek(strings: PresentationStrings, day: Int32) -> String {
+ switch day {
+ case 0:
+ return strings.Weekday_ShortSunday
+ case 1:
+ return strings.Weekday_ShortMonday
+ case 2:
+ return strings.Weekday_ShortTuesday
+ case 3:
+ return strings.Weekday_ShortWednesday
+ case 4:
+ return strings.Weekday_ShortThursday
+ case 5:
+ return strings.Weekday_ShortFriday
+ case 6:
+ return strings.Weekday_ShortSaturday
+ default:
+ return ""
+ }
+}
+
+public func stringForMonth(strings: PresentationStrings, month: Int32) -> String {
+ switch month {
+ case 0:
+ return strings.Month_GenJanuary
+ case 1:
+ return strings.Month_GenFebruary
+ case 2:
+ return strings.Month_GenMarch
+ case 3:
+ return strings.Month_GenApril
+ case 4:
+ return strings.Month_GenMay
+ case 5:
+ return strings.Month_GenJune
+ case 6:
+ return strings.Month_GenJuly
+ case 7:
+ return strings.Month_GenAugust
+ case 8:
+ return strings.Month_GenSeptember
+ case 9:
+ return strings.Month_GenOctober
+ case 10:
+ return strings.Month_GenNovember
+ case 11:
+ return strings.Month_GenDecember
+ default:
+ return ""
+ }
+}
+
+public func stringForMonth(strings: PresentationStrings, month: Int32, ofYear year: Int32) -> String {
+ let yearString = "\(1900 + year)"
+ switch month {
+ case 0:
+ return strings.Time_MonthOfYear_m1(yearString).0
+ case 1:
+ return strings.Time_MonthOfYear_m2(yearString).0
+ case 2:
+ return strings.Time_MonthOfYear_m3(yearString).0
+ case 3:
+ return strings.Time_MonthOfYear_m4(yearString).0
+ case 4:
+ return strings.Time_MonthOfYear_m5(yearString).0
+ case 5:
+ return strings.Time_MonthOfYear_m6(yearString).0
+ case 6:
+ return strings.Time_MonthOfYear_m7(yearString).0
+ case 7:
+ return strings.Time_MonthOfYear_m8(yearString).0
+ case 8:
+ return strings.Time_MonthOfYear_m9(yearString).0
+ case 9:
+ return strings.Time_MonthOfYear_m10(yearString).0
+ case 10:
+ return strings.Time_MonthOfYear_m11(yearString).0
+ default:
+ return strings.Time_MonthOfYear_m12(yearString).0
+ }
+}
+
+public enum RelativeTimestampFormatDay {
+ case today
+ case yesterday
+}
+
+public func stringForUserPresence(strings: PresentationStrings, day: RelativeTimestampFormatDay, dateTimeFormat: PresentationDateTimeFormat, hours: Int32, minutes: Int32) -> String {
+ let dayString: String
+ switch day {
+ case .today:
+ dayString = strings.LastSeen_AtDate(strings.Time_TodayAt(stringForShortTimestamp(hours: hours, minutes: minutes, dateTimeFormat: dateTimeFormat)).0).0
+ case .yesterday:
+ dayString = strings.LastSeen_YesterdayAt(stringForShortTimestamp(hours: hours, minutes: minutes, dateTimeFormat: dateTimeFormat)).0
+ }
+ return dayString
+}
+
+private func humanReadableStringForTimestamp(strings: PresentationStrings, day: RelativeTimestampFormatDay, dateTimeFormat: PresentationDateTimeFormat, hours: Int32, minutes: Int32) -> String {
+ let dayString: String
+ switch day {
+ case .today:
+ dayString = strings.Time_TodayAt(stringForShortTimestamp(hours: hours, minutes: minutes, dateTimeFormat: dateTimeFormat)).0
+ case .yesterday:
+ dayString = strings.Time_YesterdayAt(stringForShortTimestamp(hours: hours, minutes: minutes, dateTimeFormat: dateTimeFormat)).0
+ }
+ return dayString
+}
+
+public func humanReadableStringForTimestamp(strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, timestamp: Int32) -> String {
+ var t: time_t = time_t(timestamp)
+ var timeinfo: tm = tm()
+ localtime_r(&t, &timeinfo)
+
+ let timestampNow = Int32(CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970)
+ var now: time_t = time_t(timestampNow)
+ var timeinfoNow: tm = tm()
+ localtime_r(&now, &timeinfoNow)
+
+ if timeinfo.tm_year != timeinfoNow.tm_year {
+ return "\(stringForTimestamp(day: timeinfo.tm_mday, month: timeinfo.tm_mon + 1, year: timeinfo.tm_year, dateTimeFormat: dateTimeFormat))"
+ }
+
+ let dayDifference = timeinfo.tm_yday - timeinfoNow.tm_yday
+ if dayDifference == 0 || dayDifference == -1 {
+ let day: RelativeTimestampFormatDay
+ if dayDifference == 0 {
+ day = .today
+ } else {
+ day = .yesterday
+ }
+ return humanReadableStringForTimestamp(strings: strings, day: day, dateTimeFormat: dateTimeFormat, hours: timeinfo.tm_hour, minutes: timeinfo.tm_min)
+ } else {
+ return "\(stringForTimestamp(day: timeinfo.tm_mday, month: timeinfo.tm_mon + 1, year: timeinfo.tm_year, dateTimeFormat: dateTimeFormat))"
+ }
+}
+
+public enum RelativeUserPresenceLastSeen {
+ case justNow
+ case minutesAgo(Int32)
+ case hoursAgo(Int32)
+ case todayAt(hours: Int32, minutes: Int32)
+ case yesterdayAt(hours: Int32, minutes: Int32)
+ case thisYear(month: Int32, day: Int32)
+ case atDate(year: Int32, month: Int32)
+}
+
+public enum RelativeUserPresenceStatus {
+ case offline
+ case online(at: Int32)
+ case lastSeen(at: Int32)
+ case recently
+ case lastWeek
+ case lastMonth
+}
+
+public func relativeUserPresenceStatus(_ presence: TelegramUserPresence, relativeTo timestamp: Int32) -> RelativeUserPresenceStatus {
+ switch presence.status {
+ case .none:
+ return .offline
+ case let .present(statusTimestamp):
+ if statusTimestamp >= timestamp {
+ return .online(at: statusTimestamp)
+ } else {
+ return .lastSeen(at: statusTimestamp)
+ }
+ case .recently:
+ let activeUntil = presence.lastActivity + 30
+ if activeUntil >= timestamp {
+ return .online(at: activeUntil)
+ } else {
+ return .recently
+ }
+ case .lastWeek:
+ return .lastWeek
+ case .lastMonth:
+ return .lastMonth
+ }
+}
+
+public func stringForRelativeTimestamp(strings: PresentationStrings, relativeTimestamp: Int32, relativeTo timestamp: Int32, dateTimeFormat: PresentationDateTimeFormat) -> String {
+ var t: time_t = time_t(relativeTimestamp)
+ var timeinfo: tm = tm()
+ localtime_r(&t, &timeinfo)
+
+ var now: time_t = time_t(timestamp)
+ var timeinfoNow: tm = tm()
+ localtime_r(&now, &timeinfoNow)
+
+ if timeinfo.tm_year != timeinfoNow.tm_year {
+ return stringForTimestamp(day: timeinfo.tm_mday, month: timeinfo.tm_mon + 1, year: timeinfo.tm_year, dateTimeFormat: dateTimeFormat)
+ }
+
+ let dayDifference = timeinfo.tm_yday - timeinfoNow.tm_yday
+ if dayDifference > -7 {
+ if dayDifference == 0 {
+ return stringForShortTimestamp(hours: timeinfo.tm_hour, minutes: timeinfo.tm_min, dateTimeFormat: dateTimeFormat)
+ } else {
+ return shortStringForDayOfWeek(strings: strings, day: timeinfo.tm_wday)
+ }
+ } else {
+ return stringForTimestamp(day: timeinfo.tm_mday, month: timeinfo.tm_mon + 1, dateTimeFormat: dateTimeFormat)
+ }
+}
+
+public func stringForRelativeLiveLocationTimestamp(strings: PresentationStrings, relativeTimestamp: Int32, relativeTo timestamp: Int32, dateTimeFormat: PresentationDateTimeFormat) -> String {
+ let difference = timestamp - relativeTimestamp
+ if difference < 60 {
+ return strings.LiveLocationUpdated_JustNow
+ } else if difference < 60 * 60 {
+ let minutes = difference / 60
+ return strings.LiveLocationUpdated_MinutesAgo(minutes)
+ } else {
+ var t: time_t = time_t(relativeTimestamp)
+ var timeinfo: tm = tm()
+ localtime_r(&t, &timeinfo)
+
+ var now: time_t = time_t(timestamp)
+ var timeinfoNow: tm = tm()
+ localtime_r(&now, &timeinfoNow)
+
+ let dayDifference = timeinfo.tm_yday - timeinfoNow.tm_yday
+
+ let hours = timeinfo.tm_hour
+ let minutes = timeinfo.tm_min
+
+ if dayDifference == 0 {
+ return strings.LiveLocationUpdated_TodayAt(stringForShortTimestamp(hours: hours, minutes: minutes, dateTimeFormat: dateTimeFormat)).0
+ } else {
+ return stringForFullDate(timestamp: relativeTimestamp, strings: strings, dateTimeFormat: dateTimeFormat)
+ }
+ }
+}
+
+public func stringForRelativeSymbolicTimestamp(strings: PresentationStrings, relativeTimestamp: Int32, relativeTo timestamp: Int32, dateTimeFormat: PresentationDateTimeFormat) -> String {
+ var t: time_t = time_t(relativeTimestamp)
+ var timeinfo: tm = tm()
+ localtime_r(&t, &timeinfo)
+
+ var now: time_t = time_t(timestamp)
+ var timeinfoNow: tm = tm()
+ localtime_r(&now, &timeinfoNow)
+
+ let dayDifference = timeinfo.tm_yday - timeinfoNow.tm_yday
+
+ let hours = timeinfo.tm_hour
+ let minutes = timeinfo.tm_min
+
+ if dayDifference == 0 {
+ return strings.Time_TodayAt(stringForShortTimestamp(hours: hours, minutes: minutes, dateTimeFormat: dateTimeFormat)).0
+ } else {
+ return stringForFullDate(timestamp: relativeTimestamp, strings: strings, dateTimeFormat: dateTimeFormat)
+ }
+}
+
+public func stringForRelativeLiveLocationUpdateTimestamp(strings: PresentationStrings, relativeTimestamp: Int32, relativeTo timestamp: Int32, dateTimeFormat: PresentationDateTimeFormat) -> String {
+ var t: time_t = time_t(relativeTimestamp)
+ var timeinfo: tm = tm()
+ localtime_r(&t, &timeinfo)
+
+ var now: time_t = time_t(timestamp)
+ var timeinfoNow: tm = tm()
+ localtime_r(&now, &timeinfoNow)
+
+ if timeinfo.tm_year != timeinfoNow.tm_year {
+ return stringForTimestamp(day: timeinfo.tm_mday, month: timeinfo.tm_mon + 1, year: timeinfo.tm_year, dateTimeFormat: dateTimeFormat)
+ }
+
+ let dayDifference = timeinfo.tm_yday - timeinfoNow.tm_yday
+ if dayDifference > -7 {
+ if dayDifference == 0 {
+ return stringForShortTimestamp(hours: timeinfo.tm_hour, minutes: timeinfo.tm_min, dateTimeFormat: dateTimeFormat)
+ } else {
+ return shortStringForDayOfWeek(strings: strings, day: timeinfo.tm_wday)
+ }
+ } else {
+ return stringForTimestamp(day: timeinfo.tm_mday, month: timeinfo.tm_mon + 1, dateTimeFormat: dateTimeFormat)
+ }
+}
+
+public func stringAndActivityForUserPresence(strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, presence: TelegramUserPresence, relativeTo timestamp: Int32, expanded: Bool = false) -> (String, Bool) {
+ switch presence.status {
+ case .none:
+ return (strings.LastSeen_Offline, false)
+ case let .present(statusTimestamp):
+ if statusTimestamp >= timestamp {
+ return (strings.Presence_online, true)
+ } else {
+ let difference = timestamp - statusTimestamp
+ if difference < 60 {
+ return (strings.LastSeen_JustNow, false)
+ } else if difference < 60 * 60 && !expanded {
+ let minutes = difference / 60
+ return (strings.LastSeen_MinutesAgo(minutes), false)
+ } else {
+ var t: time_t = time_t(statusTimestamp)
+ var timeinfo: tm = tm()
+ localtime_r(&t, &timeinfo)
+
+ var now: time_t = time_t(timestamp)
+ var timeinfoNow: tm = tm()
+ localtime_r(&now, &timeinfoNow)
+
+ if timeinfo.tm_year != timeinfoNow.tm_year {
+ return (strings.LastSeen_AtDate(stringForTimestamp(day: timeinfo.tm_mday, month: timeinfo.tm_mon + 1, year: timeinfo.tm_year, dateTimeFormat: dateTimeFormat)).0, false)
+ }
+
+ let dayDifference = timeinfo.tm_yday - timeinfoNow.tm_yday
+ if dayDifference == 0 || dayDifference == -1 {
+ let day: RelativeTimestampFormatDay
+ if dayDifference == 0 {
+ if expanded {
+ day = .today
+ } else {
+ let minutes = difference / (60 * 60)
+ return (strings.LastSeen_HoursAgo(minutes), false)
+ }
+ } else {
+ day = .yesterday
+ }
+ return (stringForUserPresence(strings: strings, day: day, dateTimeFormat: dateTimeFormat, hours: timeinfo.tm_hour, minutes: timeinfo.tm_min), false)
+ } else {
+ return (strings.LastSeen_AtDate(stringForTimestamp(day: timeinfo.tm_mday, month: timeinfo.tm_mon + 1, year: timeinfo.tm_year, dateTimeFormat: dateTimeFormat)).0, false)
+ }
+ }
+ }
+ case .recently:
+ let activeUntil = presence.lastActivity + 30
+ if activeUntil >= timestamp {
+ return (strings.Presence_online, true)
+ } else {
+ return (strings.LastSeen_Lately, false)
+ }
+ case .lastWeek:
+ return (strings.LastSeen_WithinAWeek, false)
+ case .lastMonth:
+ return (strings.LastSeen_WithinAMonth, false)
+ }
+}
+
+public func userPresenceStringRefreshTimeout(_ presence: TelegramUserPresence, relativeTo timestamp: Int32) -> Double {
+ switch presence.status {
+ case let .present(statusTimestamp):
+ if statusTimestamp >= timestamp {
+ return Double(statusTimestamp - timestamp)
+ } else {
+ let difference = timestamp - statusTimestamp
+ if difference < 30 {
+ return Double((30 - difference) + 1)
+ } else if difference < 60 * 60 {
+ return Double((difference % 60) + 1)
+ } else {
+ return Double.infinity
+ }
+ }
+ case .recently:
+ let activeUntil = presence.lastActivity + 30
+ if activeUntil >= timestamp {
+ return Double(activeUntil - timestamp + 1)
+ } else {
+ return Double.infinity
+ }
+ case .none, .lastWeek, .lastMonth:
+ return Double.infinity
+ }
+}
+
+
+public func stringForRemainingMuteInterval(strings: PresentationStrings, muteInterval value: Int32) -> String {
+ let timestamp = Int32(CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970)
+ let value = max(1 * 60, value - timestamp)
+ if value <= 1 * 60 * 60 {
+ return strings.MuteExpires_Minutes(Int32(round(Float(value) / 60)))
+ } else if value <= 24 * 60 * 60 {
+ return strings.MuteExpires_Hours(Int32(round(Float(value) / (60 * 60))))
+ } else {
+ return strings.MuteExpires_Days(Int32(round(Float(value) / (24 * 60 * 60))))
+ }
+}
diff --git a/submodules/TelegramStringFormatting/Sources/TelegramStringFormatting.h b/submodules/TelegramStringFormatting/Sources/TelegramStringFormatting.h
new file mode 100644
index 0000000000..aed00e9d38
--- /dev/null
+++ b/submodules/TelegramStringFormatting/Sources/TelegramStringFormatting.h
@@ -0,0 +1,19 @@
+//
+// TelegramStringFormatting.h
+// TelegramStringFormatting
+//
+// Created by Peter on 8/4/19.
+// Copyright © 2019 Telegram Messenger LLP. All rights reserved.
+//
+
+#import
+
+//! Project version number for TelegramStringFormatting.
+FOUNDATION_EXPORT double TelegramStringFormattingVersionNumber;
+
+//! Project version string for TelegramStringFormatting.
+FOUNDATION_EXPORT const unsigned char TelegramStringFormattingVersionString[];
+
+// In this header, you should import all the public headers of your framework using statements like #import
+
+
diff --git a/submodules/TelegramStringFormatting/TelegramStringFormatting_Xcode.xcodeproj/project.pbxproj b/submodules/TelegramStringFormatting/TelegramStringFormatting_Xcode.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..ba37255c56
--- /dev/null
+++ b/submodules/TelegramStringFormatting/TelegramStringFormatting_Xcode.xcodeproj/project.pbxproj
@@ -0,0 +1,567 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 50;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ D0879AB222F7021000C4D6B3 /* TelegramStringFormatting.h in Headers */ = {isa = PBXBuildFile; fileRef = D0879AB022F7021000C4D6B3 /* TelegramStringFormatting.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ D0879ABD22F705AE00C4D6B3 /* PresenceStrings.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879ABC22F705AE00C4D6B3 /* PresenceStrings.swift */; };
+ D0879AC022F705B800C4D6B3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879ABF22F705B800C4D6B3 /* Foundation.framework */; };
+ D0879AC222F705BB00C4D6B3 /* Postbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879AC122F705BB00C4D6B3 /* Postbox.framework */; };
+ D0879AC422F705BE00C4D6B3 /* TelegramCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879AC322F705BE00C4D6B3 /* TelegramCore.framework */; };
+ D0879AC622F705C300C4D6B3 /* TelegramPresentationData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879AC522F705C300C4D6B3 /* TelegramPresentationData.framework */; };
+ D0879ACA22F7063300C4D6B3 /* DateFormat.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879AC922F7063300C4D6B3 /* DateFormat.swift */; };
+ D0879ACC22F7064000C4D6B3 /* TelegramUIPreferences.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0879ACB22F7064000C4D6B3 /* TelegramUIPreferences.framework */; };
+ D0879ACE22F7069200C4D6B3 /* Locale.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0879ACD22F7069200C4D6B3 /* Locale.swift */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ D0879AAD22F7021000C4D6B3 /* TelegramStringFormatting.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TelegramStringFormatting.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879AB022F7021000C4D6B3 /* TelegramStringFormatting.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TelegramStringFormatting.h; sourceTree = ""; };
+ D0879AB122F7021000C4D6B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ D0879ABC22F705AE00C4D6B3 /* PresenceStrings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PresenceStrings.swift; sourceTree = ""; };
+ D0879ABF22F705B800C4D6B3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ D0879AC122F705BB00C4D6B3 /* Postbox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Postbox.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879AC322F705BE00C4D6B3 /* TelegramCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879AC522F705C300C4D6B3 /* TelegramPresentationData.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramPresentationData.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879AC922F7063300C4D6B3 /* DateFormat.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DateFormat.swift; sourceTree = ""; };
+ D0879ACB22F7064000C4D6B3 /* TelegramUIPreferences.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TelegramUIPreferences.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0879ACD22F7069200C4D6B3 /* Locale.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Locale.swift; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ D0879AAA22F7021000C4D6B3 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879ACC22F7064000C4D6B3 /* TelegramUIPreferences.framework in Frameworks */,
+ D0879AC622F705C300C4D6B3 /* TelegramPresentationData.framework in Frameworks */,
+ D0879AC422F705BE00C4D6B3 /* TelegramCore.framework in Frameworks */,
+ D0879AC222F705BB00C4D6B3 /* Postbox.framework in Frameworks */,
+ D0879AC022F705B800C4D6B3 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ D0879AA322F7021000C4D6B3 = {
+ isa = PBXGroup;
+ children = (
+ D0879AB122F7021000C4D6B3 /* Info.plist */,
+ D0879AAF22F7021000C4D6B3 /* Sources */,
+ D0879AAE22F7021000C4D6B3 /* Products */,
+ D0879ABE22F705B700C4D6B3 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ D0879AAE22F7021000C4D6B3 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ D0879AAD22F7021000C4D6B3 /* TelegramStringFormatting.framework */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ D0879AAF22F7021000C4D6B3 /* Sources */ = {
+ isa = PBXGroup;
+ children = (
+ D0879ACD22F7069200C4D6B3 /* Locale.swift */,
+ D0879AC922F7063300C4D6B3 /* DateFormat.swift */,
+ D0879ABC22F705AE00C4D6B3 /* PresenceStrings.swift */,
+ D0879AB022F7021000C4D6B3 /* TelegramStringFormatting.h */,
+ );
+ path = Sources;
+ sourceTree = "";
+ };
+ D0879ABE22F705B700C4D6B3 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ D0879ACB22F7064000C4D6B3 /* TelegramUIPreferences.framework */,
+ D0879AC522F705C300C4D6B3 /* TelegramPresentationData.framework */,
+ D0879AC322F705BE00C4D6B3 /* TelegramCore.framework */,
+ D0879AC122F705BB00C4D6B3 /* Postbox.framework */,
+ D0879ABF22F705B800C4D6B3 /* Foundation.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ D0879AA822F7021000C4D6B3 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879AB222F7021000C4D6B3 /* TelegramStringFormatting.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ D0879AAC22F7021000C4D6B3 /* TelegramStringFormatting */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D0879AB522F7021000C4D6B3 /* Build configuration list for PBXNativeTarget "TelegramStringFormatting" */;
+ buildPhases = (
+ D0879AA822F7021000C4D6B3 /* Headers */,
+ D0879AA922F7021000C4D6B3 /* Sources */,
+ D0879AAA22F7021000C4D6B3 /* Frameworks */,
+ D0879AAB22F7021000C4D6B3 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = TelegramStringFormatting;
+ productName = TelegramStringFormatting;
+ productReference = D0879AAD22F7021000C4D6B3 /* TelegramStringFormatting.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ D0879AA422F7021000C4D6B3 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ DefaultBuildSystemTypeForWorkspace = Latest;
+ LastUpgradeCheck = 1030;
+ ORGANIZATIONNAME = "Telegram Messenger LLP";
+ TargetAttributes = {
+ D0879AAC22F7021000C4D6B3 = {
+ CreatedOnToolsVersion = 10.3;
+ LastSwiftMigration = 1030;
+ };
+ };
+ };
+ buildConfigurationList = D0879AA722F7021000C4D6B3 /* Build configuration list for PBXProject "TelegramStringFormatting_Xcode" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = D0879AA322F7021000C4D6B3;
+ productRefGroup = D0879AAE22F7021000C4D6B3 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ D0879AAC22F7021000C4D6B3 /* TelegramStringFormatting */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ D0879AAB22F7021000C4D6B3 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ D0879AA922F7021000C4D6B3 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0879ACA22F7063300C4D6B3 /* DateFormat.swift in Sources */,
+ D0879ABD22F705AE00C4D6B3 /* PresenceStrings.swift in Sources */,
+ D0879ACE22F7069200C4D6B3 /* Locale.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ D0879AB322F7021000C4D6B3 /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0879AB422F7021000C4D6B3 /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0879AB622F7021000C4D6B3 /* DebugAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.TelegramStringFormatting;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugAppStoreLLC;
+ };
+ D0879AB722F7021000C4D6B3 /* ReleaseAppStoreLLC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.TelegramStringFormatting;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseAppStoreLLC;
+ };
+ D0879AB822F7023200C4D6B3 /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = DebugHockeyapp;
+ };
+ D0879AB922F7023200C4D6B3 /* DebugHockeyapp */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.TelegramStringFormatting;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = DebugHockeyapp;
+ };
+ D0879ABA22F7023D00C4D6B3 /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+ D0879ABB22F7023D00C4D6B3 /* ReleaseHockeyappInternal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "";
+ CODE_SIGN_STYLE = Manual;
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = "";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ MACH_O_TYPE = staticlib;
+ PRODUCT_BUNDLE_IDENTIFIER = org.telegram.TelegramStringFormatting;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = ReleaseHockeyappInternal;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ D0879AA722F7021000C4D6B3 /* Build configuration list for PBXProject "TelegramStringFormatting_Xcode" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0879AB322F7021000C4D6B3 /* DebugAppStoreLLC */,
+ D0879AB822F7023200C4D6B3 /* DebugHockeyapp */,
+ D0879AB422F7021000C4D6B3 /* ReleaseAppStoreLLC */,
+ D0879ABA22F7023D00C4D6B3 /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+ D0879AB522F7021000C4D6B3 /* Build configuration list for PBXNativeTarget "TelegramStringFormatting" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0879AB622F7021000C4D6B3 /* DebugAppStoreLLC */,
+ D0879AB922F7023200C4D6B3 /* DebugHockeyapp */,
+ D0879AB722F7021000C4D6B3 /* ReleaseAppStoreLLC */,
+ D0879ABB22F7023D00C4D6B3 /* ReleaseHockeyappInternal */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = ReleaseAppStoreLLC;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = D0879AA422F7021000C4D6B3 /* Project object */;
+}
diff --git a/submodules/TelegramUI/TelegramUI/Accessibility.swift b/submodules/TelegramUI/TelegramUI/Accessibility.swift
deleted file mode 100644
index 7422ccb13e..0000000000
--- a/submodules/TelegramUI/TelegramUI/Accessibility.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-import SwiftSignalKit
-import UIKit
-
-func smartInvertColorsEnabled() -> Bool {
- if #available(iOSApplicationExtension 11.0, iOS 11.0, *), UIAccessibility.isInvertColorsEnabled {
- return true
- } else {
- return false
- }
-}
-
-func reduceMotionEnabled() -> Signal {
- return Signal { subscriber in
- subscriber.putNext(UIAccessibility.isReduceMotionEnabled)
-
- let observer = NotificationCenter.default.addObserver(forName: UIAccessibility.reduceMotionStatusDidChangeNotification, object: nil, queue: .main, using: { _ in
- subscriber.putNext(UIAccessibility.isReduceMotionEnabled)
- })
-
- return ActionDisposable {
- Queue.mainQueue().async {
- NotificationCenter.default.removeObserver(observer)
- }
- }
- } |> runOn(Queue.mainQueue())
-}
-
-func boldTextEnabled() -> Signal {
- return Signal { subscriber in
- subscriber.putNext(UIAccessibility.isBoldTextEnabled)
-
- let observer = NotificationCenter.default.addObserver(forName: UIAccessibility.boldTextStatusDidChangeNotification, object: nil, queue: .main, using: { _ in
- subscriber.putNext(UIAccessibility.isBoldTextEnabled)
- })
-
- return ActionDisposable {
- Queue.mainQueue().async {
- NotificationCenter.default.removeObserver(observer)
- }
- }
- } |> runOn(Queue.mainQueue())
-}
-
-private func checkButtonShapes() -> Bool {
- let button = UIButton()
- button.setTitle("title", for: .normal)
-
- if let attributes = button.titleLabel?.attributedText?.attributes(at: 0, effectiveRange: nil), let _ = attributes[NSAttributedString.Key.underlineStyle] {
- return true
- } else {
- return false
- }
-}
diff --git a/submodules/TelegramUI/TelegramUI/AccountContext.swift b/submodules/TelegramUI/TelegramUI/AccountContext.swift
index 3dfb00eada..d219e4832f 100644
--- a/submodules/TelegramUI/TelegramUI/AccountContext.swift
+++ b/submodules/TelegramUI/TelegramUI/AccountContext.swift
@@ -7,6 +7,8 @@ import Display
import DeviceAccess
import TelegramPresentationData
import AccountContext
+import LiveLocationManager
+import TemporaryCachedPeerDataManager
private final class DeviceSpecificContactImportContext {
let disposable = MetaDisposable()
@@ -94,9 +96,9 @@ private final class DeviceSpecificContactImportContexts {
}
public final class AccountContextImpl: AccountContext {
- public let sharedContext: SharedAccountContextImpl
- public var genericSharedContext: SharedAccountContext {
- return self.sharedContext
+ public let sharedContextImpl: SharedAccountContextImpl
+ public var sharedContext: SharedAccountContext {
+ return self.sharedContextImpl
}
public let account: Account
@@ -105,12 +107,12 @@ public final class AccountContextImpl: AccountContext {
public var keyShortcutsController: KeyShortcutsController?
- let downloadedMediaStoreManager: DownloadedMediaStoreManager
+ public let downloadedMediaStoreManager: DownloadedMediaStoreManager
public let liveLocationManager: LiveLocationManager?
- let wallpaperUploadManager: WallpaperUploadManager?
+ public let wallpaperUploadManager: WallpaperUploadManager?
- let peerChannelMemberCategoriesContextsManager = PeerChannelMemberCategoriesContextsManager()
+ public let peerChannelMemberCategoriesContextsManager = PeerChannelMemberCategoriesContextsManager()
public let currentLimitsConfiguration: Atomic
private let _limitsConfiguration = Promise()
@@ -127,20 +129,20 @@ public final class AccountContextImpl: AccountContext {
private var managedAppSpecificContactsDisposable: Disposable?
public init(sharedContext: SharedAccountContextImpl, account: Account, limitsConfiguration: LimitsConfiguration) {
- self.sharedContext = sharedContext
+ self.sharedContextImpl = sharedContext
self.account = account
- self.downloadedMediaStoreManager = DownloadedMediaStoreManager(postbox: account.postbox, accountManager: sharedContext.accountManager)
+ self.downloadedMediaStoreManager = DownloadedMediaStoreManagerImpl(postbox: account.postbox, accountManager: sharedContext.accountManager)
- if let locationManager = self.sharedContext.locationManager {
- self.liveLocationManager = LiveLocationManager(postbox: account.postbox, network: account.network, accountPeerId: account.peerId, viewTracker: account.viewTracker, stateManager: account.stateManager, locationManager: locationManager, inForeground: self.sharedContext.applicationBindings.applicationInForeground)
+ if let locationManager = self.sharedContextImpl.locationManager {
+ self.liveLocationManager = LiveLocationManagerImpl(postbox: account.postbox, network: account.network, accountPeerId: account.peerId, viewTracker: account.viewTracker, stateManager: account.stateManager, locationManager: locationManager, inForeground: sharedContext.applicationBindings.applicationInForeground)
} else {
self.liveLocationManager = nil
}
- self.fetchManager = FetchManager(postbox: account.postbox, storeManager: self.downloadedMediaStoreManager)
+ self.fetchManager = FetchManagerImpl(postbox: account.postbox, storeManager: self.downloadedMediaStoreManager)
if sharedContext.applicationBindings.isMainApp {
- self.prefetchManager = PrefetchManager(sharedContext: sharedContext, account: account, fetchManager: fetchManager)
- self.wallpaperUploadManager = WallpaperUploadManager(sharedContext: sharedContext, account: account, presentationData: sharedContext.presentationData)
+ self.prefetchManager = PrefetchManager(sharedContext: sharedContext, account: account, fetchManager: self.fetchManager)
+ self.wallpaperUploadManager = WallpaperUploadManagerImpl(sharedContext: sharedContext, account: account, presentationData: sharedContext.presentationData)
} else {
self.prefetchManager = nil
self.wallpaperUploadManager = nil
diff --git a/submodules/TelegramUI/TelegramUI/AccountUtils.swift b/submodules/TelegramUI/TelegramUI/AccountUtils.swift
index 613e280f19..dea14726ec 100644
--- a/submodules/TelegramUI/TelegramUI/AccountUtils.swift
+++ b/submodules/TelegramUI/TelegramUI/AccountUtils.swift
@@ -3,8 +3,9 @@ import SwiftSignalKit
import Postbox
import TelegramCore
import TelegramUIPreferences
+import AccountContext
-func activeAccountsAndPeers(context: AccountContextImpl) -> Signal<((Account, Peer)?, [(Account, Peer, Int32)]), NoError> {
+func activeAccountsAndPeers(context: AccountContext) -> Signal<((Account, Peer)?, [(Account, Peer, Int32)]), NoError> {
let sharedContext = context.sharedContext
return context.sharedContext.activeAccounts
|> mapToSignal { primary, activeAccounts, _ -> Signal<((Account, Peer)?, [(Account, Peer, Int32)]), NoError> in
diff --git a/submodules/TelegramUI/TelegramUI/ActionSheetPeerItem.swift b/submodules/TelegramUI/TelegramUI/ActionSheetPeerItem.swift
index c5a7138f12..0804fdd2c8 100644
--- a/submodules/TelegramUI/TelegramUI/ActionSheetPeerItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ActionSheetPeerItem.swift
@@ -5,6 +5,7 @@ import Display
import TelegramCore
import Postbox
import TelegramPresentationData
+import AvatarNode
public class ActionSheetPeerItem: ActionSheetItem {
public let account: Account
diff --git a/submodules/TelegramUI/TelegramUI/AppDelegate.swift b/submodules/TelegramUI/TelegramUI/AppDelegate.swift
index f1259e2f48..a49b99e764 100644
--- a/submodules/TelegramUI/TelegramUI/AppDelegate.swift
+++ b/submodules/TelegramUI/TelegramUI/AppDelegate.swift
@@ -16,6 +16,7 @@ import TelegramVoip
import BuildConfig
import DeviceCheck
import AccountContext
+import OverlayStatusController
private let handleVoipNotifications = false
@@ -114,7 +115,7 @@ private class ApplicationStatusBarHost: StatusBarHost {
}
var handleVolumeControl: Signal {
- return MediaManager.globalAudioSession.isPlaybackActive()
+ return MediaManagerImpl.globalAudioSession.isPlaybackActive()
}
}
@@ -139,13 +140,13 @@ final class SharedApplicationContext {
let sharedContext: SharedAccountContextImpl
let notificationManager: SharedNotificationManager
let wakeupManager: SharedWakeupManager
- let overlayMediaController: OverlayMediaController
+ let overlayMediaController: ViewController & OverlayMediaController
init(sharedContext: SharedAccountContextImpl, notificationManager: SharedNotificationManager, wakeupManager: SharedWakeupManager) {
self.sharedContext = sharedContext
self.notificationManager = notificationManager
self.wakeupManager = wakeupManager
- self.overlayMediaController = OverlayMediaController()
+ self.overlayMediaController = OverlayMediaControllerImpl()
}
}
@@ -348,7 +349,7 @@ final class SharedApplicationContext {
let apiId: Int32 = buildConfig.apiId
let languagesCategory = "ios"
- let networkArguments = NetworkInitializationArguments(apiId: apiId, languagesCategory: languagesCategory, appVersion: appVersion, voipMaxLayer: PresentationCallManager.voipMaxLayer, appData: self.deviceToken.get() |> map { token in
+ let networkArguments = NetworkInitializationArguments(apiId: apiId, languagesCategory: languagesCategory, appVersion: appVersion, voipMaxLayer: PresentationCallManagerImpl.voipMaxLayer, appData: self.deviceToken.get() |> map { token in
return buildConfig.bundleData(withAppToken: token)
})
@@ -435,7 +436,7 @@ final class SharedApplicationContext {
self.window?.makeKeyAndVisible()
- self.hasActiveAudioSession.set(MediaManager.globalAudioSession.isActive())
+ self.hasActiveAudioSession.set(MediaManagerImpl.globalAudioSession.isActive())
initializeAccountManagement()
diff --git a/submodules/TelegramUI/TelegramUI/ApplicationContext.swift b/submodules/TelegramUI/TelegramUI/ApplicationContext.swift
index 294e15961c..993633800c 100644
--- a/submodules/TelegramUI/TelegramUI/ApplicationContext.swift
+++ b/submodules/TelegramUI/TelegramUI/ApplicationContext.swift
@@ -9,6 +9,7 @@ import Display
import LegacyComponents
import DeviceAccess
import TelegramUpdateUI
+import AccountContext
func isAccessLocked(data: PostboxAccessChallengeData, at timestamp: Int32) -> Bool {
if data.isLockable, let autolockDeadline = data.autolockDeadline, autolockDeadline <= timestamp {
@@ -760,7 +761,7 @@ final class AuthorizedApplicationContext {
return
}
- let watchManager = WatchManager(arguments: arguments)
+ let watchManager = WatchManagerImpl(arguments: arguments)
strongSelf.context.watchManager = watchManager
strongSelf.watchNavigateToMessageDisposable.set((strongSelf.context.sharedContext.applicationBindings.applicationInForeground |> mapToSignal({ applicationInForeground -> Signal<(Bool, MessageId), NoError> in
diff --git a/submodules/TelegramUI/TelegramUI/ArchivedStickerPacksController.swift b/submodules/TelegramUI/TelegramUI/ArchivedStickerPacksController.swift
index f5a5650b82..4cb56f3f09 100644
--- a/submodules/TelegramUI/TelegramUI/ArchivedStickerPacksController.swift
+++ b/submodules/TelegramUI/TelegramUI/ArchivedStickerPacksController.swift
@@ -7,6 +7,8 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import OverlayStatusController
+import AccountContext
public enum ArchivedStickerPacksControllerMode {
case stickers
@@ -233,7 +235,7 @@ private func archivedStickerPacksControllerEntries(presentationData: Presentatio
return entries
}
-public func archivedStickerPacksController(context: AccountContextImpl, mode: ArchivedStickerPacksControllerMode, archived: [ArchivedStickerPackItem]?, updatedPacks: @escaping ([ArchivedStickerPackItem]?) -> Void) -> ViewController {
+public func archivedStickerPacksController(context: AccountContext, mode: ArchivedStickerPacksControllerMode, archived: [ArchivedStickerPackItem]?, updatedPacks: @escaping ([ArchivedStickerPackItem]?) -> Void) -> ViewController {
let statePromise = ValuePromise(ArchivedStickerPacksControllerState(), ignoreRepeated: true)
let stateValue = Atomic(value: ArchivedStickerPacksControllerState())
let updateState: ((ArchivedStickerPacksControllerState) -> ArchivedStickerPacksControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceController.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceController.swift
index c5063240d6..3506a140e5 100644
--- a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceController.swift
+++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceController.swift
@@ -14,6 +14,7 @@ import MessageUI
import CoreTelephony
import TelegramPresentationData
import TextFormat
+import AccountContext
private enum InnerState: Equatable {
case state(UnauthorizedAccountStateContents)
@@ -25,7 +26,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail
return NavigationBarTheme(buttonColor: theme.rootController.navigationBar.buttonColor, disabledButtonColor: theme.rootController.navigationBar.disabledButtonColor, primaryTextColor: theme.rootController.navigationBar.primaryTextColor, backgroundColor: .clear, separatorColor: .clear, badgeBackgroundColor: theme.rootController.navigationBar.badgeBackgroundColor, badgeStrokeColor: theme.rootController.navigationBar.badgeStrokeColor, badgeTextColor: theme.rootController.navigationBar.badgeTextColor)
}
- private let sharedContext: SharedAccountContextImpl
+ private let sharedContext: SharedAccountContext
private var account: UnauthorizedAccount
private let otherAccountPhoneNumbers: ((String, AccountRecordId, Bool)?, [(String, AccountRecordId, Bool)])
private let apiId: Int32
@@ -45,7 +46,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail
}
private var didSetReady = false
- public init(sharedContext: SharedAccountContextImpl, account: UnauthorizedAccount, otherAccountPhoneNumbers: ((String, AccountRecordId, Bool)?, [(String, AccountRecordId, Bool)]), strings: PresentationStrings, theme: PresentationTheme, openUrl: @escaping (String) -> Void, apiId: Int32, apiHash: String) {
+ public init(sharedContext: SharedAccountContext, account: UnauthorizedAccount, otherAccountPhoneNumbers: ((String, AccountRecordId, Bool)?, [(String, AccountRecordId, Bool)]), strings: PresentationStrings, theme: PresentationTheme, openUrl: @escaping (String) -> Void, apiId: Int32, apiHash: String) {
self.sharedContext = sharedContext
self.account = account
self.otherAccountPhoneNumbers = otherAccountPhoneNumbers
diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCountrySelectionController.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCountrySelectionController.swift
index d96cb7fb2a..f431dbb9eb 100644
--- a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCountrySelectionController.swift
+++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCountrySelectionController.swift
@@ -3,6 +3,7 @@ import UIKit
import Display
import AsyncDisplayKit
import TelegramPresentationData
+import TelegramStringFormatting
private func loadCountryCodes() -> [(String, Int)] {
guard let filePath = frameworkBundle.path(forResource: "PhoneCountries", ofType: "txt") else {
diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCountrySelectionControllerNode.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCountrySelectionControllerNode.swift
index 4d3668640d..4f005b50a3 100644
--- a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCountrySelectionControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCountrySelectionControllerNode.swift
@@ -4,6 +4,7 @@ import AsyncDisplayKit
import Display
import TelegramCore
import TelegramPresentationData
+import TelegramStringFormatting
private func loadCountryCodes() -> [(String, Int)] {
guard let filePath = frameworkBundle.path(forResource: "PhoneCountries", ofType: "txt") else {
diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryController.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryController.swift
index dad88ef035..8e6223034e 100644
--- a/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryController.swift
+++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryController.swift
@@ -7,13 +7,14 @@ import TelegramCore
import Postbox
import TelegramPresentationData
import ProgressNavigationButtonNode
+import AccountContext
final class AuthorizationSequencePhoneEntryController: ViewController {
private var controllerNode: AuthorizationSequencePhoneEntryControllerNode {
return self.displayNode as! AuthorizationSequencePhoneEntryControllerNode
}
- private let sharedContext: SharedAccountContextImpl
+ private let sharedContext: SharedAccountContext
private let isTestingEnvironment: Bool
private let otherAccountPhoneNumbers: ((String, AccountRecordId, Bool)?, [(String, AccountRecordId, Bool)])
private let network: Network
@@ -42,7 +43,7 @@ final class AuthorizationSequencePhoneEntryController: ViewController {
private let hapticFeedback = HapticFeedback()
- init(sharedContext: SharedAccountContextImpl, isTestingEnvironment: Bool, otherAccountPhoneNumbers: ((String, AccountRecordId, Bool)?, [(String, AccountRecordId, Bool)]), network: Network, strings: PresentationStrings, theme: PresentationTheme, openUrl: @escaping (String) -> Void, back: @escaping () -> Void) {
+ init(sharedContext: SharedAccountContext, isTestingEnvironment: Bool, otherAccountPhoneNumbers: ((String, AccountRecordId, Bool)?, [(String, AccountRecordId, Bool)]), network: Network, strings: PresentationStrings, theme: PresentationTheme, openUrl: @escaping (String) -> Void, back: @escaping () -> Void) {
self.sharedContext = sharedContext
self.isTestingEnvironment = isTestingEnvironment
self.otherAccountPhoneNumbers = otherAccountPhoneNumbers
@@ -156,7 +157,7 @@ final class AuthorizationSequencePhoneEntryController: ViewController {
var actions: [TextAlertAction] = []
if let (current, _, _) = self.otherAccountPhoneNumbers.0, logInNumber != formatPhoneNumber(current) {
actions.append(TextAlertAction(type: .genericAction, title: self.strings.Login_PhoneNumberAlreadyAuthorizedSwitch, action: { [weak self] in
- self?.sharedContext.switchToAccount(id: id)
+ self?.sharedContext.switchToAccount(id: id, fromSettingsController: nil, withChatListController: nil)
self?.back()
}))
}
diff --git a/submodules/TelegramUI/TelegramUI/AutodownloadConnectionTypeController.swift b/submodules/TelegramUI/TelegramUI/AutodownloadConnectionTypeController.swift
index f7c1ae8200..55de889ed6 100644
--- a/submodules/TelegramUI/TelegramUI/AutodownloadConnectionTypeController.swift
+++ b/submodules/TelegramUI/TelegramUI/AutodownloadConnectionTypeController.swift
@@ -7,6 +7,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AccountContext
enum AutomaticDownloadConnectionType {
case cellular
@@ -273,7 +274,7 @@ private func autodownloadMediaConnectionTypeControllerEntries(presentationData:
return entries
}
-func autodownloadMediaConnectionTypeController(context: AccountContextImpl, connectionType: AutomaticDownloadConnectionType) -> ViewController {
+func autodownloadMediaConnectionTypeController(context: AccountContext, connectionType: AutomaticDownloadConnectionType) -> ViewController {
var pushControllerImpl: ((ViewController) -> Void)?
var presentControllerImpl: ((ViewController) -> Void)?
diff --git a/submodules/TelegramUI/TelegramUI/AutodownloadMediaCategoryController.swift b/submodules/TelegramUI/TelegramUI/AutodownloadMediaCategoryController.swift
index 40cc885d70..bc7d4d64fe 100644
--- a/submodules/TelegramUI/TelegramUI/AutodownloadMediaCategoryController.swift
+++ b/submodules/TelegramUI/TelegramUI/AutodownloadMediaCategoryController.swift
@@ -7,6 +7,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AccountContext
public func autodownloadDataSizeString(_ size: Int64, decimalSeparator: String = ".") -> String {
if size >= 1024 * 1024 * 1024 {
@@ -285,7 +286,7 @@ private func autodownloadMediaCategoryControllerEntries(presentationData: Presen
return entries
}
-func autodownloadMediaCategoryController(context: AccountContextImpl, connectionType: AutomaticDownloadConnectionType, category: AutomaticDownloadCategory) -> ViewController {
+func autodownloadMediaCategoryController(context: AccountContext, connectionType: AutomaticDownloadConnectionType, category: AutomaticDownloadCategory) -> ViewController {
let arguments = AutodownloadMediaCategoryControllerArguments(togglePeer: { type in
let _ = updateMediaDownloadSettingsInteractively(accountManager: context.sharedContext.accountManager, { settings in
var settings = settings
diff --git a/submodules/TelegramUI/TelegramUI/AvatarGalleryController.swift b/submodules/TelegramUI/TelegramUI/AvatarGalleryController.swift
index c402dc5f39..d12ead6ad1 100644
--- a/submodules/TelegramUI/TelegramUI/AvatarGalleryController.swift
+++ b/submodules/TelegramUI/TelegramUI/AvatarGalleryController.swift
@@ -7,6 +7,7 @@ import SwiftSignalKit
import AsyncDisplayKit
import TelegramCore
import TelegramPresentationData
+import AccountContext
public struct ImageRepresentationWithReference: Equatable {
public let representation: TelegramMediaImageRepresentation
@@ -104,7 +105,7 @@ class AvatarGalleryController: ViewController {
return self.displayNode as! GalleryControllerNode
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private let peer: Peer
private var presentationData: PresentationData
@@ -135,7 +136,7 @@ class AvatarGalleryController: ViewController {
private let replaceRootController: (ViewController, ValuePromise?) -> Void
- init(context: AccountContextImpl, peer: Peer, remoteEntries: Promise<[AvatarGalleryEntry]>? = nil, replaceRootController: @escaping (ViewController, ValuePromise?) -> Void, synchronousLoad: Bool = false) {
+ init(context: AccountContext, peer: Peer, remoteEntries: Promise<[AvatarGalleryEntry]>? = nil, replaceRootController: @escaping (ViewController, ValuePromise?) -> Void, synchronousLoad: Bool = false) {
self.context = context
self.peer = peer
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/AvatarGalleryItemFooterContentNode.swift b/submodules/TelegramUI/TelegramUI/AvatarGalleryItemFooterContentNode.swift
index 655bcd9c45..aaec2f506b 100644
--- a/submodules/TelegramUI/TelegramUI/AvatarGalleryItemFooterContentNode.swift
+++ b/submodules/TelegramUI/TelegramUI/AvatarGalleryItemFooterContentNode.swift
@@ -8,6 +8,8 @@ import SwiftSignalKit
import Photos
import TelegramPresentationData
import TelegramUIPreferences
+import TelegramStringFormatting
+import AccountContext
private let deleteImage = generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Accessory Panels/MessageSelectionThrash"), color: .white)
private let actionImage = generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Accessory Panels/MessageSelectionAction"), color: .white)
@@ -16,7 +18,7 @@ private let nameFont = Font.medium(15.0)
private let dateFont = Font.regular(14.0)
final class AvatarGalleryItemFooterContentNode: GalleryFooterContentNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var strings: PresentationStrings
private var dateTimeFormat: PresentationDateTimeFormat
@@ -36,7 +38,7 @@ final class AvatarGalleryItemFooterContentNode: GalleryFooterContentNode {
var share: ((GalleryControllerInteraction) -> Void)?
- init(context: AccountContextImpl, presentationData: PresentationData) {
+ init(context: AccountContext, presentationData: PresentationData) {
self.context = context
self.strings = presentationData.strings
self.dateTimeFormat = presentationData.dateTimeFormat
diff --git a/submodules/TelegramUI/TelegramUI/BlockedPeersController.swift b/submodules/TelegramUI/TelegramUI/BlockedPeersController.swift
index 927817e1c1..9fe2aaff7b 100644
--- a/submodules/TelegramUI/TelegramUI/BlockedPeersController.swift
+++ b/submodules/TelegramUI/TelegramUI/BlockedPeersController.swift
@@ -7,6 +7,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AccountContext
private final class BlockedPeersControllerArguments {
let account: Account
@@ -194,7 +195,7 @@ private func blockedPeersControllerEntries(presentationData: PresentationData, s
return entries
}
-public func blockedPeersController(context: AccountContextImpl, blockedPeersContext: BlockedPeersContext) -> ViewController {
+public func blockedPeersController(context: AccountContext, blockedPeersContext: BlockedPeersContext) -> ViewController {
let statePromise = ValuePromise(BlockedPeersControllerState(), ignoreRepeated: true)
let stateValue = Atomic(value: BlockedPeersControllerState())
let updateState: ((BlockedPeersControllerState) -> BlockedPeersControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/BotCheckoutController.swift b/submodules/TelegramUI/TelegramUI/BotCheckoutController.swift
index 345b4adb7b..50f8b42615 100644
--- a/submodules/TelegramUI/TelegramUI/BotCheckoutController.swift
+++ b/submodules/TelegramUI/TelegramUI/BotCheckoutController.swift
@@ -6,6 +6,7 @@ import TelegramCore
import SwiftSignalKit
import Postbox
import TelegramPresentationData
+import AccountContext
final class BotCheckoutController: ViewController {
private var controllerNode: BotCheckoutControllerNode {
@@ -17,7 +18,7 @@ final class BotCheckoutController: ViewController {
return self._ready
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private let invoice: TelegramMediaInvoice
private let messageId: MessageId
@@ -25,7 +26,7 @@ final class BotCheckoutController: ViewController {
private var didPlayPresentationAnimation = false
- init(context: AccountContextImpl, invoice: TelegramMediaInvoice, messageId: MessageId) {
+ init(context: AccountContext, invoice: TelegramMediaInvoice, messageId: MessageId) {
self.context = context
self.invoice = invoice
self.messageId = messageId
diff --git a/submodules/TelegramUI/TelegramUI/BotCheckoutControllerNode.swift b/submodules/TelegramUI/TelegramUI/BotCheckoutControllerNode.swift
index 6e28feae0b..60cca6f17d 100644
--- a/submodules/TelegramUI/TelegramUI/BotCheckoutControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/BotCheckoutControllerNode.swift
@@ -9,6 +9,7 @@ import PassKit
import TelegramPresentationData
import TelegramUIPrivateModule
import ItemListUI
+import AccountContext
final class BotCheckoutControllerArguments {
fileprivate let account: Account
@@ -361,7 +362,7 @@ private func availablePaymentMethods(form: BotPaymentForm, current: BotCheckoutP
}
final class BotCheckoutControllerNode: ItemListControllerNode, PKPaymentAuthorizationViewControllerDelegate {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let messageId: MessageId
private let present: (ViewController, Any?) -> Void
private let dismissAnimated: () -> Void
@@ -388,7 +389,7 @@ final class BotCheckoutControllerNode: ItemListControllerNode,
private var applePayAuthrorizationCompletion: ((PKPaymentAuthorizationStatus) -> Void)?
private var applePayController: PKPaymentAuthorizationViewController?
- init(controller: ItemListController?, navigationBar: NavigationBar, updateNavigationOffset: @escaping (CGFloat) -> Void, context: AccountContextImpl, invoice: TelegramMediaInvoice, messageId: MessageId, present: @escaping (ViewController, Any?) -> Void, dismissAnimated: @escaping () -> Void) {
+ init(controller: ItemListController?, navigationBar: NavigationBar, updateNavigationOffset: @escaping (CGFloat) -> Void, context: AccountContext, invoice: TelegramMediaInvoice, messageId: MessageId, present: @escaping (ViewController, Any?) -> Void, dismissAnimated: @escaping () -> Void) {
self.context = context
self.messageId = messageId
self.present = present
diff --git a/submodules/TelegramUI/TelegramUI/BotCheckoutInfoController.swift b/submodules/TelegramUI/TelegramUI/BotCheckoutInfoController.swift
index 2a42f55bbf..052b6c3003 100644
--- a/submodules/TelegramUI/TelegramUI/BotCheckoutInfoController.swift
+++ b/submodules/TelegramUI/TelegramUI/BotCheckoutInfoController.swift
@@ -6,6 +6,7 @@ import TelegramCore
import Postbox
import TelegramPresentationData
import ProgressNavigationButtonNode
+import AccountContext
enum BotCheckoutInfoControllerAddressFocus {
case street1
@@ -27,7 +28,7 @@ final class BotCheckoutInfoController: ViewController {
return super.displayNode as! BotCheckoutInfoControllerNode
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private let invoice: BotPaymentInvoice
private let messageId: MessageId
private let initialFormInfo: BotPaymentRequestedInfo
@@ -42,7 +43,7 @@ final class BotCheckoutInfoController: ViewController {
private var doneItem: UIBarButtonItem?
private var activityItem: UIBarButtonItem?
- public init(context: AccountContextImpl, invoice: BotPaymentInvoice, messageId: MessageId, initialFormInfo: BotPaymentRequestedInfo, focus: BotCheckoutInfoControllerFocus, formInfoUpdated: @escaping (BotPaymentRequestedInfo, BotPaymentValidatedFormInfo) -> Void) {
+ public init(context: AccountContext, invoice: BotPaymentInvoice, messageId: MessageId, initialFormInfo: BotPaymentRequestedInfo, focus: BotCheckoutInfoControllerFocus, formInfoUpdated: @escaping (BotPaymentRequestedInfo, BotPaymentValidatedFormInfo) -> Void) {
self.context = context
self.invoice = invoice
self.messageId = messageId
diff --git a/submodules/TelegramUI/TelegramUI/BotCheckoutInfoControllerNode.swift b/submodules/TelegramUI/TelegramUI/BotCheckoutInfoControllerNode.swift
index d0c1628f1d..ed7cfd870b 100644
--- a/submodules/TelegramUI/TelegramUI/BotCheckoutInfoControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/BotCheckoutInfoControllerNode.swift
@@ -6,6 +6,7 @@ import TelegramCore
import Postbox
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
private final class BotCheckoutInfoAddressItems {
let address1: BotPaymentFieldItemNode
@@ -90,7 +91,7 @@ enum BotCheckoutInfoControllerStatus {
}
final class BotCheckoutInfoControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let invoice: BotPaymentInvoice
private let messageId: MessageId
private var focus: BotCheckoutInfoControllerFocus?
@@ -120,7 +121,7 @@ final class BotCheckoutInfoControllerNode: ViewControllerTracingNode, UIScrollVi
private let verifyDisposable = MetaDisposable()
private var isVerifying = false
- init(context: AccountContextImpl, invoice: BotPaymentInvoice, messageId: MessageId, formInfo: BotPaymentRequestedInfo, focus: BotCheckoutInfoControllerFocus, theme: PresentationTheme, strings: PresentationStrings, dismiss: @escaping () -> Void, openCountrySelection: @escaping () -> Void, updateStatus: @escaping (BotCheckoutInfoControllerStatus) -> Void, formInfoUpdated: @escaping (BotPaymentRequestedInfo, BotPaymentValidatedFormInfo) -> Void, present: @escaping (ViewController, Any?) -> Void) {
+ init(context: AccountContext, invoice: BotPaymentInvoice, messageId: MessageId, formInfo: BotPaymentRequestedInfo, focus: BotCheckoutInfoControllerFocus, theme: PresentationTheme, strings: PresentationStrings, dismiss: @escaping () -> Void, openCountrySelection: @escaping () -> Void, updateStatus: @escaping (BotCheckoutInfoControllerStatus) -> Void, formInfoUpdated: @escaping (BotPaymentRequestedInfo, BotPaymentValidatedFormInfo) -> Void, present: @escaping (ViewController, Any?) -> Void) {
self.context = context
self.invoice = invoice
self.messageId = messageId
diff --git a/submodules/TelegramUI/TelegramUI/BotCheckoutNativeCardEntryController.swift b/submodules/TelegramUI/TelegramUI/BotCheckoutNativeCardEntryController.swift
index 218df20192..0208ce461b 100644
--- a/submodules/TelegramUI/TelegramUI/BotCheckoutNativeCardEntryController.swift
+++ b/submodules/TelegramUI/TelegramUI/BotCheckoutNativeCardEntryController.swift
@@ -7,6 +7,7 @@ import TelegramCore
import Postbox
import TelegramPresentationData
import ProgressNavigationButtonNode
+import AccountContext
enum BotCheckoutNativeCardEntryStatus {
case notReady
@@ -31,7 +32,7 @@ final class BotCheckoutNativeCardEntryController: ViewController {
return super.displayNode as! BotCheckoutNativeCardEntryControllerNode
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private let additionalFields: BotCheckoutNativeCardEntryAdditionalFields
private let publishableKey: String
private let completion: (BotCheckoutPaymentMethod) -> Void
@@ -43,7 +44,7 @@ final class BotCheckoutNativeCardEntryController: ViewController {
private var doneItem: UIBarButtonItem?
private var activityItem: UIBarButtonItem?
- public init(context: AccountContextImpl, additionalFields: BotCheckoutNativeCardEntryAdditionalFields, publishableKey: String, completion: @escaping (BotCheckoutPaymentMethod) -> Void) {
+ public init(context: AccountContext, additionalFields: BotCheckoutNativeCardEntryAdditionalFields, publishableKey: String, completion: @escaping (BotCheckoutPaymentMethod) -> Void) {
self.context = context
self.additionalFields = additionalFields
self.publishableKey = publishableKey
diff --git a/submodules/TelegramUI/TelegramUI/BotCheckoutPasswordEntryController.swift b/submodules/TelegramUI/TelegramUI/BotCheckoutPasswordEntryController.swift
index 8216e30f74..044183124f 100644
--- a/submodules/TelegramUI/TelegramUI/BotCheckoutPasswordEntryController.swift
+++ b/submodules/TelegramUI/TelegramUI/BotCheckoutPasswordEntryController.swift
@@ -5,6 +5,7 @@ import Display
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
private struct BotCheckoutPasswordAlertAction {
public let title: String
@@ -68,7 +69,7 @@ private final class BotCheckoutPasswordAlertActionNode: HighlightableButtonNode
}
private final class BotCheckoutPasswordAlertContentNode: AlertContentNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let period: Int32
private let requiresBiometrics: Bool
private let completion: (TemporaryTwoStepPasswordToken) -> Void
@@ -92,7 +93,7 @@ private final class BotCheckoutPasswordAlertContentNode: AlertContentNode {
private let hapticFeedback = HapticFeedback()
- init(context: AccountContextImpl, theme: PresentationTheme, strings: PresentationStrings, cardTitle: String, period: Int32, requiresBiometrics: Bool, cancel: @escaping () -> Void, completion: @escaping (TemporaryTwoStepPasswordToken) -> Void) {
+ init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, cardTitle: String, period: Int32, requiresBiometrics: Bool, cancel: @escaping () -> Void, completion: @escaping (TemporaryTwoStepPasswordToken) -> Void) {
self.context = context
self.period = period
self.requiresBiometrics = requiresBiometrics
@@ -297,7 +298,7 @@ private final class BotCheckoutPasswordAlertContentNode: AlertContentNode {
}
}
-func botCheckoutPasswordEntryController(context: AccountContextImpl, strings: PresentationStrings, cartTitle: String, period: Int32, requiresBiometrics: Bool, completion: @escaping (TemporaryTwoStepPasswordToken) -> Void) -> AlertController {
+func botCheckoutPasswordEntryController(context: AccountContext, strings: PresentationStrings, cartTitle: String, period: Int32, requiresBiometrics: Bool, completion: @escaping (TemporaryTwoStepPasswordToken) -> Void) -> AlertController {
var dismissImpl: (() -> Void)?
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let controller = AlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), contentNode: BotCheckoutPasswordAlertContentNode(context: context, theme: presentationData.theme, strings: strings, cardTitle: cartTitle, period: period, requiresBiometrics: requiresBiometrics, cancel: {
diff --git a/submodules/TelegramUI/TelegramUI/BotCheckoutPaymentMethodSheet.swift b/submodules/TelegramUI/TelegramUI/BotCheckoutPaymentMethodSheet.swift
index 6d6e01be03..630da03eb4 100644
--- a/submodules/TelegramUI/TelegramUI/BotCheckoutPaymentMethodSheet.swift
+++ b/submodules/TelegramUI/TelegramUI/BotCheckoutPaymentMethodSheet.swift
@@ -4,6 +4,7 @@ import Display
import AsyncDisplayKit
import SwiftSignalKit
import TelegramCore
+import AccountContext
struct BotCheckoutPaymentWebToken: Equatable {
let title: String
@@ -34,7 +35,7 @@ enum BotCheckoutPaymentMethod: Equatable {
final class BotCheckoutPaymentMethodSheetController: ActionSheetController {
private var presentationDisposable: Disposable?
- init(context: AccountContextImpl, currentMethod: BotCheckoutPaymentMethod?, methods: [BotCheckoutPaymentMethod], applyValue: @escaping (BotCheckoutPaymentMethod) -> Void, newCard: @escaping () -> Void) {
+ init(context: AccountContext, currentMethod: BotCheckoutPaymentMethod?, methods: [BotCheckoutPaymentMethod], applyValue: @escaping (BotCheckoutPaymentMethod) -> Void, newCard: @escaping () -> Void) {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let theme = presentationData.theme
let strings = presentationData.strings
diff --git a/submodules/TelegramUI/TelegramUI/BotCheckoutPaymentShippingOptionSheetController.swift b/submodules/TelegramUI/TelegramUI/BotCheckoutPaymentShippingOptionSheetController.swift
index e2e6f32163..181b4fe09e 100644
--- a/submodules/TelegramUI/TelegramUI/BotCheckoutPaymentShippingOptionSheetController.swift
+++ b/submodules/TelegramUI/TelegramUI/BotCheckoutPaymentShippingOptionSheetController.swift
@@ -4,11 +4,12 @@ import Display
import AsyncDisplayKit
import SwiftSignalKit
import TelegramCore
+import AccountContext
final class BotCheckoutPaymentShippingOptionSheetController: ActionSheetController {
private var presentationDisposable: Disposable?
- init(context: AccountContextImpl, currency: String, options: [BotPaymentShippingOption], currentId: String?, applyValue: @escaping (String) -> Void) {
+ init(context: AccountContext, currency: String, options: [BotPaymentShippingOption], currentId: String?, applyValue: @escaping (String) -> Void) {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let theme = presentationData.theme
let strings = presentationData.strings
diff --git a/submodules/TelegramUI/TelegramUI/BotCheckoutWebInteractionController.swift b/submodules/TelegramUI/TelegramUI/BotCheckoutWebInteractionController.swift
index 42e572a60c..42c385472c 100644
--- a/submodules/TelegramUI/TelegramUI/BotCheckoutWebInteractionController.swift
+++ b/submodules/TelegramUI/TelegramUI/BotCheckoutWebInteractionController.swift
@@ -6,6 +6,7 @@ import TelegramCore
import SwiftSignalKit
import Postbox
import TelegramPresentationData
+import AccountContext
enum BotCheckoutWebInteractionControllerIntent {
case addPaymentMethod((BotCheckoutPaymentWebToken) -> Void)
@@ -17,7 +18,7 @@ final class BotCheckoutWebInteractionController: ViewController {
return self.displayNode as! BotCheckoutWebInteractionControllerNode
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private let url: String
private let intent: BotCheckoutWebInteractionControllerIntent
@@ -25,7 +26,7 @@ final class BotCheckoutWebInteractionController: ViewController {
private var didPlayPresentationAnimation = false
- init(context: AccountContextImpl, url: String, intent: BotCheckoutWebInteractionControllerIntent) {
+ init(context: AccountContext, url: String, intent: BotCheckoutWebInteractionControllerIntent) {
self.context = context
self.url = url
self.intent = intent
diff --git a/submodules/TelegramUI/TelegramUI/BotReceiptController.swift b/submodules/TelegramUI/TelegramUI/BotReceiptController.swift
index 426c3467b3..280fe38a74 100644
--- a/submodules/TelegramUI/TelegramUI/BotReceiptController.swift
+++ b/submodules/TelegramUI/TelegramUI/BotReceiptController.swift
@@ -6,6 +6,7 @@ import TelegramCore
import SwiftSignalKit
import Postbox
import TelegramPresentationData
+import AccountContext
final class BotReceiptController: ViewController {
private var controllerNode: BotReceiptControllerNode {
@@ -17,7 +18,7 @@ final class BotReceiptController: ViewController {
return self._ready
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private let invoice: TelegramMediaInvoice
private let messageId: MessageId
@@ -25,7 +26,7 @@ final class BotReceiptController: ViewController {
private var didPlayPresentationAnimation = false
- init(context: AccountContextImpl, invoice: TelegramMediaInvoice, messageId: MessageId) {
+ init(context: AccountContext, invoice: TelegramMediaInvoice, messageId: MessageId) {
self.context = context
self.invoice = invoice
self.messageId = messageId
diff --git a/submodules/TelegramUI/TelegramUI/BotReceiptControllerNode.swift b/submodules/TelegramUI/TelegramUI/BotReceiptControllerNode.swift
index fe7626f7bb..ecc293a882 100644
--- a/submodules/TelegramUI/TelegramUI/BotReceiptControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/BotReceiptControllerNode.swift
@@ -7,6 +7,7 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
+import AccountContext
final class BotReceiptControllerArguments {
fileprivate let account: Account
@@ -252,7 +253,7 @@ private func availablePaymentMethods(current: BotCheckoutPaymentMethod?) -> [Bot
}
final class BotReceiptControllerNode: ItemListControllerNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let dismissAnimated: () -> Void
private var presentationData: PresentationData
@@ -262,7 +263,7 @@ final class BotReceiptControllerNode: ItemListControllerNode {
private let actionButton: BotCheckoutActionButton
- init(controller: ItemListController?, navigationBar: NavigationBar, updateNavigationOffset: @escaping (CGFloat) -> Void, context: AccountContextImpl, invoice: TelegramMediaInvoice, messageId: MessageId, dismissAnimated: @escaping () -> Void) {
+ init(controller: ItemListController?, navigationBar: NavigationBar, updateNavigationOffset: @escaping (CGFloat) -> Void, context: AccountContext, invoice: TelegramMediaInvoice, messageId: MessageId, dismissAnimated: @escaping () -> Void) {
self.context = context
self.dismissAnimated = dismissAnimated
diff --git a/submodules/TelegramUI/TelegramUI/CachedFaqInstantPage.swift b/submodules/TelegramUI/TelegramUI/CachedFaqInstantPage.swift
index 0fba30a5d1..ad01642d21 100644
--- a/submodules/TelegramUI/TelegramUI/CachedFaqInstantPage.swift
+++ b/submodules/TelegramUI/TelegramUI/CachedFaqInstantPage.swift
@@ -2,6 +2,7 @@ import Foundation
import SwiftSignalKit
import Postbox
import TelegramCore
+import AccountContext
private func extractAnchor(string: String) -> (String, String?) {
var anchorValue: String?
@@ -23,7 +24,7 @@ private func extractAnchor(string: String) -> (String, String?) {
private let refreshTimeout: Int32 = 60 * 60 * 12
-func cachedFaqInstantPage(context: AccountContextImpl) -> Signal {
+func cachedFaqInstantPage(context: AccountContext) -> Signal {
var faqUrl = context.sharedContext.currentPresentationData.with { $0 }.strings.Settings_FAQ_URL
if faqUrl == "Settings.FAQ_URL" || faqUrl.isEmpty {
faqUrl = "https://telegram.org/faq#general-questions"
@@ -66,7 +67,7 @@ func cachedFaqInstantPage(context: AccountContextImpl) -> Signal Signal<[SettingsSearchableItem], NoError> {
+func faqSearchableItems(context: AccountContext) -> Signal<[SettingsSearchableItem], NoError> {
let strings = context.sharedContext.currentPresentationData.with { $0 }.strings
return cachedFaqInstantPage(context: context)
|> map { resolvedUrl -> [SettingsSearchableItem] in
diff --git a/submodules/TelegramUI/TelegramUI/CallController.swift b/submodules/TelegramUI/TelegramUI/CallController.swift
index 82c8e80598..0adb4cfad5 100644
--- a/submodules/TelegramUI/TelegramUI/CallController.swift
+++ b/submodules/TelegramUI/TelegramUI/CallController.swift
@@ -10,6 +10,7 @@ import TelegramUIPreferences
import TelegramVoip
import TelegramCallsUI
import TelegramAudio
+import AccountContext
public final class CallController: ViewController {
private var controllerNode: CallControllerNode {
@@ -21,7 +22,7 @@ public final class CallController: ViewController {
return self._ready
}
- private let sharedContext: SharedAccountContextImpl
+ private let sharedContext: SharedAccountContext
private let account: Account
public let call: PresentationCall
@@ -41,7 +42,7 @@ public final class CallController: ViewController {
private var audioOutputStateDisposable: Disposable?
private var audioOutputState: ([AudioSessionOutput], AudioSessionOutput?)?
- public init(sharedContext: SharedAccountContextImpl, account: Account, call: PresentationCall) {
+ public init(sharedContext: SharedAccountContext, account: Account, call: PresentationCall) {
self.sharedContext = sharedContext
self.account = account
self.call = call
diff --git a/submodules/TelegramUI/TelegramUI/CallControllerNode.swift b/submodules/TelegramUI/TelegramUI/CallControllerNode.swift
index e80718588a..a8026659dc 100644
--- a/submodules/TelegramUI/TelegramUI/CallControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/CallControllerNode.swift
@@ -10,9 +10,10 @@ import TelegramUIPrivateModule
import TelegramPresentationData
import TelegramUIPreferences
import TelegramAudio
+import AccountContext
final class CallControllerNode: ASDisplayNode {
- private let sharedContext: SharedAccountContextImpl
+ private let sharedContext: SharedAccountContext
private let account: Account
private let statusBar: StatusBar
@@ -60,7 +61,7 @@ final class CallControllerNode: ASDisplayNode {
var callEnded: ((Bool) -> Void)?
var dismissedInteractively: (() -> Void)?
- init(sharedContext: SharedAccountContextImpl, account: Account, presentationData: PresentationData, statusBar: StatusBar, debugInfo: Signal<(String, String), NoError>, shouldStayHiddenUntilConnection: Bool = false) {
+ init(sharedContext: SharedAccountContext, account: Account, presentationData: PresentationData, statusBar: StatusBar, debugInfo: Signal<(String, String), NoError>, shouldStayHiddenUntilConnection: Bool = false) {
self.sharedContext = sharedContext
self.account = account
self.presentationData = presentationData
diff --git a/submodules/TelegramUI/TelegramUI/CallFeedbackController.swift b/submodules/TelegramUI/TelegramUI/CallFeedbackController.swift
index fba56e67a6..e877128d18 100644
--- a/submodules/TelegramUI/TelegramUI/CallFeedbackController.swift
+++ b/submodules/TelegramUI/TelegramUI/CallFeedbackController.swift
@@ -6,6 +6,8 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import OverlayStatusController
+import AccountContext
private enum CallFeedbackReason: Int32, CaseIterable {
case echo
@@ -207,7 +209,7 @@ private func callFeedbackControllerEntries(theme: PresentationTheme, strings: Pr
return entries
}
-public func callFeedbackController(sharedContext: SharedAccountContextImpl, account: Account, callId: CallId, rating: Int, userInitiated: Bool) -> ViewController {
+public func callFeedbackController(sharedContext: SharedAccountContext, account: Account, callId: CallId, rating: Int, userInitiated: Bool) -> ViewController {
let initialState = CallFeedbackState()
let statePromise = ValuePromise(initialState, ignoreRepeated: true)
let stateValue = Atomic(value: initialState)
diff --git a/submodules/TelegramUI/TelegramUI/CallListCallItem.swift b/submodules/TelegramUI/TelegramUI/CallListCallItem.swift
index ac8eb76f41..af0bf0d125 100644
--- a/submodules/TelegramUI/TelegramUI/CallListCallItem.swift
+++ b/submodules/TelegramUI/TelegramUI/CallListCallItem.swift
@@ -7,6 +7,8 @@ import SwiftSignalKit
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import AvatarNode
+import TelegramStringFormatting
private let titleFont = Font.regular(17.0)
private let statusFont = Font.regular(14.0)
diff --git a/submodules/TelegramUI/TelegramUI/CallListController.swift b/submodules/TelegramUI/TelegramUI/CallListController.swift
index 5bff7fc8c5..01e949c1bb 100644
--- a/submodules/TelegramUI/TelegramUI/CallListController.swift
+++ b/submodules/TelegramUI/TelegramUI/CallListController.swift
@@ -7,6 +7,7 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
+import AccountContext
public enum CallListControllerMode {
case tab
@@ -23,7 +24,7 @@ public final class CallListController: ViewController {
return self._ready
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private let mode: CallListControllerMode
private var presentationData: PresentationData
@@ -38,7 +39,7 @@ public final class CallListController: ViewController {
private let createActionDisposable = MetaDisposable()
- public init(context: AccountContextImpl, mode: CallListControllerMode) {
+ public init(context: AccountContext, mode: CallListControllerMode) {
self.context = context
self.mode = mode
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/CallListControllerNode.swift b/submodules/TelegramUI/TelegramUI/CallListControllerNode.swift
index 3988aca6cc..554119e450 100644
--- a/submodules/TelegramUI/TelegramUI/CallListControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/CallListControllerNode.swift
@@ -8,6 +8,7 @@ import SwiftSignalKit
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AccountContext
private struct CallListNodeListViewTransition {
let callListView: CallListNodeView
@@ -156,7 +157,7 @@ private final class CallListOpaqueTransactionState {
}
final class CallListControllerNode: ASDisplayNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let mode: CallListControllerMode
private var presentationData: PresentationData
@@ -195,7 +196,7 @@ final class CallListControllerNode: ASDisplayNode {
private let emptyStatePromise = Promise()
private let emptyStateDisposable = MetaDisposable()
- init(context: AccountContextImpl, mode: CallListControllerMode, presentationData: PresentationData, call: @escaping (PeerId) -> Void, openInfo: @escaping (PeerId, [Message]) -> Void, emptyStateUpdated: @escaping (Bool) -> Void) {
+ init(context: AccountContext, mode: CallListControllerMode, presentationData: PresentationData, call: @escaping (PeerId) -> Void, openInfo: @escaping (PeerId, [Message]) -> Void, emptyStateUpdated: @escaping (Bool) -> Void) {
self.context = context
self.mode = mode
self.presentationData = presentationData
diff --git a/submodules/TelegramUI/TelegramUI/CallRatingController.swift b/submodules/TelegramUI/TelegramUI/CallRatingController.swift
index ccdd9a1c71..35b4ca5681 100644
--- a/submodules/TelegramUI/TelegramUI/CallRatingController.swift
+++ b/submodules/TelegramUI/TelegramUI/CallRatingController.swift
@@ -7,6 +7,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import TelegramVoip
+import AccountContext
private final class CallRatingAlertContentNode: AlertContentNode {
private let strings: PresentationStrings
@@ -263,7 +264,7 @@ func rateCallAndSendLogs(account: Account, callId: CallId, starsCount: Int, comm
}
}
-func callRatingController(sharedContext: SharedAccountContextImpl, account: Account, callId: CallId, userInitiated: Bool, present: @escaping (ViewController, Any) -> Void) -> AlertController {
+func callRatingController(sharedContext: SharedAccountContext, account: Account, callId: CallId, userInitiated: Bool, present: @escaping (ViewController, Any) -> Void) -> AlertController {
let presentationData = sharedContext.currentPresentationData.with { $0 }
let theme = presentationData.theme
let strings = presentationData.strings
diff --git a/submodules/TelegramUI/TelegramUI/CallSuggestTabController.swift b/submodules/TelegramUI/TelegramUI/CallSuggestTabController.swift
index 18ad26c7d6..fbfcf10b01 100644
--- a/submodules/TelegramUI/TelegramUI/CallSuggestTabController.swift
+++ b/submodules/TelegramUI/TelegramUI/CallSuggestTabController.swift
@@ -7,6 +7,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
+import AccountContext
private func generateIconImage(theme: AlertControllerTheme) -> UIImage? {
return UIImage(bundleImageName: "Call List/AlertIcon")
@@ -200,7 +201,7 @@ private final class CallSuggestTabAlertContentNode: AlertContentNode {
}
}
-func callSuggestTabController(sharedContext: SharedAccountContextImpl) -> AlertController {
+func callSuggestTabController(sharedContext: SharedAccountContext) -> AlertController {
let presentationData = sharedContext.currentPresentationData.with { $0 }
let theme = presentationData.theme
let strings = presentationData.strings
diff --git a/submodules/TelegramUI/TelegramUI/ChangePhoneNumberCodeController.swift b/submodules/TelegramUI/TelegramUI/ChangePhoneNumberCodeController.swift
index 4beec55aa8..934e059499 100644
--- a/submodules/TelegramUI/TelegramUI/ChangePhoneNumberCodeController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChangePhoneNumberCodeController.swift
@@ -6,6 +6,8 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import OverlayStatusController
+import AccountContext
private final class ChangePhoneNumberCodeControllerArguments {
let updateEntryText: (String) -> Void
@@ -171,7 +173,7 @@ protocol ChangePhoneNumberCodeController: class {
private final class ChangePhoneNumberCodeControllerImpl: ItemListController, ChangePhoneNumberCodeController {
private let applyCodeImpl: (Int) -> Void
- init(context: AccountContextImpl, state: Signal<(ItemListControllerState, (ItemListNodeState, ChangePhoneNumberCodeEntry.ItemGenerationArguments)), NoError>, applyCodeImpl: @escaping (Int) -> Void) {
+ init(context: AccountContext, state: Signal<(ItemListControllerState, (ItemListNodeState, ChangePhoneNumberCodeEntry.ItemGenerationArguments)), NoError>, applyCodeImpl: @escaping (Int) -> Void) {
self.applyCodeImpl = applyCodeImpl
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
@@ -187,7 +189,7 @@ private final class ChangePhoneNumberCodeControllerImpl: ItemListController ViewController {
+func changePhoneNumberCodeController(context: AccountContext, phoneNumber: String, codeData: ChangeAccountPhoneNumberData) -> ViewController {
let initialState = ChangePhoneNumberCodeControllerState(codeText: "", checking: false)
let statePromise = ValuePromise(initialState, ignoreRepeated: true)
diff --git a/submodules/TelegramUI/TelegramUI/ChangePhoneNumberController.swift b/submodules/TelegramUI/TelegramUI/ChangePhoneNumberController.swift
index b280c0d0db..29f3dc9025 100644
--- a/submodules/TelegramUI/TelegramUI/ChangePhoneNumberController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChangePhoneNumberController.swift
@@ -6,13 +6,14 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import ProgressNavigationButtonNode
+import AccountContext
final class ChangePhoneNumberController: ViewController {
private var controllerNode: ChangePhoneNumberControllerNode {
return self.displayNode as! ChangePhoneNumberControllerNode
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private var currentData: (Int32, String?, String)?
private let requestDisposable = MetaDisposable()
@@ -34,7 +35,7 @@ final class ChangePhoneNumberController: ViewController {
private var presentationData: PresentationData
- init(context: AccountContextImpl) {
+ init(context: AccountContext) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/ChangePhoneNumberIntroController.swift b/submodules/TelegramUI/TelegramUI/ChangePhoneNumberIntroController.swift
index bf550f1322..57816b4085 100644
--- a/submodules/TelegramUI/TelegramUI/ChangePhoneNumberIntroController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChangePhoneNumberIntroController.swift
@@ -5,6 +5,7 @@ import AsyncDisplayKit
import TelegramCore
import TelegramPresentationData
import TextFormat
+import AccountContext
private final class ChangePhoneNumberIntroControllerNode: ASDisplayNode {
var presentationData: PresentationData
@@ -79,12 +80,12 @@ private final class ChangePhoneNumberIntroControllerNode: ASDisplayNode {
}
final class ChangePhoneNumberIntroController: ViewController {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var didPlayPresentationAnimation = false
private var presentationData: PresentationData
- init(context: AccountContextImpl, phoneNumber: String) {
+ init(context: AccountContext, phoneNumber: String) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/ChannelAdminController.swift b/submodules/TelegramUI/TelegramUI/ChannelAdminController.swift
index 5c5f96d59d..0a95adf375 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelAdminController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelAdminController.swift
@@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import AccountContext
private let rankMaxLength: Int32 = 16
@@ -743,7 +744,7 @@ private func channelAdminControllerEntries(presentationData: PresentationData, s
return entries
}
-public func channelAdminController(context: AccountContextImpl, peerId: PeerId, adminId: PeerId, initialParticipant: ChannelParticipant?, updated: @escaping (TelegramChatAdminRights) -> Void, upgradedToSupergroup: @escaping (PeerId, @escaping () -> Void) -> Void, transferedOwnership: @escaping (PeerId) -> Void) -> ViewController {
+public func channelAdminController(context: AccountContext, peerId: PeerId, adminId: PeerId, initialParticipant: ChannelParticipant?, updated: @escaping (TelegramChatAdminRights) -> Void, upgradedToSupergroup: @escaping (PeerId, @escaping () -> Void) -> Void, transferedOwnership: @escaping (PeerId) -> Void) -> ViewController {
let statePromise = ValuePromise(ChannelAdminControllerState(), ignoreRepeated: true)
let stateValue = Atomic(value: ChannelAdminControllerState())
let updateState: ((ChannelAdminControllerState) -> ChannelAdminControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/ChannelAdminsController.swift b/submodules/TelegramUI/TelegramUI/ChannelAdminsController.swift
index 4a4559987b..4a0578eed8 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelAdminsController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelAdminsController.swift
@@ -7,6 +7,8 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AccountContext
+import TemporaryCachedPeerDataManager
private final class ChannelAdminsControllerArguments {
let account: Account
@@ -479,7 +481,7 @@ private func channelAdminsControllerEntries(presentationData: PresentationData,
return entries
}
-public func channelAdminsController(context: AccountContextImpl, peerId: PeerId, loadCompleted: @escaping () -> Void = {}) -> ViewController {
+public func channelAdminsController(context: AccountContext, peerId: PeerId, loadCompleted: @escaping () -> Void = {}) -> ViewController {
let statePromise = ValuePromise(ChannelAdminsControllerState(), ignoreRepeated: true)
let stateValue = Atomic(value: ChannelAdminsControllerState())
let updateState: ((ChannelAdminsControllerState) -> ChannelAdminsControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/ChannelBannedMemberController.swift b/submodules/TelegramUI/TelegramUI/ChannelBannedMemberController.swift
index 2b3558b570..83176288f6 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelBannedMemberController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelBannedMemberController.swift
@@ -6,6 +6,9 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import TelegramStringFormatting
+import OverlayStatusController
+import AccountContext
private final class ChannelBannedMemberControllerArguments {
let account: Account
@@ -368,7 +371,7 @@ private func channelBannedMemberControllerEntries(presentationData: Presentation
return entries
}
-public func channelBannedMemberController(context: AccountContextImpl, peerId: PeerId, memberId: PeerId, initialParticipant: ChannelParticipant?, updated: @escaping (TelegramChatBannedRights?) -> Void, upgradedToSupergroup: @escaping (PeerId, @escaping () -> Void) -> Void) -> ViewController {
+public func channelBannedMemberController(context: AccountContext, peerId: PeerId, memberId: PeerId, initialParticipant: ChannelParticipant?, updated: @escaping (TelegramChatBannedRights?) -> Void, upgradedToSupergroup: @escaping (PeerId, @escaping () -> Void) -> Void) -> ViewController {
let initialState = ChannelBannedMemberControllerState(referenceTimestamp: Int32(Date().timeIntervalSince1970), updatedFlags: nil, updatedTimeout: nil, updating: false)
let statePromise = ValuePromise(initialState, ignoreRepeated: true)
let stateValue = Atomic(value: initialState)
diff --git a/submodules/TelegramUI/TelegramUI/ChannelBlacklistController.swift b/submodules/TelegramUI/TelegramUI/ChannelBlacklistController.swift
index 1d492e20d6..a10612f7c0 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelBlacklistController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelBlacklistController.swift
@@ -7,6 +7,8 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import OverlayStatusController
+import AccountContext
private final class ChannelBlacklistControllerArguments {
let account: Account
@@ -260,7 +262,7 @@ private func channelBlacklistControllerEntries(presentationData: PresentationDat
return entries
}
-public func channelBlacklistController(context: AccountContextImpl, peerId: PeerId) -> ViewController {
+public func channelBlacklistController(context: AccountContext, peerId: PeerId) -> ViewController {
let statePromise = ValuePromise(ChannelBlacklistControllerState(referenceTimestamp: Int32(Date().timeIntervalSince1970)), ignoreRepeated: true)
let stateValue = Atomic(value: ChannelBlacklistControllerState(referenceTimestamp: Int32(Date().timeIntervalSince1970)))
let updateState: ((ChannelBlacklistControllerState) -> ChannelBlacklistControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupActionSheetItem.swift b/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupActionSheetItem.swift
index 0dbb49edf2..c4089b0c03 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupActionSheetItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupActionSheetItem.swift
@@ -6,14 +6,16 @@ import Display
import Postbox
import TelegramCore
import TelegramPresentationData
+import AvatarNode
+import AccountContext
final class ChannelDiscussionGroupActionSheetItem: ActionSheetItem {
- let context: AccountContextImpl
+ let context: AccountContext
let channelPeer: Peer
let groupPeer: Peer
let strings: PresentationStrings
- init(context: AccountContextImpl, channelPeer: Peer, groupPeer: Peer, strings: PresentationStrings) {
+ init(context: AccountContext, channelPeer: Peer, groupPeer: Peer, strings: PresentationStrings) {
self.context = context
self.channelPeer = channelPeer
self.groupPeer = groupPeer
@@ -38,7 +40,7 @@ private final class ChannelDiscussionGroupActionSheetItemNode: ActionSheetItemNo
private let groupAvatarNode: AvatarNode
private let textNode: ImmediateTextNode
- init(theme: ActionSheetControllerTheme, context: AccountContextImpl, channelPeer: Peer, groupPeer: Peer, strings: PresentationStrings) {
+ init(theme: ActionSheetControllerTheme, context: AccountContext, channelPeer: Peer, groupPeer: Peer, strings: PresentationStrings) {
self.theme = theme
self.channelAvatarNode = AvatarNode(font: avatarFont)
diff --git a/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupSearchContainerNode.swift b/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupSearchContainerNode.swift
index 9ffa00e41b..75a5d7fad1 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupSearchContainerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupSearchContainerNode.swift
@@ -8,6 +8,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import MergeLists
+import AccountContext
private enum ChannelDiscussionGroupSearchContent: Equatable {
case peer(Peer)
@@ -95,7 +96,7 @@ private struct ChannelDiscussionGroupSearchContainerState: Equatable {
}
final class ChannelDiscussionGroupSearchContainerNode: SearchDisplayControllerContentNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let openPeer: (Peer) -> Void
private let dimNode: ASDisplayNode
@@ -112,7 +113,7 @@ final class ChannelDiscussionGroupSearchContainerNode: SearchDisplayControllerCo
private let themeAndStringsPromise: Promise<(PresentationTheme, PresentationStrings, PresentationPersonNameOrder, PresentationPersonNameOrder, PresentationDateTimeFormat)>
- init(context: AccountContextImpl, peers: [Peer], openPeer: @escaping (Peer) -> Void) {
+ init(context: AccountContext, peers: [Peer], openPeer: @escaping (Peer) -> Void) {
self.context = context
self.openPeer = openPeer
diff --git a/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupSetupController.swift b/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupSetupController.swift
index 46b8d0bb38..0e3b508be4 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupSetupController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupSetupController.swift
@@ -7,6 +7,8 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import OverlayStatusController
+import AccountContext
private final class ChannelDiscussionGroupSetupControllerArguments {
let account: Account
@@ -198,7 +200,7 @@ private struct ChannelDiscussionGroupSetupControllerState: Equatable {
var searching: Bool = false
}
-public func channelDiscussionGroupSetupController(context: AccountContextImpl, peerId: PeerId) -> ViewController {
+public func channelDiscussionGroupSetupController(context: AccountContext, peerId: PeerId) -> ViewController {
let statePromise = ValuePromise(ChannelDiscussionGroupSetupControllerState(), ignoreRepeated: true)
let stateValue = Atomic(value: ChannelDiscussionGroupSetupControllerState())
let updateState: ((ChannelDiscussionGroupSetupControllerState) -> ChannelDiscussionGroupSetupControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupSetupSearchItem.swift b/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupSetupSearchItem.swift
index 6eff16a1b5..df8da02ac5 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupSetupSearchItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelDiscussionGroupSetupSearchItem.swift
@@ -7,15 +7,16 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
+import AccountContext
final class ChannelDiscussionGroupSetupSearchItem: ItemListControllerSearch {
- let context: AccountContextImpl
+ let context: AccountContext
let peers: [Peer]
let cancel: () -> Void
let dismissInput: () -> Void
let openPeer: (Peer) -> Void
- init(context: AccountContextImpl, peers: [Peer], cancel: @escaping () -> Void, dismissInput: @escaping () -> Void, openPeer: @escaping (Peer) -> Void) {
+ init(context: AccountContext, peers: [Peer], cancel: @escaping () -> Void, dismissInput: @escaping () -> Void, openPeer: @escaping (Peer) -> Void) {
self.context = context
self.peers = peers
self.cancel = cancel
@@ -57,7 +58,7 @@ final class ChannelDiscussionGroupSetupSearchItem: ItemListControllerSearch {
private final class ChannelDiscussionGroupSetupSearchItemNode: ItemListControllerSearchNode {
private let containerNode: ChannelDiscussionGroupSearchContainerNode
- init(context: AccountContextImpl, peers: [Peer], openPeer: @escaping (Peer) -> Void, cancel: @escaping () -> Void, updateActivity: @escaping (Bool) -> Void, dismissInput: @escaping () -> Void) {
+ init(context: AccountContext, peers: [Peer], openPeer: @escaping (Peer) -> Void, cancel: @escaping () -> Void, updateActivity: @escaping (Bool) -> Void, dismissInput: @escaping () -> Void) {
self.containerNode = ChannelDiscussionGroupSearchContainerNode(context: context, peers: peers, openPeer: { peer in
openPeer(peer)
})
diff --git a/submodules/TelegramUI/TelegramUI/ChannelInfoController.swift b/submodules/TelegramUI/TelegramUI/ChannelInfoController.swift
index 7e1b07dc17..f0f6f0b0cb 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelInfoController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelInfoController.swift
@@ -10,6 +10,8 @@ import TelegramPresentationData
import ItemListUI
import AccountContext
import TextFormat
+import OverlayStatusController
+import TelegramStringFormatting
private final class ChannelInfoControllerArguments {
let account: Account
@@ -627,7 +629,7 @@ private func valuesRequiringUpdate(state: ChannelInfoState, view: PeerView) -> (
}
}
-public func channelInfoController(context: AccountContextImpl, peerId: PeerId) -> ViewController {
+public func channelInfoController(context: AccountContext, peerId: PeerId) -> ViewController {
let statePromise = ValuePromise(ChannelInfoState(), ignoreRepeated: true)
let stateValue = Atomic(value: ChannelInfoState())
let updateState: ((ChannelInfoState) -> ChannelInfoState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/ChannelMembersController.swift b/submodules/TelegramUI/TelegramUI/ChannelMembersController.swift
index de6c498f97..0b0ccd9adf 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelMembersController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelMembersController.swift
@@ -7,6 +7,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AccountContext
private final class ChannelMembersControllerArguments {
let account: Account
@@ -255,7 +256,7 @@ private struct ChannelMembersControllerState: Equatable {
}
}
-private func ChannelMembersControllerEntries(context: AccountContextImpl, presentationData: PresentationData, view: PeerView, state: ChannelMembersControllerState, participants: [RenderedChannelParticipant]?) -> [ChannelMembersEntry] {
+private func ChannelMembersControllerEntries(context: AccountContext, presentationData: PresentationData, view: PeerView, state: ChannelMembersControllerState, participants: [RenderedChannelParticipant]?) -> [ChannelMembersEntry] {
if participants == nil || participants?.count == nil {
return []
}
@@ -323,7 +324,7 @@ private func ChannelMembersControllerEntries(context: AccountContextImpl, presen
return entries
}
-public func channelMembersController(context: AccountContextImpl, peerId: PeerId) -> ViewController {
+public func channelMembersController(context: AccountContext, peerId: PeerId) -> ViewController {
let statePromise = ValuePromise(ChannelMembersControllerState(), ignoreRepeated: true)
let stateValue = Atomic(value: ChannelMembersControllerState())
let updateState: ((ChannelMembersControllerState) -> ChannelMembersControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/ChannelMembersSearchContainerNode.swift b/submodules/TelegramUI/TelegramUI/ChannelMembersSearchContainerNode.swift
index 8908bc184c..27211778ac 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelMembersSearchContainerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelMembersSearchContainerNode.swift
@@ -8,6 +8,8 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import MergeLists
+import AccountContext
+import TemporaryCachedPeerDataManager
enum ChannelMembersSearchMode {
case searchMembers
@@ -191,7 +193,7 @@ private enum GroupMemberCategory {
case members
}
-private func categorySignal(context: AccountContextImpl, peerId: PeerId, category: GroupMemberCategory) -> Signal<[RenderedChannelParticipant], NoError> {
+private func categorySignal(context: AccountContext, peerId: PeerId, category: GroupMemberCategory) -> Signal<[RenderedChannelParticipant], NoError> {
return Signal<[RenderedChannelParticipant], NoError> { subscriber in
let disposableAndLoadMoreControl: (Disposable, PeerChannelMemberCategoryControl?)
func processListState(_ listState: ChannelMemberListState) {
@@ -234,7 +236,7 @@ private struct GroupMembersSearchContextState {
final class GroupMembersSearchContext {
fileprivate let state = Promise()
- init(context: AccountContextImpl, peerId: PeerId) {
+ init(context: AccountContext, peerId: PeerId) {
assert(Queue.mainQueue().isCurrent())
let combinedSignal = combineLatest(queue: .mainQueue(), categorySignal(context: context, peerId: peerId, category: .contacts), categorySignal(context: context, peerId: peerId, category: .bots), categorySignal(context: context, peerId: peerId, category: .admins), categorySignal(context: context, peerId: peerId, category: .members))
@@ -268,7 +270,7 @@ private struct ChannelMembersSearchContainerState: Equatable {
}
final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let openPeer: (Peer, RenderedChannelParticipant?) -> Void
private let mode: ChannelMembersSearchMode
@@ -290,7 +292,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod
private let themeAndStringsPromise: Promise<(PresentationTheme, PresentationStrings, PresentationPersonNameOrder, PresentationPersonNameOrder, PresentationDateTimeFormat)>
- init(context: AccountContextImpl, peerId: PeerId, mode: ChannelMembersSearchMode, filters: [ChannelMembersSearchFilter], searchContext: GroupMembersSearchContext?, openPeer: @escaping (Peer, RenderedChannelParticipant?) -> Void, updateActivity: @escaping (Bool) -> Void, present: @escaping (ViewController, Any?) -> Void) {
+ init(context: AccountContext, peerId: PeerId, mode: ChannelMembersSearchMode, filters: [ChannelMembersSearchFilter], searchContext: GroupMembersSearchContext?, openPeer: @escaping (Peer, RenderedChannelParticipant?) -> Void, updateActivity: @escaping (Bool) -> Void, present: @escaping (ViewController, Any?) -> Void) {
self.context = context
self.openPeer = openPeer
self.mode = mode
diff --git a/submodules/TelegramUI/TelegramUI/ChannelMembersSearchController.swift b/submodules/TelegramUI/TelegramUI/ChannelMembersSearchController.swift
index 85f60b1e55..ec76ab46b3 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelMembersSearchController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelMembersSearchController.swift
@@ -5,6 +5,7 @@ import TelegramCore
import Postbox
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
enum ChannelMembersSearchControllerMode {
case promote
@@ -19,7 +20,7 @@ enum ChannelMembersSearchFilter {
final class ChannelMembersSearchController: ViewController {
private let queue = Queue()
- private let context: AccountContextImpl
+ private let context: AccountContext
private let peerId: PeerId
private let mode: ChannelMembersSearchControllerMode
private let filters: [ChannelMembersSearchFilter]
@@ -35,7 +36,7 @@ final class ChannelMembersSearchController: ViewController {
private var searchContentNode: NavigationBarSearchContentNode?
- init(context: AccountContextImpl, peerId: PeerId, mode: ChannelMembersSearchControllerMode, filters: [ChannelMembersSearchFilter] = [], openPeer: @escaping (Peer, RenderedChannelParticipant?) -> Void) {
+ init(context: AccountContext, peerId: PeerId, mode: ChannelMembersSearchControllerMode, filters: [ChannelMembersSearchFilter] = [], openPeer: @escaping (Peer, RenderedChannelParticipant?) -> Void) {
self.context = context
self.peerId = peerId
self.mode = mode
diff --git a/submodules/TelegramUI/TelegramUI/ChannelMembersSearchControllerNode.swift b/submodules/TelegramUI/TelegramUI/ChannelMembersSearchControllerNode.swift
index 64472e0c28..21d7238e3a 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelMembersSearchControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelMembersSearchControllerNode.swift
@@ -8,6 +8,8 @@ import SwiftSignalKit
import TelegramPresentationData
import TelegramUIPreferences
import MergeLists
+import AccountContext
+import TemporaryCachedPeerDataManager
private final class ChannelMembersSearchInteraction {
let openPeer: (Peer, RenderedChannelParticipant?) -> Void
@@ -87,7 +89,7 @@ private func preparedTransition(from fromEntries: [ChannelMembersSearchEntry]?,
}
class ChannelMembersSearchControllerNode: ASDisplayNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let peerId: PeerId
private let mode: ChannelMembersSearchControllerMode
private let filters: [ChannelMembersSearchFilter]
@@ -110,7 +112,7 @@ class ChannelMembersSearchControllerNode: ASDisplayNode {
private var disposable: Disposable?
private var listControl: PeerChannelMemberCategoryControl?
- init(context: AccountContextImpl, presentationData: PresentationData, peerId: PeerId, mode: ChannelMembersSearchControllerMode, filters: [ChannelMembersSearchFilter]) {
+ init(context: AccountContext, presentationData: PresentationData, peerId: PeerId, mode: ChannelMembersSearchControllerMode, filters: [ChannelMembersSearchFilter]) {
self.context = context
self.listNode = ListView()
self.peerId = peerId
diff --git a/submodules/TelegramUI/TelegramUI/ChannelOwnershipTransferController.swift b/submodules/TelegramUI/TelegramUI/ChannelOwnershipTransferController.swift
index 0a192358f1..c9d1ab783a 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelOwnershipTransferController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelOwnershipTransferController.swift
@@ -8,6 +8,7 @@ import TelegramCore
import TelegramPresentationData
import ActivityIndicator
import TextFormat
+import AccountContext
private final class ChannelOwnershipTransferPasswordFieldNode: ASDisplayNode, UITextFieldDelegate {
private var theme: PresentationTheme
@@ -399,7 +400,7 @@ private final class ChannelOwnershipTransferAlertContentNode: AlertContentNode {
}
}
-private func commitChannelOwnershipTransferController(context: AccountContextImpl, peer: Peer, member: TelegramUser, present: @escaping (ViewController, Any?) -> Void, completion: @escaping (PeerId?) -> Void) -> ViewController {
+private func commitChannelOwnershipTransferController(context: AccountContext, peer: Peer, member: TelegramUser, present: @escaping (ViewController, Any?) -> Void, completion: @escaping (PeerId?) -> Void) -> ViewController {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
var dismissImpl: (() -> Void)?
@@ -497,7 +498,7 @@ private func commitChannelOwnershipTransferController(context: AccountContextImp
return controller
}
-private func confirmChannelOwnershipTransferController(context: AccountContextImpl, peer: Peer, member: TelegramUser, present: @escaping (ViewController, Any?) -> Void, completion: @escaping (PeerId?) -> Void) -> ViewController {
+private func confirmChannelOwnershipTransferController(context: AccountContext, peer: Peer, member: TelegramUser, present: @escaping (ViewController, Any?) -> Void, completion: @escaping (PeerId?) -> Void) -> ViewController {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let theme = AlertControllerTheme(presentationTheme: presentationData.theme)
@@ -528,7 +529,7 @@ private func confirmChannelOwnershipTransferController(context: AccountContextIm
return controller
}
-func channelOwnershipTransferController(context: AccountContextImpl, peer: Peer, member: TelegramUser, initialError: ChannelOwnershipTransferError, present: @escaping (ViewController, Any?) -> Void, completion: @escaping (PeerId?) -> Void) -> ViewController {
+func channelOwnershipTransferController(context: AccountContext, peer: Peer, member: TelegramUser, initialError: ChannelOwnershipTransferError, present: @escaping (ViewController, Any?) -> Void, completion: @escaping (PeerId?) -> Void) -> ViewController {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let theme = AlertControllerTheme(presentationTheme: presentationData.theme)
diff --git a/submodules/TelegramUI/TelegramUI/ChannelPermissionsController.swift b/submodules/TelegramUI/TelegramUI/ChannelPermissionsController.swift
index 670c580c65..1287cec99d 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelPermissionsController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelPermissionsController.swift
@@ -7,6 +7,9 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import OverlayStatusController
+import AccountContext
+import TemporaryCachedPeerDataManager
private final class ChannelPermissionsControllerArguments {
let account: Account
@@ -446,7 +449,7 @@ private func channelPermissionsControllerEntries(presentationData: PresentationD
return entries
}
-public func channelPermissionsController(context: AccountContextImpl, peerId originalPeerId: PeerId, loadCompleted: @escaping () -> Void = {}) -> ViewController {
+public func channelPermissionsController(context: AccountContext, peerId originalPeerId: PeerId, loadCompleted: @escaping () -> Void = {}) -> ViewController {
let statePromise = ValuePromise(ChannelPermissionsControllerState(), ignoreRepeated: true)
let stateValue = Atomic(value: ChannelPermissionsControllerState())
let updateState: ((ChannelPermissionsControllerState) -> ChannelPermissionsControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/ChannelStatsController.swift b/submodules/TelegramUI/TelegramUI/ChannelStatsController.swift
index b3b8cc4277..5da8bc19eb 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelStatsController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelStatsController.swift
@@ -7,19 +7,20 @@ import SwiftSignalKit
import Postbox
import TelegramPresentationData
import ProgressNavigationButtonNode
+import AccountContext
final class ChannelStatsController: ViewController {
private var controllerNode: ChannelStatsControllerNode {
return self.displayNode as! ChannelStatsControllerNode
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private let url: String
private let peerId: PeerId
private var presentationData: PresentationData
- init(context: AccountContextImpl, url: String, peerId: PeerId) {
+ init(context: AccountContext, url: String, peerId: PeerId) {
self.context = context
self.url = url
self.peerId = peerId
diff --git a/submodules/TelegramUI/TelegramUI/ChannelStatsControllerNode.swift b/submodules/TelegramUI/TelegramUI/ChannelStatsControllerNode.swift
index c029f27a93..d4fe29f707 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelStatsControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelStatsControllerNode.swift
@@ -7,11 +7,12 @@ import TelegramCore
import Postbox
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
final class ChannelStatsControllerNode: ViewControllerTracingNode, WKNavigationDelegate {
private var webView: WKWebView?
- private let context: AccountContextImpl
+ private let context: AccountContext
private let peerId: PeerId
var presentationData: PresentationData
private let present: (ViewController, Any?) -> Void
@@ -19,7 +20,7 @@ final class ChannelStatsControllerNode: ViewControllerTracingNode, WKNavigationD
private let refreshDisposable = MetaDisposable()
- init(context: AccountContextImpl, presentationData: PresentationData, peerId: PeerId, url: String, present: @escaping (ViewController, Any?) -> Void, updateActivity: @escaping (Bool) -> Void) {
+ init(context: AccountContext, presentationData: PresentationData, peerId: PeerId, url: String, present: @escaping (ViewController, Any?) -> Void, updateActivity: @escaping (Bool) -> Void) {
self.context = context
self.presentationData = presentationData
self.peerId = peerId
diff --git a/submodules/TelegramUI/TelegramUI/ChannelVisibilityController.swift b/submodules/TelegramUI/TelegramUI/ChannelVisibilityController.swift
index 4e07377c03..241a727a4b 100644
--- a/submodules/TelegramUI/TelegramUI/ChannelVisibilityController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChannelVisibilityController.swift
@@ -7,6 +7,8 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import OverlayStatusController
+import AccountContext
private final class ChannelVisibilityControllerArguments {
let account: Account
@@ -795,7 +797,7 @@ public enum ChannelVisibilityControllerMode {
case privateLink
}
-public func channelVisibilityController(context: AccountContextImpl, peerId: PeerId, mode: ChannelVisibilityControllerMode, upgradedToSupergroup: @escaping (PeerId, @escaping () -> Void) -> Void) -> ViewController {
+public func channelVisibilityController(context: AccountContext, peerId: PeerId, mode: ChannelVisibilityControllerMode, upgradedToSupergroup: @escaping (PeerId, @escaping () -> Void) -> Void) -> ViewController {
let statePromise = ValuePromise(ChannelVisibilityControllerState(), ignoreRepeated: true)
let stateValue = Atomic(value: ChannelVisibilityControllerState())
let updateState: ((ChannelVisibilityControllerState) -> ChannelVisibilityControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/ChatAnimationGalleryItem.swift b/submodules/TelegramUI/TelegramUI/ChatAnimationGalleryItem.swift
index 3bb97eb68d..68750e6171 100644
--- a/submodules/TelegramUI/TelegramUI/ChatAnimationGalleryItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatAnimationGalleryItem.swift
@@ -8,14 +8,15 @@ import TelegramCore
import Lottie
import TelegramPresentationData
import AnimationUI
+import AccountContext
class ChatAnimationGalleryItem: GalleryItem {
- let context: AccountContextImpl
+ let context: AccountContext
let presentationData: PresentationData
let message: Message
let location: MessageHistoryEntryLocation?
- init(context: AccountContextImpl, presentationData: PresentationData, message: Message, location: MessageHistoryEntryLocation?) {
+ init(context: AccountContext, presentationData: PresentationData, message: Message, location: MessageHistoryEntryLocation?) {
self.context = context
self.presentationData = presentationData
self.message = message
@@ -66,7 +67,7 @@ private var backgroundButtonIcon: UIImage = {
}()
final class ChatAnimationGalleryItemNode: ZoomableContentGalleryItemNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var presentationData: PresentationData
private var message: Message?
@@ -80,14 +81,14 @@ final class ChatAnimationGalleryItemNode: ZoomableContentGalleryItemNode {
private let statusNode: RadialStatusNode
private let footerContentNode: ChatItemGalleryFooterContentNode
- private var contextAndMedia: (AccountContextImpl, AnyMediaReference)?
+ private var contextAndMedia: (AccountContext, AnyMediaReference)?
private var disposable = MetaDisposable()
private var fetchDisposable = MetaDisposable()
private let statusDisposable = MetaDisposable()
private var status: MediaResourceStatus?
- init(context: AccountContextImpl, presentationData: PresentationData) {
+ init(context: AccountContext, presentationData: PresentationData) {
self.context = context
self.presentationData = presentationData
@@ -132,7 +133,7 @@ final class ChatAnimationGalleryItemNode: ZoomableContentGalleryItemNode {
self.footerContentNode.setMessage(message)
}
- func setFile(context: AccountContextImpl, fileReference: FileMediaReference) {
+ func setFile(context: AccountContext, fileReference: FileMediaReference) {
if self.contextAndMedia == nil || !self.contextAndMedia!.1.media.isEqual(to: fileReference.media) {
let signal = chatMessageAnimatedStrickerBackingData(postbox: context.account.postbox, fileReference: fileReference, synchronousLoad: false)
|> mapToSignal { value -> Signal in
diff --git a/submodules/TelegramUI/TelegramUI/ChatAvatarNavigationNode.swift b/submodules/TelegramUI/TelegramUI/ChatAvatarNavigationNode.swift
index 03cd0acd59..24b080d8ff 100644
--- a/submodules/TelegramUI/TelegramUI/ChatAvatarNavigationNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatAvatarNavigationNode.swift
@@ -2,6 +2,7 @@ import Foundation
import UIKit
import AsyncDisplayKit
import Display
+import AvatarNode
private let normalFont = UIFont(name: ".SFCompactRounded-Semibold", size: 16.0)!
private let smallFont = UIFont(name: ".SFCompactRounded-Semibold", size: 12.0)!
diff --git a/submodules/TelegramUI/TelegramUI/ChatBubbleInstantVideoDecoration.swift b/submodules/TelegramUI/TelegramUI/ChatBubbleInstantVideoDecoration.swift
index d2820b6046..41906db6c7 100644
--- a/submodules/TelegramUI/TelegramUI/ChatBubbleInstantVideoDecoration.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatBubbleInstantVideoDecoration.swift
@@ -4,6 +4,7 @@ import AsyncDisplayKit
import Display
import SwiftSignalKit
import UniversalMediaPlayer
+import AccountContext
final class ChatBubbleInstantVideoDecoration: UniversalVideoDecoration {
let backgroundNode: ASDisplayNode?
diff --git a/submodules/TelegramUI/TelegramUI/ChatBubbleVideoDecoration.swift b/submodules/TelegramUI/TelegramUI/ChatBubbleVideoDecoration.swift
index 165328cedb..343f703fd5 100644
--- a/submodules/TelegramUI/TelegramUI/ChatBubbleVideoDecoration.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatBubbleVideoDecoration.swift
@@ -4,6 +4,7 @@ import AsyncDisplayKit
import Display
import SwiftSignalKit
import UniversalMediaPlayer
+import AccountContext
final class ChatBubbleVideoDecoration: UniversalVideoDecoration {
private let nativeSize: CGSize
diff --git a/submodules/TelegramUI/TelegramUI/ChatButtonKeyboardInputNode.swift b/submodules/TelegramUI/TelegramUI/ChatButtonKeyboardInputNode.swift
index 38c55bc98c..4b6c27902a 100644
--- a/submodules/TelegramUI/TelegramUI/ChatButtonKeyboardInputNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatButtonKeyboardInputNode.swift
@@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
private final class ChatButtonKeyboardInputButtonNode: ASButtonNode {
var button: ReplyMarkupButton?
@@ -29,7 +30,7 @@ private final class ChatButtonKeyboardInputButtonNode: ASButtonNode {
}
final class ChatButtonKeyboardInputNode: ChatInputNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let controllerInteraction: ChatControllerInteraction
private let separatorNode: ASDisplayNode
@@ -40,7 +41,7 @@ final class ChatButtonKeyboardInputNode: ChatInputNode {
private var theme: PresentationTheme?
- init(context: AccountContextImpl, controllerInteraction: ChatControllerInteraction) {
+ init(context: AccountContext, controllerInteraction: ChatControllerInteraction) {
self.context = context
self.controllerInteraction = controllerInteraction
diff --git a/submodules/TelegramUI/TelegramUI/ChatController.swift b/submodules/TelegramUI/TelegramUI/ChatController.swift
index 423f83d38f..58e2baae9a 100644
--- a/submodules/TelegramUI/TelegramUI/ChatController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatController.swift
@@ -13,6 +13,11 @@ import TelegramPresentationData
import TelegramUIPreferences
import DeviceAccess
import TextFormat
+import TelegramBaseController
+import AccountContext
+import TelegramStringFormatting
+import OverlayStatusController
+import DeviceLocationManager
public enum ChatControllerPeekActions {
case standard
@@ -101,7 +106,7 @@ private func calculateSlowmodeActiveUntilTimestamp(account: Account, untilTimest
let ChatControllerCount = Atomic(value: 0)
-public final class ChatController: TelegramController, GalleryHiddenMediaTarget, UIDropInteractionDelegate {
+public final class ChatController: TelegramBaseController, GalleryHiddenMediaTarget, UIDropInteractionDelegate {
private var validLayout: ContainerViewLayout?
weak var parentController: ViewController?
@@ -109,7 +114,7 @@ public final class ChatController: TelegramController, GalleryHiddenMediaTarget,
public var peekActions: ChatControllerPeekActions = .standard
private var didSetup3dTouch: Bool = false
- private let context: AccountContextImpl
+ private let context: AccountContext
public let chatLocation: ChatLocation
private let messageId: MessageId?
private let botStart: ChatControllerInitialBotStart?
@@ -264,7 +269,7 @@ public final class ChatController: TelegramController, GalleryHiddenMediaTarget,
var purposefulAction: (() -> Void)?
- public init(context: AccountContextImpl, chatLocation: ChatLocation, messageId: MessageId? = nil, botStart: ChatControllerInitialBotStart? = nil, mode: ChatControllerPresentationMode = .standard(previewing: false)) {
+ public init(context: AccountContext, chatLocation: ChatLocation, messageId: MessageId? = nil, botStart: ChatControllerInitialBotStart? = nil, mode: ChatControllerPresentationMode = .standard(previewing: false)) {
let _ = ChatControllerCount.modify { value in
return value + 1
}
@@ -372,7 +377,7 @@ public final class ChatController: TelegramController, GalleryHiddenMediaTarget,
}
}
- return openChatMessage(context: context, message: message, standalone: false, reverseMessageGalleryOrder: false, mode: mode, navigationController: strongSelf.navigationController as? NavigationController, dismissInput: {
+ return context.sharedContext.openChatMessage(OpenChatMessageParams(context: context, message: message, standalone: false, reverseMessageGalleryOrder: false, mode: mode, navigationController: strongSelf.navigationController as? NavigationController, dismissInput: {
self?.chatDisplayNode.dismissInput()
}, present: { c, a in
self?.present(c, in: .window(.root), with: a, blockInteraction: true)
@@ -409,7 +414,7 @@ public final class ChatController: TelegramController, GalleryHiddenMediaTarget,
if let strongSelf = self, let controllerInteraction = strongSelf.controllerInteraction {
var messageIdAndMedia: [MessageId: [Media]] = [:]
- if let entry = entry, entry.index == centralIndex {
+ if let entry = entry as? InstantPageGalleryEntry, entry.index == centralIndex {
messageIdAndMedia[message.id] = [galleryMedia]
}
@@ -471,7 +476,7 @@ public final class ChatController: TelegramController, GalleryHiddenMediaTarget,
if let strongSelf = self {
strongSelf.controllerInteraction?.addContact(phoneNumber)
}
- }))
+ })))
}, openPeer: { [weak self] id, navigation, fromMessage in
self?.openPeer(peerId: id, navigation: navigation, fromMessage: fromMessage)
}, openPeerMention: { [weak self] name in
@@ -3824,7 +3829,7 @@ public final class ChatController: TelegramController, GalleryHiddenMediaTarget,
}
}
- let shouldBeActive = combineLatest(MediaManager.globalAudioSession.isPlaybackActive() |> deliverOnMainQueue, self.chatDisplayNode.historyNode.hasVisiblePlayableItemNodes)
+ let shouldBeActive = combineLatest(self.context.sharedContext.mediaManager.audioSession.isPlaybackActive() |> deliverOnMainQueue, self.chatDisplayNode.historyNode.hasVisiblePlayableItemNodes)
|> mapToSignal { [weak self] isPlaybackActive, hasVisiblePlayableItemNodes -> Signal in
if hasVisiblePlayableItemNodes && !isPlaybackActive {
return Signal { [weak self] subscriber in
@@ -7071,7 +7076,7 @@ public final class ChatController: TelegramController, GalleryHiddenMediaTarget,
return inputShortcuts + otherShortcuts
}
- func getTransitionInfo(messageId: MessageId, media: Media) -> ((UIView) -> Void, ASDisplayNode, () -> (UIView?, UIView?))? {
+ public func getTransitionInfo(messageId: MessageId, media: Media) -> ((UIView) -> Void, ASDisplayNode, () -> (UIView?, UIView?))? {
var selectedNode: (ASDisplayNode, () -> (UIView?, UIView?))?
self.chatDisplayNode.historyNode.forEachItemNode { itemNode in
if let itemNode = itemNode as? ChatMessageItemView {
diff --git a/submodules/TelegramUI/TelegramUI/ChatControllerInteraction.swift b/submodules/TelegramUI/TelegramUI/ChatControllerInteraction.swift
index b68c91ae19..de290327bd 100644
--- a/submodules/TelegramUI/TelegramUI/ChatControllerInteraction.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatControllerInteraction.swift
@@ -5,23 +5,7 @@ import AsyncDisplayKit
import TelegramCore
import Display
import TelegramUIPreferences
-
-public enum ChatControllerInitialBotStartBehavior {
- case interactive
- case automatic(returnToPeerId: PeerId)
-}
-
-public struct ChatControllerInitialBotStart {
- let payload: String
- let behavior: ChatControllerInitialBotStartBehavior
-}
-
-public enum ChatControllerInteractionNavigateToPeer {
- case `default`
- case chat(textInputState: ChatTextInputState?, messageId: MessageId?)
- case info
- case withBotStartPayload(ChatControllerInitialBotStart)
-}
+import AccountContext
struct ChatInterfaceHighlightedState: Equatable {
let messageStableId: UInt32
@@ -56,15 +40,6 @@ public enum ChatControllerInteractionLongTapAction {
case timecode(Double, String)
}
-public enum ChatControllerInteractionOpenMessageMode {
- case `default`
- case stream
- case automaticPlayback
- case landscape
- case timecode(Double)
- case link
-}
-
struct ChatInterfacePollActionState: Equatable {
var pollMessageIdsInProgress: [MessageId: Data] = [:]
}
diff --git a/submodules/TelegramUI/TelegramUI/ChatControllerNode.swift b/submodules/TelegramUI/TelegramUI/ChatControllerNode.swift
index 41b451a70d..42728f2785 100644
--- a/submodules/TelegramUI/TelegramUI/ChatControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatControllerNode.swift
@@ -8,6 +8,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import TextFormat
+import AccountContext
private final class ChatControllerNodeView: UITracingLayerView, WindowInputAccessoryHeightProvider, PreviewingHostView {
var inputAccessoryHeight: (() -> CGFloat)?
@@ -53,7 +54,7 @@ private struct ChatControllerNodeDerivedLayoutState {
}
class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
- let context: AccountContextImpl
+ let context: AccountContext
let chatLocation: ChatLocation
let controllerInteraction: ChatControllerInteraction
private weak var controller: ChatController?
@@ -187,7 +188,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
}
}*/
- init(context: AccountContextImpl, chatLocation: ChatLocation, messageId: MessageId?, controllerInteraction: ChatControllerInteraction, chatPresentationInterfaceState: ChatPresentationInterfaceState, automaticMediaDownloadSettings: MediaAutoDownloadSettings, navigationBar: NavigationBar?, controller: ChatController?) {
+ init(context: AccountContext, chatLocation: ChatLocation, messageId: MessageId?, controllerInteraction: ChatControllerInteraction, chatPresentationInterfaceState: ChatPresentationInterfaceState, automaticMediaDownloadSettings: MediaAutoDownloadSettings, navigationBar: NavigationBar?, controller: ChatController?) {
self.context = context
self.chatLocation = chatLocation
self.controllerInteraction = controllerInteraction
diff --git a/submodules/TelegramUI/TelegramUI/ChatDocumentGalleryItem.swift b/submodules/TelegramUI/TelegramUI/ChatDocumentGalleryItem.swift
index 5ec96c62c0..71cd735363 100644
--- a/submodules/TelegramUI/TelegramUI/ChatDocumentGalleryItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatDocumentGalleryItem.swift
@@ -7,14 +7,15 @@ import SwiftSignalKit
import WebKit
import TelegramCore
import TelegramPresentationData
+import AccountContext
class ChatDocumentGalleryItem: GalleryItem {
- let context: AccountContextImpl
+ let context: AccountContext
let presentationData: PresentationData
let message: Message
let location: MessageHistoryEntryLocation?
- init(context: AccountContextImpl, presentationData: PresentationData, message: Message, location: MessageHistoryEntryLocation?) {
+ init(context: AccountContext, presentationData: PresentationData, message: Message, location: MessageHistoryEntryLocation?) {
self.context = context
self.presentationData = presentationData
self.message = message
@@ -93,7 +94,7 @@ class ChatDocumentGalleryItemNode: ZoomableContentGalleryItemNode, WKNavigationD
private let webView: UIView
- private var contextAndFile: (AccountContextImpl, FileMediaReference)?
+ private var contextAndFile: (AccountContext, FileMediaReference)?
private let dataDisposable = MetaDisposable()
private var itemIsVisible = false
@@ -106,7 +107,7 @@ class ChatDocumentGalleryItemNode: ZoomableContentGalleryItemNode, WKNavigationD
private let statusDisposable = MetaDisposable()
private var status: MediaResourceStatus?
- init(context: AccountContextImpl, presentationData: PresentationData) {
+ init(context: AccountContext, presentationData: PresentationData) {
if #available(iOSApplicationExtension 11.0, iOS 11.0, *) {
let preferences = WKPreferences()
preferences.javaScriptEnabled = false
@@ -165,7 +166,7 @@ class ChatDocumentGalleryItemNode: ZoomableContentGalleryItemNode, WKNavigationD
return .single(.dark)
}
- func setFile(context: AccountContextImpl, fileReference: FileMediaReference) {
+ func setFile(context: AccountContext, fileReference: FileMediaReference) {
let updateFile = self.contextAndFile?.1.media != fileReference.media
self.contextAndFile = (context, fileReference)
if updateFile {
@@ -179,7 +180,7 @@ class ChatDocumentGalleryItemNode: ZoomableContentGalleryItemNode, WKNavigationD
}
}
- private func setupStatus(context: AccountContextImpl, resource: MediaResource) {
+ private func setupStatus(context: AccountContext, resource: MediaResource) {
self.statusDisposable.set((context.account.postbox.mediaBox.resourceStatus(resource)
|> deliverOnMainQueue).start(next: { [weak self] status in
if let strongSelf = self {
diff --git a/submodules/TelegramUI/TelegramUI/ChatExternalFileGalleryItem.swift b/submodules/TelegramUI/TelegramUI/ChatExternalFileGalleryItem.swift
index 73190f37a3..49fa601902 100644
--- a/submodules/TelegramUI/TelegramUI/ChatExternalFileGalleryItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatExternalFileGalleryItem.swift
@@ -7,14 +7,15 @@ import SwiftSignalKit
import WebKit
import TelegramCore
import TelegramPresentationData
+import AccountContext
class ChatExternalFileGalleryItem: GalleryItem {
- let context: AccountContextImpl
+ let context: AccountContext
let presentationData: PresentationData
let message: Message
let location: MessageHistoryEntryLocation?
- init(context: AccountContextImpl, presentationData: PresentationData, message: Message, location: MessageHistoryEntryLocation?) {
+ init(context: AccountContext, presentationData: PresentationData, message: Message, location: MessageHistoryEntryLocation?) {
self.context = context
self.presentationData = presentationData
self.message = message
@@ -67,7 +68,7 @@ class ChatExternalFileGalleryItemNode: GalleryItemNode {
private let actionTitleNode: ImmediateTextNode
private let actionButtonNode: HighlightableButtonNode
- private var contextAndFile: (AccountContextImpl, FileMediaReference)?
+ private var contextAndFile: (AccountContext, FileMediaReference)?
private let dataDisposable = MetaDisposable()
private var itemIsVisible = false
@@ -80,7 +81,7 @@ class ChatExternalFileGalleryItemNode: GalleryItemNode {
private let statusDisposable = MetaDisposable()
private var status: MediaResourceStatus?
- init(context: AccountContextImpl, presentationData: PresentationData) {
+ init(context: AccountContext, presentationData: PresentationData) {
self.containerNode = ASDisplayNode()
self.containerNode.backgroundColor = .white
@@ -167,7 +168,7 @@ class ChatExternalFileGalleryItemNode: GalleryItemNode {
return .single(.dark)
}
- func setFile(context: AccountContextImpl, fileReference: FileMediaReference) {
+ func setFile(context: AccountContext, fileReference: FileMediaReference) {
let updateFile = self.contextAndFile?.1.media != fileReference.media
self.contextAndFile = (context, fileReference)
if updateFile {
@@ -176,7 +177,7 @@ class ChatExternalFileGalleryItemNode: GalleryItemNode {
}
}
- private func setupStatus(context: AccountContextImpl, resource: MediaResource) {
+ private func setupStatus(context: AccountContext, resource: MediaResource) {
self.statusDisposable.set((context.account.postbox.mediaBox.resourceStatus(resource)
|> deliverOnMainQueue).start(next: { [weak self] status in
if let strongSelf = self {
diff --git a/submodules/TelegramUI/TelegramUI/ChatHistoryEntriesForView.swift b/submodules/TelegramUI/TelegramUI/ChatHistoryEntriesForView.swift
index 50b44fc043..4c4d62bd62 100644
--- a/submodules/TelegramUI/TelegramUI/ChatHistoryEntriesForView.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatHistoryEntriesForView.swift
@@ -1,6 +1,7 @@
import Foundation
import Postbox
import TelegramCore
+import TemporaryCachedPeerDataManager
func chatHistoryEntriesForView(location: ChatLocation, view: MessageHistoryView, includeUnreadEntry: Bool, includeEmptyEntry: Bool, includeChatInfoEntry: Bool, includeSearchEntry: Bool, reverse: Bool, groupMessages: Bool, selectedMessages: Set?, presentationData: ChatPresentationData, historyAppearsCleared: Bool, associatedData: ChatMessageItemAssociatedData) -> [ChatHistoryEntry] {
if historyAppearsCleared {
diff --git a/submodules/TelegramUI/TelegramUI/ChatHistoryEntry.swift b/submodules/TelegramUI/TelegramUI/ChatHistoryEntry.swift
index 6c03908e49..460a99e826 100644
--- a/submodules/TelegramUI/TelegramUI/ChatHistoryEntry.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatHistoryEntry.swift
@@ -2,6 +2,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import MergeLists
+import TemporaryCachedPeerDataManager
public enum ChatHistoryMessageSelection: Equatable {
case none
diff --git a/submodules/TelegramUI/TelegramUI/ChatHistoryGridNode.swift b/submodules/TelegramUI/TelegramUI/ChatHistoryGridNode.swift
index 47d6bb11e4..c46ea1d3ed 100644
--- a/submodules/TelegramUI/TelegramUI/ChatHistoryGridNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatHistoryGridNode.swift
@@ -6,6 +6,7 @@ import Display
import AsyncDisplayKit
import TelegramCore
import TelegramPresentationData
+import AccountContext
private class ChatGridLiveSelectorRecognizer: UIPanGestureRecognizer {
private let selectionGestureActivationThreshold: CGFloat = 2.0
@@ -71,7 +72,7 @@ struct ChatHistoryGridViewTransition {
let stationaryItems: GridNodeStationaryItems
}
-private func mappedInsertEntries(context: AccountContextImpl, peerId: PeerId, controllerInteraction: ChatControllerInteraction, entries: [ChatHistoryViewTransitionInsertEntry], theme: PresentationTheme, strings: PresentationStrings) -> [GridNodeInsertItem] {
+private func mappedInsertEntries(context: AccountContext, peerId: PeerId, controllerInteraction: ChatControllerInteraction, entries: [ChatHistoryViewTransitionInsertEntry], theme: PresentationTheme, strings: PresentationStrings) -> [GridNodeInsertItem] {
return entries.map { entry -> GridNodeInsertItem in
switch entry.entry {
case let .MessageEntry(message, _, _, _, _, _):
@@ -88,7 +89,7 @@ private func mappedInsertEntries(context: AccountContextImpl, peerId: PeerId, co
}
}
-private func mappedUpdateEntries(context: AccountContextImpl, peerId: PeerId, controllerInteraction: ChatControllerInteraction, entries: [ChatHistoryViewTransitionUpdateEntry], theme: PresentationTheme, strings: PresentationStrings) -> [GridNodeUpdateItem] {
+private func mappedUpdateEntries(context: AccountContext, peerId: PeerId, controllerInteraction: ChatControllerInteraction, entries: [ChatHistoryViewTransitionUpdateEntry], theme: PresentationTheme, strings: PresentationStrings) -> [GridNodeUpdateItem] {
return entries.map { entry -> GridNodeUpdateItem in
switch entry.entry {
case let .MessageEntry(message, _, _, _, _, _):
@@ -105,7 +106,7 @@ private func mappedUpdateEntries(context: AccountContextImpl, peerId: PeerId, co
}
}
-private func mappedChatHistoryViewListTransition(context: AccountContextImpl, peerId: PeerId, controllerInteraction: ChatControllerInteraction, transition: ChatHistoryViewTransition, from: ChatHistoryView?, presentationData: ChatPresentationData) -> ChatHistoryGridViewTransition {
+private func mappedChatHistoryViewListTransition(context: AccountContext, peerId: PeerId, controllerInteraction: ChatControllerInteraction, transition: ChatHistoryViewTransition, from: ChatHistoryView?, presentationData: ChatPresentationData) -> ChatHistoryGridViewTransition {
var mappedScrollToItem: GridNodeScrollToItem?
if let scrollToItem = transition.scrollToItem {
let mappedPosition: GridNodeScrollToItemPosition
@@ -196,7 +197,7 @@ private func gridNodeLayoutForContainerLayout(size: CGSize) -> GridNodeLayoutTyp
}
public final class ChatHistoryGridNode: GridNode, ChatHistoryNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let peerId: PeerId
private let messageId: MessageId?
private let tagMask: MessageTags?
@@ -236,7 +237,7 @@ public final class ChatHistoryGridNode: GridNode, ChatHistoryNode {
private var loadStateUpdated: ((ChatHistoryNodeLoadState, Bool) -> Void)?
private let controllerInteraction: ChatControllerInteraction
- public init(context: AccountContextImpl, peerId: PeerId, messageId: MessageId?, tagMask: MessageTags?, controllerInteraction: ChatControllerInteraction) {
+ public init(context: AccountContext, peerId: PeerId, messageId: MessageId?, tagMask: MessageTags?, controllerInteraction: ChatControllerInteraction) {
self.context = context
self.peerId = peerId
self.messageId = messageId
diff --git a/submodules/TelegramUI/TelegramUI/ChatHistoryListNode.swift b/submodules/TelegramUI/TelegramUI/ChatHistoryListNode.swift
index f9679681d3..927b56aca1 100644
--- a/submodules/TelegramUI/TelegramUI/ChatHistoryListNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatHistoryListNode.swift
@@ -8,6 +8,8 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import MediaResources
+import AccountContext
+import TemporaryCachedPeerDataManager
private let historyMessageCount: Int = 100
@@ -174,7 +176,7 @@ private func maxMessageIndexForEntries(_ view: ChatHistoryView, indexRange: (Int
return (incoming, overall)
}
-private func mappedInsertEntries(context: AccountContextImpl, chatLocation: ChatLocation, associatedData: ChatMessageItemAssociatedData, controllerInteraction: ChatControllerInteraction, mode: ChatHistoryListMode, entries: [ChatHistoryViewTransitionInsertEntry]) -> [ListViewInsertItem] {
+private func mappedInsertEntries(context: AccountContext, chatLocation: ChatLocation, associatedData: ChatMessageItemAssociatedData, controllerInteraction: ChatControllerInteraction, mode: ChatHistoryListMode, entries: [ChatHistoryViewTransitionInsertEntry]) -> [ListViewInsertItem] {
return entries.map { entry -> ListViewInsertItem in
switch entry.entry {
case let .MessageEntry(message, presentationData, read, _, selection, attributes):
@@ -208,7 +210,7 @@ private func mappedInsertEntries(context: AccountContextImpl, chatLocation: Chat
}
}
-private func mappedUpdateEntries(context: AccountContextImpl, chatLocation: ChatLocation, associatedData: ChatMessageItemAssociatedData, controllerInteraction: ChatControllerInteraction, mode: ChatHistoryListMode, entries: [ChatHistoryViewTransitionUpdateEntry]) -> [ListViewUpdateItem] {
+private func mappedUpdateEntries(context: AccountContext, chatLocation: ChatLocation, associatedData: ChatMessageItemAssociatedData, controllerInteraction: ChatControllerInteraction, mode: ChatHistoryListMode, entries: [ChatHistoryViewTransitionUpdateEntry]) -> [ListViewUpdateItem] {
return entries.map { entry -> ListViewUpdateItem in
switch entry.entry {
case let .MessageEntry(message, presentationData, read, _, selection, attributes):
@@ -242,7 +244,7 @@ private func mappedUpdateEntries(context: AccountContextImpl, chatLocation: Chat
}
}
-private func mappedChatHistoryViewListTransition(context: AccountContextImpl, chatLocation: ChatLocation, associatedData: ChatMessageItemAssociatedData, controllerInteraction: ChatControllerInteraction, mode: ChatHistoryListMode, transition: ChatHistoryViewTransition) -> ChatHistoryListViewTransition {
+private func mappedChatHistoryViewListTransition(context: AccountContext, chatLocation: ChatLocation, associatedData: ChatMessageItemAssociatedData, controllerInteraction: ChatControllerInteraction, mode: ChatHistoryListMode, transition: ChatHistoryViewTransition) -> ChatHistoryListViewTransition {
return ChatHistoryListViewTransition(historyView: transition.historyView, deleteItems: transition.deleteItems, insertItems: mappedInsertEntries(context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, mode: mode, entries: transition.insertEntries), updateItems: mappedUpdateEntries(context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, mode: mode, entries: transition.updateEntries), options: transition.options, scrollToItem: transition.scrollToItem, stationaryItemRange: transition.stationaryItemRange, initialData: transition.initialData, keyboardButtonsMessage: transition.keyboardButtonsMessage, cachedData: transition.cachedData, cachedDataMessages: transition.cachedDataMessages, readStateData: transition.readStateData, scrolledToIndex: transition.scrolledToIndex, peerType: associatedData.automaticDownloadPeerType, networkType: associatedData.automaticDownloadNetworkType, animateIn: transition.animateIn, reason: transition.reason, flashIndicators: transition.flashIndicators)
}
@@ -331,7 +333,7 @@ private struct ChatHistoryAnimatedEmojiConfiguration {
}
public final class ChatHistoryListNode: ListView, ChatHistoryNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let chatLocation: ChatLocation
private let messageId: MessageId?
private let tagMask: MessageTags?
@@ -441,7 +443,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
private var loadedMessagesFromCachedDataDisposable: Disposable?
- public init(context: AccountContextImpl, chatLocation: ChatLocation, tagMask: MessageTags?, messageId: MessageId?, controllerInteraction: ChatControllerInteraction, selectedMessages: Signal?, NoError>, mode: ChatHistoryListMode = .bubbles) {
+ public init(context: AccountContext, chatLocation: ChatLocation, tagMask: MessageTags?, messageId: MessageId?, controllerInteraction: ChatControllerInteraction, selectedMessages: Signal?, NoError>, mode: ChatHistoryListMode = .bubbles) {
self.context = context
self.chatLocation = chatLocation
self.messageId = messageId
diff --git a/submodules/TelegramUI/TelegramUI/ChatHistoryLocation.swift b/submodules/TelegramUI/TelegramUI/ChatHistoryLocation.swift
index 05e94ae2e1..267303fa00 100644
--- a/submodules/TelegramUI/TelegramUI/ChatHistoryLocation.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatHistoryLocation.swift
@@ -2,19 +2,4 @@ import Postbox
import UIKit
import Display
-enum ChatHistoryInitialSearchLocation: Equatable {
- case index(MessageIndex)
- case id(MessageId)
-}
-struct ChatHistoryLocationInput: Equatable {
- let content: ChatHistoryLocation
- let id: Int32
-}
-
-enum ChatHistoryLocation: Equatable {
- case Initial(count: Int)
- case InitialSearch(location: ChatHistoryInitialSearchLocation, count: Int)
- case Navigation(index: MessageHistoryAnchorIndex, anchorIndex: MessageHistoryAnchorIndex, count: Int)
- case Scroll(index: MessageHistoryAnchorIndex, anchorIndex: MessageHistoryAnchorIndex, sourceIndex: MessageHistoryAnchorIndex, scrollPosition: ListViewScrollPosition, animated: Bool)
-}
diff --git a/submodules/TelegramUI/TelegramUI/ChatHistorySearchContainerNode.swift b/submodules/TelegramUI/TelegramUI/ChatHistorySearchContainerNode.swift
index 14fc2e51bf..b1985f860a 100644
--- a/submodules/TelegramUI/TelegramUI/ChatHistorySearchContainerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatHistorySearchContainerNode.swift
@@ -7,6 +7,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import MergeLists
+import AccountContext
private enum ChatHistorySearchEntryStableId: Hashable {
case messageId(MessageId)
@@ -78,7 +79,7 @@ private enum ChatHistorySearchEntry: Comparable, Identifiable {
}
}
- func item(context: AccountContextImpl, peerId: PeerId, interaction: ChatControllerInteraction) -> ListViewItem {
+ func item(context: AccountContext, peerId: PeerId, interaction: ChatControllerInteraction) -> ListViewItem {
switch self {
case let .message(message, theme, strings, dateTimeFormat):
return ListMessageItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, context: context, chatLocation: .peer(peerId), controllerInteraction: interaction, message: message, selection: .none, displayHeader: true)
@@ -94,7 +95,7 @@ private struct ChatHistorySearchContainerTransition {
let displayingResults: Bool
}
-private func chatHistorySearchContainerPreparedTransition(from fromEntries: [ChatHistorySearchEntry], to toEntries: [ChatHistorySearchEntry], query: String, displayingResults: Bool, context: AccountContextImpl, peerId: PeerId, interaction: ChatControllerInteraction) -> ChatHistorySearchContainerTransition {
+private func chatHistorySearchContainerPreparedTransition(from fromEntries: [ChatHistorySearchEntry], to toEntries: [ChatHistorySearchEntry], query: String, displayingResults: Bool, context: AccountContext, peerId: PeerId, interaction: ChatControllerInteraction) -> ChatHistorySearchContainerTransition {
let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries)
let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) }
@@ -105,7 +106,7 @@ private func chatHistorySearchContainerPreparedTransition(from fromEntries: [Cha
}
final class ChatHistorySearchContainerNode: SearchDisplayControllerContentNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let dimNode: ASDisplayNode
private let listNode: ListView
@@ -135,7 +136,7 @@ final class ChatHistorySearchContainerNode: SearchDisplayControllerContentNode {
private var enqueuedTransitions: [(ChatHistorySearchContainerTransition, Bool)] = []
- init(context: AccountContextImpl, peerId: PeerId, tagMask: MessageTags, interfaceInteraction: ChatControllerInteraction) {
+ init(context: AccountContext, peerId: PeerId, tagMask: MessageTags, interfaceInteraction: ChatControllerInteraction) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/ChatHistoryViewForLocation.swift b/submodules/TelegramUI/TelegramUI/ChatHistoryViewForLocation.swift
index 77559fe27e..7e95433d3c 100644
--- a/submodules/TelegramUI/TelegramUI/ChatHistoryViewForLocation.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatHistoryViewForLocation.swift
@@ -4,6 +4,7 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import Display
+import AccountContext
func preloadedChatHistoryViewForLocation(_ location: ChatHistoryLocationInput, account: Account, chatLocation: ChatLocation, fixedCombinedReadStates: MessageHistoryViewReadState?, tagMask: MessageTags?, additionalData: [AdditionalMessageHistoryViewData], orderStatistics: MessageHistoryViewOrderStatistics = []) -> Signal {
return chatHistoryViewForLocation(location, account: account, chatLocation: chatLocation, fixedCombinedReadStates: fixedCombinedReadStates, tagMask: tagMask, additionalData: additionalData, orderStatistics: orderStatistics)
diff --git a/submodules/TelegramUI/TelegramUI/ChatImageGalleryItem.swift b/submodules/TelegramUI/TelegramUI/ChatImageGalleryItem.swift
index a9c426c4bb..60c9719169 100644
--- a/submodules/TelegramUI/TelegramUI/ChatImageGalleryItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatImageGalleryItem.swift
@@ -6,6 +6,7 @@ import SwiftSignalKit
import Postbox
import TelegramCore
import TelegramPresentationData
+import AccountContext
enum ChatMediaGalleryThumbnail: Equatable {
case image(ImageMediaReference)
@@ -71,14 +72,14 @@ final class ChatMediaGalleryThumbnailItem: GalleryThumbnailItem {
}
class ChatImageGalleryItem: GalleryItem {
- let context: AccountContextImpl
+ let context: AccountContext
let presentationData: PresentationData
let message: Message
let location: MessageHistoryEntryLocation?
let performAction: (GalleryControllerInteractionTapAction) -> Void
let openActionOptions: (GalleryControllerInteractionTapAction) -> Void
- init(context: AccountContextImpl, presentationData: PresentationData, message: Message, location: MessageHistoryEntryLocation?, performAction: @escaping (GalleryControllerInteractionTapAction) -> Void, openActionOptions: @escaping (GalleryControllerInteractionTapAction) -> Void) {
+ init(context: AccountContext, presentationData: PresentationData, message: Message, location: MessageHistoryEntryLocation?, performAction: @escaping (GalleryControllerInteractionTapAction) -> Void, openActionOptions: @escaping (GalleryControllerInteractionTapAction) -> Void) {
self.context = context
self.presentationData = presentationData
self.message = message
@@ -146,7 +147,7 @@ class ChatImageGalleryItem: GalleryItem {
}
final class ChatImageGalleryItemNode: ZoomableContentGalleryItemNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var message: Message?
private let imageNode: TransformImageNode
@@ -156,13 +157,13 @@ final class ChatImageGalleryItemNode: ZoomableContentGalleryItemNode {
private let statusNode: RadialStatusNode
private let footerContentNode: ChatItemGalleryFooterContentNode
- private var contextAndMedia: (AccountContextImpl, AnyMediaReference)?
+ private var contextAndMedia: (AccountContext, AnyMediaReference)?
private var fetchDisposable = MetaDisposable()
private let statusDisposable = MetaDisposable()
private var status: MediaResourceStatus?
- init(context: AccountContextImpl, presentationData: PresentationData, performAction: @escaping (GalleryControllerInteractionTapAction) -> Void, openActionOptions: @escaping (GalleryControllerInteractionTapAction) -> Void) {
+ init(context: AccountContext, presentationData: PresentationData, performAction: @escaping (GalleryControllerInteractionTapAction) -> Void, openActionOptions: @escaping (GalleryControllerInteractionTapAction) -> Void) {
self.context = context
self.imageNode = TransformImageNode()
@@ -230,7 +231,7 @@ final class ChatImageGalleryItemNode: ZoomableContentGalleryItemNode {
self.contextAndMedia = (self.context, imageReference.abstract)
}
- func setFile(context: AccountContextImpl, fileReference: FileMediaReference) {
+ func setFile(context: AccountContext, fileReference: FileMediaReference) {
if self.contextAndMedia == nil || !self.contextAndMedia!.1.media.isEqual(to: fileReference.media) {
if var largestSize = fileReference.media.dimensions {
var displaySize = largestSize.dividedByScreenScale()
diff --git a/submodules/TelegramUI/TelegramUI/ChatInfo.swift b/submodules/TelegramUI/TelegramUI/ChatInfo.swift
index 2ed9d49434..2d6839c659 100644
--- a/submodules/TelegramUI/TelegramUI/ChatInfo.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatInfo.swift
@@ -2,7 +2,8 @@ import Foundation
import Postbox
import TelegramCore
import Display
+import AccountContext
-func peerSharedMediaController(context: AccountContextImpl, peerId: PeerId) -> ViewController? {
+func peerSharedMediaController(context: AccountContext, peerId: PeerId) -> ViewController? {
return PeerMediaCollectionController(context: context, peerId: peerId)
}
diff --git a/submodules/TelegramUI/TelegramUI/ChatInputContextPanelNode.swift b/submodules/TelegramUI/TelegramUI/ChatInputContextPanelNode.swift
index 01c9ab3e0b..2e74ea51aa 100644
--- a/submodules/TelegramUI/TelegramUI/ChatInputContextPanelNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatInputContextPanelNode.swift
@@ -4,6 +4,7 @@ import AsyncDisplayKit
import Display
import TelegramCore
import TelegramPresentationData
+import AccountContext
enum ChatInputContextPanelPlacement {
case overPanels
@@ -11,12 +12,12 @@ enum ChatInputContextPanelPlacement {
}
class ChatInputContextPanelNode: ASDisplayNode {
- let context: AccountContextImpl
+ let context: AccountContext
var interfaceInteraction: ChatPanelInterfaceInteraction?
var placement: ChatInputContextPanelPlacement = .overPanels
var theme: PresentationTheme
- init(context: AccountContextImpl, theme: PresentationTheme, strings: PresentationStrings) {
+ init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings) {
self.context = context
self.theme = theme
diff --git a/submodules/TelegramUI/TelegramUI/ChatInputPanelNode.swift b/submodules/TelegramUI/TelegramUI/ChatInputPanelNode.swift
index b078affb91..eb4914d024 100644
--- a/submodules/TelegramUI/TelegramUI/ChatInputPanelNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatInputPanelNode.swift
@@ -4,9 +4,10 @@ import AsyncDisplayKit
import Display
import Postbox
import TelegramCore
+import AccountContext
class ChatInputPanelNode: ASDisplayNode {
- var context: AccountContextImpl?
+ var context: AccountContext?
var interfaceInteraction: ChatPanelInterfaceInteraction?
func updateLayout(width: CGFloat, leftInset: CGFloat, rightInset: CGFloat, maxHeight: CGFloat, transition: ContainedViewLayoutTransition, interfaceState: ChatPresentationInterfaceState, metrics: LayoutMetrics) -> CGFloat {
diff --git a/submodules/TelegramUI/TelegramUI/ChatInterfaceInputContextPanels.swift b/submodules/TelegramUI/TelegramUI/ChatInterfaceInputContextPanels.swift
index d2b9042c7f..547cba4f8e 100644
--- a/submodules/TelegramUI/TelegramUI/ChatInterfaceInputContextPanels.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatInterfaceInputContextPanels.swift
@@ -1,6 +1,7 @@
import Foundation
import UIKit
import TelegramCore
+import AccountContext
private func inputQueryResultPriority(_ result: ChatPresentationInputQueryResult) -> (Int, Bool) {
switch result {
@@ -23,7 +24,7 @@ private func inputQueryResultPriority(_ result: ChatPresentationInputQueryResult
}
}
-func inputContextPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContextImpl, currentPanel: ChatInputContextPanelNode?, controllerInteraction: ChatControllerInteraction?, interfaceInteraction: ChatPanelInterfaceInteraction?) -> ChatInputContextPanelNode? {
+func inputContextPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, currentPanel: ChatInputContextPanelNode?, controllerInteraction: ChatControllerInteraction?, interfaceInteraction: ChatPanelInterfaceInteraction?) -> ChatInputContextPanelNode? {
guard let _ = chatPresentationInterfaceState.renderedPeer?.peer else {
return nil
}
@@ -164,7 +165,7 @@ func inputContextPanelForChatPresentationIntefaceState(_ chatPresentationInterfa
return nil
}
-func chatOverlayContextPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContextImpl, currentPanel: ChatInputContextPanelNode?, interfaceInteraction: ChatPanelInterfaceInteraction?) -> ChatInputContextPanelNode? {
+func chatOverlayContextPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, currentPanel: ChatInputContextPanelNode?, interfaceInteraction: ChatPanelInterfaceInteraction?) -> ChatInputContextPanelNode? {
guard let searchQuerySuggestionResult = chatPresentationInterfaceState.searchQuerySuggestionResult, let _ = chatPresentationInterfaceState.renderedPeer?.peer else {
return nil
}
diff --git a/submodules/TelegramUI/TelegramUI/ChatInterfaceInputContexts.swift b/submodules/TelegramUI/TelegramUI/ChatInterfaceInputContexts.swift
index 1fc4ead68e..bdfdebc011 100644
--- a/submodules/TelegramUI/TelegramUI/ChatInterfaceInputContexts.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatInterfaceInputContexts.swift
@@ -3,6 +3,7 @@ import UIKit
import TelegramCore
import Postbox
import Display
+import AccountContext
struct PossibleContextQueryTypes: OptionSet {
var rawValue: Int32
@@ -197,7 +198,7 @@ func inputContextQueriesForChatPresentationIntefaceState(_ chatPresentationInter
return result
}
-func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContextImpl) -> ChatTextInputPanelState {
+func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext) -> ChatTextInputPanelState {
var contextPlaceholder: NSAttributedString?
loop: for (_, result) in chatPresentationInterfaceState.inputQueryResults {
if case let .contextRequestResult(peer, _) = result, let botUser = peer as? TelegramUser, let botInfo = botUser.botInfo, let inlinePlaceholder = botInfo.inlinePlaceholder {
diff --git a/submodules/TelegramUI/TelegramUI/ChatInterfaceInputNodes.swift b/submodules/TelegramUI/TelegramUI/ChatInterfaceInputNodes.swift
index dffebaaa93..f9101fb299 100644
--- a/submodules/TelegramUI/TelegramUI/ChatInterfaceInputNodes.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatInterfaceInputNodes.swift
@@ -3,8 +3,9 @@ import UIKit
import AsyncDisplayKit
import TelegramCore
import Postbox
+import AccountContext
-func inputNodeForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContextImpl, currentNode: ChatInputNode?, interfaceInteraction: ChatPanelInterfaceInteraction?, inputMediaNode: ChatMediaInputNode?, controllerInteraction: ChatControllerInteraction, inputPanelNode: ChatInputPanelNode?) -> ChatInputNode? {
+func inputNodeForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, currentNode: ChatInputNode?, interfaceInteraction: ChatPanelInterfaceInteraction?, inputMediaNode: ChatMediaInputNode?, controllerInteraction: ChatControllerInteraction, inputPanelNode: ChatInputPanelNode?) -> ChatInputNode? {
if !(inputPanelNode is ChatTextInputPanelNode) {
return nil
}
diff --git a/submodules/TelegramUI/TelegramUI/ChatInterfaceState.swift b/submodules/TelegramUI/TelegramUI/ChatInterfaceState.swift
index f254b131ce..e39f318c37 100644
--- a/submodules/TelegramUI/TelegramUI/ChatInterfaceState.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatInterfaceState.swift
@@ -3,6 +3,7 @@ import UIKit
import Postbox
import TelegramCore
import TextFormat
+import AccountContext
struct ChatInterfaceSelectionState: PostboxCoding, Equatable {
let selectedIds: Set
@@ -30,215 +31,6 @@ struct ChatInterfaceSelectionState: PostboxCoding, Equatable {
}
}
-private enum ChatTextInputStateTextAttributeType: PostboxCoding, Equatable {
- case bold
- case italic
- case monospace
- case textMention(PeerId)
- case textUrl(String)
-
- init(decoder: PostboxDecoder) {
- switch decoder.decodeInt32ForKey("t", orElse: 0) {
- case 0:
- self = .bold
- case 1:
- self = .italic
- case 2:
- self = .monospace
- case 3:
- self = .textMention(PeerId(decoder.decodeInt64ForKey("peerId", orElse: 0)))
- case 4:
- self = .textUrl(decoder.decodeStringForKey("url", orElse: ""))
- default:
- assertionFailure()
- self = .bold
- }
- }
-
- func encode(_ encoder: PostboxEncoder) {
- switch self {
- case .bold:
- encoder.encodeInt32(0, forKey: "t")
- case .italic:
- encoder.encodeInt32(1, forKey: "t")
- case .monospace:
- encoder.encodeInt32(2, forKey: "t")
- case let .textMention(id):
- encoder.encodeInt32(3, forKey: "t")
- encoder.encodeInt64(id.toInt64(), forKey: "peerId")
- case let .textUrl(url):
- encoder.encodeInt32(4, forKey: "t")
- encoder.encodeString(url, forKey: "url")
- }
- }
-
- static func ==(lhs: ChatTextInputStateTextAttributeType, rhs: ChatTextInputStateTextAttributeType) -> Bool {
- switch lhs {
- case .bold:
- if case .bold = rhs {
- return true
- } else {
- return false
- }
- case .italic:
- if case .italic = rhs {
- return true
- } else {
- return false
- }
- case .monospace:
- if case .monospace = rhs {
- return true
- } else {
- return false
- }
- case let .textMention(id):
- if case .textMention(id) = rhs {
- return true
- } else {
- return false
- }
- case let .textUrl(url):
- if case .textUrl(url) = rhs {
- return true
- } else {
- return false
- }
- }
- }
-}
-
-private struct ChatTextInputStateTextAttribute: PostboxCoding, Equatable {
- let type: ChatTextInputStateTextAttributeType
- let range: Range
-
- init(type: ChatTextInputStateTextAttributeType, range: Range) {
- self.type = type
- self.range = range
- }
-
- init(decoder: PostboxDecoder) {
- self.type = decoder.decodeObjectForKey("type", decoder: { ChatTextInputStateTextAttributeType(decoder: $0) }) as! ChatTextInputStateTextAttributeType
- self.range = Int(decoder.decodeInt32ForKey("range0", orElse: 0)) ..< Int(decoder.decodeInt32ForKey("range1", orElse: 0))
- }
-
- func encode(_ encoder: PostboxEncoder) {
- encoder.encodeObject(self.type, forKey: "type")
- encoder.encodeInt32(Int32(self.range.lowerBound), forKey: "range0")
- encoder.encodeInt32(Int32(self.range.upperBound), forKey: "range1")
- }
-
- static func ==(lhs: ChatTextInputStateTextAttribute, rhs: ChatTextInputStateTextAttribute) -> Bool {
- return lhs.type == rhs.type && lhs.range == rhs.range
- }
-}
-
-private struct ChatTextInputStateText: PostboxCoding, Equatable {
- let text: String
- fileprivate let attributes: [ChatTextInputStateTextAttribute]
-
- init() {
- self.text = ""
- self.attributes = []
- }
-
- init(text: String, attributes: [ChatTextInputStateTextAttribute]) {
- self.text = text
- self.attributes = attributes
- }
-
- init(attributedText: NSAttributedString) {
- self.text = attributedText.string
- var parsedAttributes: [ChatTextInputStateTextAttribute] = []
- attributedText.enumerateAttributes(in: NSRange(location: 0, length: attributedText.length), options: [], using: { attributes, range, _ in
- for (key, value) in attributes {
- if key == ChatTextInputAttributes.bold {
- parsedAttributes.append(ChatTextInputStateTextAttribute(type: .bold, range: range.location ..< (range.location + range.length)))
- } else if key == ChatTextInputAttributes.italic {
- parsedAttributes.append(ChatTextInputStateTextAttribute(type: .italic, range: range.location ..< (range.location + range.length)))
- } else if key == ChatTextInputAttributes.monospace {
- parsedAttributes.append(ChatTextInputStateTextAttribute(type: .monospace, range: range.location ..< (range.location + range.length)))
- } else if key == ChatTextInputAttributes.textMention, let value = value as? ChatTextInputTextMentionAttribute {
- parsedAttributes.append(ChatTextInputStateTextAttribute(type: .textMention(value.peerId), range: range.location ..< (range.location + range.length)))
- } else if key == ChatTextInputAttributes.textUrl, let value = value as? ChatTextInputTextUrlAttribute {
- parsedAttributes.append(ChatTextInputStateTextAttribute(type: .textUrl(value.url), range: range.location ..< (range.location + range.length)))
- }
- }
- })
- self.attributes = parsedAttributes
- }
-
- init(decoder: PostboxDecoder) {
- self.text = decoder.decodeStringForKey("text", orElse: "")
- self.attributes = decoder.decodeObjectArrayWithDecoderForKey("attributes")
- }
-
- func encode(_ encoder: PostboxEncoder) {
- encoder.encodeString(self.text, forKey: "text")
- encoder.encodeObjectArray(self.attributes, forKey: "attributes")
- }
-
- static func ==(lhs: ChatTextInputStateText, rhs: ChatTextInputStateText) -> Bool {
- return lhs.text == rhs.text && lhs.attributes == rhs.attributes
- }
-
- func attributedText() -> NSAttributedString {
- let result = NSMutableAttributedString(string: self.text)
- for attribute in self.attributes {
- switch attribute.type {
- case .bold:
- result.addAttribute(ChatTextInputAttributes.bold, value: true as NSNumber, range: NSRange(location: attribute.range.lowerBound, length: attribute.range.count))
- case .italic:
- result.addAttribute(ChatTextInputAttributes.italic, value: true as NSNumber, range: NSRange(location: attribute.range.lowerBound, length: attribute.range.count))
- case .monospace:
- result.addAttribute(ChatTextInputAttributes.monospace, value: true as NSNumber, range: NSRange(location: attribute.range.lowerBound, length: attribute.range.count))
- case let .textMention(id):
- result.addAttribute(ChatTextInputAttributes.textMention, value: ChatTextInputTextMentionAttribute(peerId: id), range: NSRange(location: attribute.range.lowerBound, length: attribute.range.count))
- case let .textUrl(url):
- result.addAttribute(ChatTextInputAttributes.textUrl, value: ChatTextInputTextUrlAttribute(url: url), range: NSRange(location: attribute.range.lowerBound, length: attribute.range.count))
- }
- }
- return result
- }
-}
-
-public struct ChatTextInputState: PostboxCoding, Equatable {
- let inputText: NSAttributedString
- let selectionRange: Range
-
- public static func ==(lhs: ChatTextInputState, rhs: ChatTextInputState) -> Bool {
- return lhs.inputText.isEqual(to: rhs.inputText) && lhs.selectionRange == rhs.selectionRange
- }
-
- init() {
- self.inputText = NSAttributedString()
- self.selectionRange = 0 ..< 0
- }
-
- init(inputText: NSAttributedString, selectionRange: Range) {
- self.inputText = inputText
- self.selectionRange = selectionRange
- }
-
- init(inputText: NSAttributedString) {
- self.inputText = inputText
- let length = inputText.length
- self.selectionRange = length ..< length
- }
-
- public init(decoder: PostboxDecoder) {
- self.inputText = ((decoder.decodeObjectForKey("at", decoder: { ChatTextInputStateText(decoder: $0) }) as? ChatTextInputStateText) ?? ChatTextInputStateText()).attributedText()
- self.selectionRange = Int(decoder.decodeInt32ForKey("as0", orElse: 0)) ..< Int(decoder.decodeInt32ForKey("as1", orElse: 0))
- }
-
- public func encode(_ encoder: PostboxEncoder) {
- encoder.encodeObject(ChatTextInputStateText(attributedText: self.inputText), forKey: "at")
-
- encoder.encodeInt32(Int32(self.selectionRange.lowerBound), forKey: "as0")
- encoder.encodeInt32(Int32(self.selectionRange.upperBound), forKey: "as1")
- }
-}
-
struct ChatEditMessageState: PostboxCoding, Equatable {
let messageId: MessageId
let inputState: ChatTextInputState
diff --git a/submodules/TelegramUI/TelegramUI/ChatInterfaceStateAccessoryPanels.swift b/submodules/TelegramUI/TelegramUI/ChatInterfaceStateAccessoryPanels.swift
index 812c7e9bf4..07615f91e9 100644
--- a/submodules/TelegramUI/TelegramUI/ChatInterfaceStateAccessoryPanels.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatInterfaceStateAccessoryPanels.swift
@@ -2,8 +2,9 @@ import Foundation
import UIKit
import AsyncDisplayKit
import TelegramCore
+import AccountContext
-func accessoryPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContextImpl, currentPanel: AccessoryPanelNode?, interfaceInteraction: ChatPanelInterfaceInteraction?) -> AccessoryPanelNode? {
+func accessoryPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, currentPanel: AccessoryPanelNode?, interfaceInteraction: ChatPanelInterfaceInteraction?) -> AccessoryPanelNode? {
if let _ = chatPresentationInterfaceState.interfaceState.selectionState {
return nil
}
diff --git a/submodules/TelegramUI/TelegramUI/ChatInterfaceStateContextMenus.swift b/submodules/TelegramUI/TelegramUI/ChatInterfaceStateContextMenus.swift
index 94a23e56e9..07d56d9cae 100644
--- a/submodules/TelegramUI/TelegramUI/ChatInterfaceStateContextMenus.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatInterfaceStateContextMenus.swift
@@ -7,6 +7,8 @@ import UIKit
import SwiftSignalKit
import MobileCoreServices
import TelegramVoip
+import OverlayStatusController
+import AccountContext
private struct MessageContextMenuData {
let starStatus: Bool?
@@ -18,7 +20,7 @@ private struct MessageContextMenuData {
let messageActions: ChatAvailableMessageActions
}
-func canEditMessage(context: AccountContextImpl, limitsConfiguration: LimitsConfiguration, message: Message) -> Bool {
+func canEditMessage(context: AccountContext, limitsConfiguration: LimitsConfiguration, message: Message) -> Bool {
var hasEditRights = false
var unlimitedInterval = false
@@ -221,7 +223,7 @@ func updatedChatEditInterfaceMessagetState(state: ChatPresentationInterfaceState
return updated
}
-func contextMenuForChatPresentationIntefaceState(chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContextImpl, messages: [Message], controllerInteraction: ChatControllerInteraction?, selectAll: Bool, interfaceInteraction: ChatPanelInterfaceInteraction?) -> Signal<[ChatMessageContextMenuAction], NoError> {
+func contextMenuForChatPresentationIntefaceState(chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, messages: [Message], controllerInteraction: ChatControllerInteraction?, selectAll: Bool, interfaceInteraction: ChatPanelInterfaceInteraction?) -> Signal<[ChatMessageContextMenuAction], NoError> {
guard let interfaceInteraction = interfaceInteraction, let controllerInteraction = controllerInteraction else {
return .single([])
}
diff --git a/submodules/TelegramUI/TelegramUI/ChatInterfaceStateContextQueries.swift b/submodules/TelegramUI/TelegramUI/ChatInterfaceStateContextQueries.swift
index 260a5c039e..fe61e57bbd 100644
--- a/submodules/TelegramUI/TelegramUI/ChatInterfaceStateContextQueries.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatInterfaceStateContextQueries.swift
@@ -7,6 +7,7 @@ import TelegramUIPreferences
import TelegramUIPrivateModule
import LegacyComponents
import TextFormat
+import AccountContext
enum ChatContextQueryError {
case inlineBotLocationRequest(PeerId)
@@ -17,7 +18,7 @@ enum ChatContextQueryUpdate {
case update(ChatPresentationInputQuery, Signal<(ChatPresentationInputQueryResult?) -> ChatPresentationInputQueryResult?, ChatContextQueryError>)
}
-func contextQueryResultStateForChatInterfacePresentationState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContextImpl, currentQueryStates: inout [ChatPresentationInputQueryKind: (ChatPresentationInputQuery, Disposable)]) -> [ChatPresentationInputQueryKind: ChatContextQueryUpdate] {
+func contextQueryResultStateForChatInterfacePresentationState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, currentQueryStates: inout [ChatPresentationInputQueryKind: (ChatPresentationInputQuery, Disposable)]) -> [ChatPresentationInputQueryKind: ChatContextQueryUpdate] {
guard let peer = chatPresentationInterfaceState.renderedPeer?.peer else {
return [:]
}
@@ -60,7 +61,7 @@ func contextQueryResultStateForChatInterfacePresentationState(_ chatPresentation
return updates
}
-private func updatedContextQueryResultStateForQuery(context: AccountContextImpl, peer: Peer, inputQuery: ChatPresentationInputQuery, previousQuery: ChatPresentationInputQuery?) -> Signal<(ChatPresentationInputQueryResult?) -> ChatPresentationInputQueryResult?, ChatContextQueryError> {
+private func updatedContextQueryResultStateForQuery(context: AccountContext, peer: Peer, inputQuery: ChatPresentationInputQuery, previousQuery: ChatPresentationInputQuery?) -> Signal<(ChatPresentationInputQueryResult?) -> ChatPresentationInputQueryResult?, ChatContextQueryError> {
switch inputQuery {
case let .emoji(query):
var signal: Signal<(ChatPresentationInputQueryResult?) -> ChatPresentationInputQueryResult?, ChatContextQueryError> = .complete()
@@ -310,7 +311,7 @@ private func updatedContextQueryResultStateForQuery(context: AccountContextImpl,
}
}
-func searchQuerySuggestionResultStateForChatInterfacePresentationState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContextImpl, currentQuery: ChatPresentationInputQuery?) -> (ChatPresentationInputQuery?, Signal<(ChatPresentationInputQueryResult?) -> ChatPresentationInputQueryResult?, NoError>)? {
+func searchQuerySuggestionResultStateForChatInterfacePresentationState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, currentQuery: ChatPresentationInputQuery?) -> (ChatPresentationInputQuery?, Signal<(ChatPresentationInputQueryResult?) -> ChatPresentationInputQueryResult?, NoError>)? {
var inputQuery: ChatPresentationInputQuery?
if let search = chatPresentationInterfaceState.search {
switch search.domain {
@@ -364,7 +365,7 @@ func searchQuerySuggestionResultStateForChatInterfacePresentationState(_ chatPre
private let dataDetector = try? NSDataDetector(types: NSTextCheckingResult.CheckingType([.link]).rawValue)
-func urlPreviewStateForInputText(_ inputText: NSAttributedString?, context: AccountContextImpl, currentQuery: String?) -> (String?, Signal<(TelegramMediaWebpage?) -> TelegramMediaWebpage?, NoError>)? {
+func urlPreviewStateForInputText(_ inputText: NSAttributedString?, context: AccountContext, currentQuery: String?) -> (String?, Signal<(TelegramMediaWebpage?) -> TelegramMediaWebpage?, NoError>)? {
guard let text = inputText else {
if currentQuery != nil {
return (nil, .single({ _ in return nil }))
diff --git a/submodules/TelegramUI/TelegramUI/ChatInterfaceStateInputPanels.swift b/submodules/TelegramUI/TelegramUI/ChatInterfaceStateInputPanels.swift
index 76a583aad8..55fc4d6616 100644
--- a/submodules/TelegramUI/TelegramUI/ChatInterfaceStateInputPanels.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatInterfaceStateInputPanels.swift
@@ -2,8 +2,9 @@ import Foundation
import UIKit
import AsyncDisplayKit
import TelegramCore
+import AccountContext
-func inputPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContextImpl, currentPanel: ChatInputPanelNode?, textInputPanelNode: ChatTextInputPanelNode?, interfaceInteraction: ChatPanelInterfaceInteraction?) -> ChatInputPanelNode? {
+func inputPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, currentPanel: ChatInputPanelNode?, textInputPanelNode: ChatTextInputPanelNode?, interfaceInteraction: ChatPanelInterfaceInteraction?) -> ChatInputPanelNode? {
if let renderedPeer = chatPresentationInterfaceState.renderedPeer, renderedPeer.peer?.restrictionText != nil {
return nil
}
diff --git a/submodules/TelegramUI/TelegramUI/ChatInterfaceTitlePanelNodes.swift b/submodules/TelegramUI/TelegramUI/ChatInterfaceTitlePanelNodes.swift
index 59b1d885b4..9d5ec25225 100644
--- a/submodules/TelegramUI/TelegramUI/ChatInterfaceTitlePanelNodes.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatInterfaceTitlePanelNodes.swift
@@ -1,8 +1,9 @@
import Foundation
import UIKit
import TelegramCore
+import AccountContext
-func titlePanelForChatPresentationInterfaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContextImpl, currentPanel: ChatTitleAccessoryPanelNode?, interfaceInteraction: ChatPanelInterfaceInteraction?) -> ChatTitleAccessoryPanelNode? {
+func titlePanelForChatPresentationInterfaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, currentPanel: ChatTitleAccessoryPanelNode?, interfaceInteraction: ChatPanelInterfaceInteraction?) -> ChatTitleAccessoryPanelNode? {
if case .overlay = chatPresentationInterfaceState.mode {
return nil
}
diff --git a/submodules/TelegramUI/TelegramUI/ChatItemGalleryFooterContentNode.swift b/submodules/TelegramUI/TelegramUI/ChatItemGalleryFooterContentNode.swift
index c3c70429eb..7737f70ea5 100644
--- a/submodules/TelegramUI/TelegramUI/ChatItemGalleryFooterContentNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatItemGalleryFooterContentNode.swift
@@ -8,6 +8,8 @@ import SwiftSignalKit
import Photos
import TelegramPresentationData
import TextFormat
+import TelegramStringFormatting
+import AccountContext
private let deleteImage = generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Accessory Panels/MessageSelectionThrash"), color: .white)
private let actionImage = generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Accessory Panels/MessageSelectionAction"), color: .white)
@@ -137,7 +139,7 @@ class CaptionScrollWrapperNode: ASDisplayNode {
}
final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, UIScrollViewDelegate {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var theme: PresentationTheme
private var strings: PresentationStrings
private var dateTimeFormat: PresentationDateTimeFormat
@@ -254,7 +256,7 @@ final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, UIScroll
}
}
- init(context: AccountContextImpl, presentationData: PresentationData) {
+ init(context: AccountContext, presentationData: PresentationData) {
self.context = context
self.theme = presentationData.theme
self.strings = presentationData.strings
diff --git a/submodules/TelegramUI/TelegramUI/ChatListController.swift b/submodules/TelegramUI/TelegramUI/ChatListController.swift
index fab64158bd..3a14b3ee49 100644
--- a/submodules/TelegramUI/TelegramUI/ChatListController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatListController.swift
@@ -6,6 +6,9 @@ import Display
import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
+import TelegramBaseController
+import OverlayStatusController
+import AccountContext
public func useSpecialTabBarIcons() -> Bool {
return (Date(timeIntervalSince1970: 1545642000)...Date(timeIntervalSince1970: 1546387200)).contains(Date())
@@ -55,10 +58,10 @@ private func fixListNodeScrolling(_ listNode: ListView, searchNode: NavigationBa
return false
}
-public class ChatListController: TelegramController, UIViewControllerPreviewingDelegate {
+public class ChatListController: TelegramBaseController, UIViewControllerPreviewingDelegate {
private var validLayout: ContainerViewLayout?
- let context: AccountContextImpl
+ let context: AccountContext
private let controlsHistoryPreload: Bool
private let hideNetworkActivityStatus: Bool
@@ -102,7 +105,7 @@ public class ChatListController: TelegramController, UIViewControllerPreviewingD
}
}
- public init(context: AccountContextImpl, groupId: PeerGroupId, controlsHistoryPreload: Bool, hideNetworkActivityStatus: Bool = false) {
+ public init(context: AccountContext, groupId: PeerGroupId, controlsHistoryPreload: Bool, hideNetworkActivityStatus: Bool = false) {
self.context = context
self.controlsHistoryPreload = controlsHistoryPreload
self.hideNetworkActivityStatus = hideNetworkActivityStatus
diff --git a/submodules/TelegramUI/TelegramUI/ChatListControllerNode.swift b/submodules/TelegramUI/TelegramUI/ChatListControllerNode.swift
index 47486b6457..493229bf61 100644
--- a/submodules/TelegramUI/TelegramUI/ChatListControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatListControllerNode.swift
@@ -8,6 +8,7 @@ import SwiftSignalKit
import TelegramPresentationData
import MergeLists
import ActivityIndicator
+import AccountContext
private final class ChatListControllerNodeView: UITracingLayerView, PreviewingHostView {
var previewingDelegate: PreviewingHostViewDelegate? {
@@ -38,7 +39,7 @@ private struct TestItem: Comparable, Identifiable {
}
final class ChatListControllerNode: ASDisplayNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let groupId: PeerGroupId
private var presentationData: PresentationData
@@ -65,7 +66,7 @@ final class ChatListControllerNode: ASDisplayNode {
let debugListView = ListView()
- init(context: AccountContextImpl, groupId: PeerGroupId, controlsHistoryPreload: Bool, presentationData: PresentationData, controller: ChatListController) {
+ init(context: AccountContext, groupId: PeerGroupId, controlsHistoryPreload: Bool, presentationData: PresentationData, controller: ChatListController) {
self.context = context
self.groupId = groupId
self.presentationData = presentationData
diff --git a/submodules/TelegramUI/TelegramUI/ChatListItem.swift b/submodules/TelegramUI/TelegramUI/ChatListItem.swift
index 08eae964c4..092a43552c 100644
--- a/submodules/TelegramUI/TelegramUI/ChatListItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatListItem.swift
@@ -7,6 +7,9 @@ import SwiftSignalKit
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import AvatarNode
+import TelegramStringFormatting
+import AccountContext
enum ChatListItemContent {
case peer(message: Message?, peer: RenderedPeer, combinedReadState: CombinedPeerReadState?, notificationSettings: PeerNotificationSettings?, presence: PeerPresence?, summaryInfo: ChatListMessageTagSummaryInfo, embeddedState: PeerChatListEmbeddedInterfaceState?, inputActivities: [(Peer, PeerInputActivity)]?, isAd: Bool, ignoreUnreadBadge: Bool)
@@ -24,7 +27,7 @@ enum ChatListItemContent {
class ChatListItem: ListViewItem {
let presentationData: ChatListPresentationData
- let context: AccountContextImpl
+ let context: AccountContext
let peerGroupId: PeerGroupId
let index: ChatListIndex
let content: ChatListItemContent
@@ -43,7 +46,7 @@ class ChatListItem: ListViewItem {
let header: ListViewItemHeader?
- init(presentationData: ChatListPresentationData, context: AccountContextImpl, peerGroupId: PeerGroupId, index: ChatListIndex, content: ChatListItemContent, editing: Bool, hasActiveRevealControls: Bool, selected: Bool, header: ListViewItemHeader?, enableContextActions: Bool, hiddenOffset: Bool, interaction: ChatListNodeInteraction) {
+ init(presentationData: ChatListPresentationData, context: AccountContext, peerGroupId: PeerGroupId, index: ChatListIndex, content: ChatListItemContent, editing: Bool, hasActiveRevealControls: Bool, selected: Bool, header: ListViewItemHeader?, enableContextActions: Bool, hiddenOffset: Bool, interaction: ChatListNodeInteraction) {
self.presentationData = presentationData
self.peerGroupId = peerGroupId
self.context = context
diff --git a/submodules/TelegramUI/TelegramUI/ChatListNode.swift b/submodules/TelegramUI/TelegramUI/ChatListNode.swift
index d1388ee0df..566be61d57 100644
--- a/submodules/TelegramUI/TelegramUI/ChatListNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatListNode.swift
@@ -7,6 +7,7 @@ import TelegramCore
import Postbox
import TelegramPresentationData
import TelegramUIPreferences
+import AccountContext
public struct ChatListNodePeersFilter: OptionSet {
public var rawValue: Int32
@@ -142,7 +143,7 @@ struct ChatListNodeState: Equatable {
}
}
-private func mappedInsertEntries(context: AccountContextImpl, nodeInteraction: ChatListNodeInteraction, peerGroupId: PeerGroupId, mode: ChatListNodeMode, entries: [ChatListNodeViewTransitionInsertEntry]) -> [ListViewInsertItem] {
+private func mappedInsertEntries(context: AccountContext, nodeInteraction: ChatListNodeInteraction, peerGroupId: PeerGroupId, mode: ChatListNodeMode, entries: [ChatListNodeViewTransitionInsertEntry]) -> [ListViewInsertItem] {
return entries.map { entry -> ListViewInsertItem in
switch entry.entry {
case let .PeerEntry(index, presentationData, message, combinedReadState, notificationSettings, embeddedState, peer, presence, summaryInfo, editing, hasActiveRevealControls, selected, inputActivities, isAd):
@@ -223,7 +224,7 @@ private func mappedInsertEntries(context: AccountContextImpl, nodeInteraction: C
}
}
-private func mappedUpdateEntries(context: AccountContextImpl, nodeInteraction: ChatListNodeInteraction, peerGroupId: PeerGroupId, mode: ChatListNodeMode, entries: [ChatListNodeViewTransitionUpdateEntry]) -> [ListViewUpdateItem] {
+private func mappedUpdateEntries(context: AccountContext, nodeInteraction: ChatListNodeInteraction, peerGroupId: PeerGroupId, mode: ChatListNodeMode, entries: [ChatListNodeViewTransitionUpdateEntry]) -> [ListViewUpdateItem] {
return entries.map { entry -> ListViewUpdateItem in
switch entry.entry {
case let .PeerEntry(index, presentationData, message, combinedReadState, notificationSettings, embeddedState, peer, presence, summaryInfo, editing, hasActiveRevealControls, selected, inputActivities, isAd):
@@ -262,7 +263,7 @@ private func mappedUpdateEntries(context: AccountContextImpl, nodeInteraction: C
}
}
-private func mappedChatListNodeViewListTransition(context: AccountContextImpl, nodeInteraction: ChatListNodeInteraction, peerGroupId: PeerGroupId, mode: ChatListNodeMode, transition: ChatListNodeViewTransition) -> ChatListNodeListViewTransition {
+private func mappedChatListNodeViewListTransition(context: AccountContext, nodeInteraction: ChatListNodeInteraction, peerGroupId: PeerGroupId, mode: ChatListNodeMode, transition: ChatListNodeViewTransition) -> ChatListNodeListViewTransition {
return ChatListNodeListViewTransition(chatListView: transition.chatListView, deleteItems: transition.deleteItems, insertItems: mappedInsertEntries(context: context, nodeInteraction: nodeInteraction, peerGroupId: peerGroupId, mode: mode, entries: transition.insertEntries), updateItems: mappedUpdateEntries(context: context, nodeInteraction: nodeInteraction, peerGroupId: peerGroupId, mode: mode, entries: transition.updateEntries), options: transition.options, scrollToItem: transition.scrollToItem, stationaryItemRange: transition.stationaryItemRange)
}
@@ -305,7 +306,7 @@ enum ChatListNodeEmptyState: Equatable {
final class ChatListNode: ListView {
private let controlsHistoryPreload: Bool
- private let context: AccountContextImpl
+ private let context: AccountContext
private let groupId: PeerGroupId
private let mode: ChatListNodeMode
@@ -382,7 +383,7 @@ final class ChatListNode: ListView {
private var hapticFeedback: HapticFeedback?
- init(context: AccountContextImpl, groupId: PeerGroupId, controlsHistoryPreload: Bool, mode: ChatListNodeMode, theme: PresentationTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, disableAnimations: Bool) {
+ init(context: AccountContext, groupId: PeerGroupId, controlsHistoryPreload: Bool, mode: ChatListNodeMode, theme: PresentationTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, disableAnimations: Bool) {
self.context = context
self.groupId = groupId
self.controlsHistoryPreload = controlsHistoryPreload
diff --git a/submodules/TelegramUI/TelegramUI/ChatListSearchContainerNode.swift b/submodules/TelegramUI/TelegramUI/ChatListSearchContainerNode.swift
index 58e4263687..0f484cad55 100644
--- a/submodules/TelegramUI/TelegramUI/ChatListSearchContainerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatListSearchContainerNode.swift
@@ -8,6 +8,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import MergeLists
+import AccountContext
private enum ChatListRecentEntryStableId: Hashable {
case topPeers
@@ -72,7 +73,7 @@ private enum ChatListRecentEntry: Comparable, Identifiable {
}
}
- func item(context: AccountContextImpl, filter: ChatListNodePeersFilter, peerSelected: @escaping (Peer) -> Void, peerLongTapped: @escaping (Peer) -> Void, clearRecentlySearchedPeers: @escaping () -> Void, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, deletePeer: @escaping (PeerId) -> Void) -> ListViewItem {
+ func item(context: AccountContext, filter: ChatListNodePeersFilter, peerSelected: @escaping (Peer) -> Void, peerLongTapped: @escaping (Peer) -> Void, clearRecentlySearchedPeers: @escaping () -> Void, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, deletePeer: @escaping (PeerId) -> Void) -> ListViewItem {
switch self {
case let .topPeers(peers, theme, strings):
return ChatListRecentPeersListItem(theme: theme, strings: strings, account: context.account, peers: peers, peerSelected: { peer in
@@ -325,7 +326,7 @@ enum ChatListSearchEntry: Comparable, Identifiable {
}
}
- func item(context: AccountContextImpl, enableHeaders: Bool, filter: ChatListNodePeersFilter, interaction: ChatListNodeInteraction) -> ListViewItem {
+ func item(context: AccountContext, enableHeaders: Bool, filter: ChatListNodePeersFilter, interaction: ChatListNodeInteraction) -> ListViewItem {
switch self {
case let .localPeer(peer, associatedPeer, unreadBadge, _, theme, strings, nameSortOrder, nameDisplayOrder):
let primaryPeer: Peer
@@ -449,7 +450,7 @@ struct ChatListSearchContainerTransition {
let displayingResults: Bool
}
-private func chatListSearchContainerPreparedRecentTransition(from fromEntries: [ChatListRecentEntry], to toEntries: [ChatListRecentEntry], context: AccountContextImpl, filter: ChatListNodePeersFilter, peerSelected: @escaping (Peer) -> Void, peerLongTapped: @escaping (Peer) -> Void, clearRecentlySearchedPeers: @escaping () -> Void, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, deletePeer: @escaping (PeerId) -> Void) -> ChatListSearchContainerRecentTransition {
+private func chatListSearchContainerPreparedRecentTransition(from fromEntries: [ChatListRecentEntry], to toEntries: [ChatListRecentEntry], context: AccountContext, filter: ChatListNodePeersFilter, peerSelected: @escaping (Peer) -> Void, peerLongTapped: @escaping (Peer) -> Void, clearRecentlySearchedPeers: @escaping () -> Void, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, deletePeer: @escaping (PeerId) -> Void) -> ChatListSearchContainerRecentTransition {
let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries)
let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) }
@@ -459,7 +460,7 @@ private func chatListSearchContainerPreparedRecentTransition(from fromEntries: [
return ChatListSearchContainerRecentTransition(deletions: deletions, insertions: insertions, updates: updates)
}
-func chatListSearchContainerPreparedTransition(from fromEntries: [ChatListSearchEntry], to toEntries: [ChatListSearchEntry], displayingResults: Bool, context: AccountContextImpl, enableHeaders: Bool, filter: ChatListNodePeersFilter, interaction: ChatListNodeInteraction) -> ChatListSearchContainerTransition {
+func chatListSearchContainerPreparedTransition(from fromEntries: [ChatListSearchEntry], to toEntries: [ChatListSearchEntry], displayingResults: Bool, context: AccountContext, enableHeaders: Bool, filter: ChatListNodePeersFilter, interaction: ChatListNodeInteraction) -> ChatListSearchContainerTransition {
let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries)
let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) }
@@ -520,7 +521,7 @@ private struct ChatListSearchMessagesContext {
}
final class ChatListSearchContainerNode: SearchDisplayControllerContentNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let recentListNode: ListView
private let listNode: ListView
@@ -549,7 +550,7 @@ final class ChatListSearchContainerNode: SearchDisplayControllerContentNode {
private let filter: ChatListNodePeersFilter
- init(context: AccountContextImpl, filter: ChatListNodePeersFilter, groupId: PeerGroupId, openPeer: @escaping (Peer, Bool) -> Void, openRecentPeerOptions: @escaping (Peer) -> Void, openMessage: @escaping (Peer, MessageId) -> Void, addContact: ((String) -> Void)?) {
+ init(context: AccountContext, filter: ChatListNodePeersFilter, groupId: PeerGroupId, openPeer: @escaping (Peer, Bool) -> Void, openRecentPeerOptions: @escaping (Peer) -> Void, openMessage: @escaping (Peer, MessageId) -> Void, addContact: ((String) -> Void)?) {
self.context = context
self.filter = filter
self.dimNode = ASDisplayNode()
diff --git a/submodules/TelegramUI/TelegramUI/ChatMediaInputNode.swift b/submodules/TelegramUI/TelegramUI/ChatMediaInputNode.swift
index 8d0c5653e4..7e7062793f 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMediaInputNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMediaInputNode.swift
@@ -7,6 +7,7 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import MergeLists
+import AccountContext
private struct PeerSpecificPackData {
let peer: Peer
@@ -390,7 +391,7 @@ private final class CollectionListContainerNode: ASDisplayNode {
}
final class ChatMediaInputNode: ChatInputNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let peerId: PeerId?
private let controllerInteraction: ChatControllerInteraction
private let gifPaneIsActiveUpdated: (Bool) -> Void
@@ -435,7 +436,7 @@ final class ChatMediaInputNode: ChatInputNode {
return self._ready.get()
}
- init(context: AccountContextImpl, peerId: PeerId?, controllerInteraction: ChatControllerInteraction, theme: PresentationTheme, strings: PresentationStrings, gifPaneIsActiveUpdated: @escaping (Bool) -> Void) {
+ init(context: AccountContext, peerId: PeerId?, controllerInteraction: ChatControllerInteraction, theme: PresentationTheme, strings: PresentationStrings, gifPaneIsActiveUpdated: @escaping (Bool) -> Void) {
self.context = context
self.peerId = peerId
self.controllerInteraction = controllerInteraction
diff --git a/submodules/TelegramUI/TelegramUI/ChatMediaInputPeerSpecificItem.swift b/submodules/TelegramUI/TelegramUI/ChatMediaInputPeerSpecificItem.swift
index 9544895a55..9162d17f04 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMediaInputPeerSpecificItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMediaInputPeerSpecificItem.swift
@@ -6,6 +6,7 @@ import TelegramCore
import SwiftSignalKit
import Postbox
import TelegramPresentationData
+import AvatarNode
final class ChatMediaInputPeerSpecificItem: ListViewItem {
let account: Account
diff --git a/submodules/TelegramUI/TelegramUI/ChatMediaInputTrendingPane.swift b/submodules/TelegramUI/TelegramUI/ChatMediaInputTrendingPane.swift
index 4aac1bd2cf..fe878f5dc6 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMediaInputTrendingPane.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMediaInputTrendingPane.swift
@@ -7,6 +7,8 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import MergeLists
+import OverlayStatusController
+import AccountContext
final class TrendingPaneInteraction {
let installPack: (ItemCollectionInfo) -> Void
@@ -107,7 +109,7 @@ private func trendingPaneEntries(trendingEntries: [FeaturedStickerPackItem], ins
}
final class ChatMediaInputTrendingPane: ChatMediaInputPane {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let controllerInteraction: ChatControllerInteraction
private let getItemIsPreviewed: (StickerPackItem) -> Bool
@@ -127,7 +129,7 @@ final class ChatMediaInputTrendingPane: ChatMediaInputPane {
var scrollingInitiated: (() -> Void)?
- init(context: AccountContextImpl, controllerInteraction: ChatControllerInteraction, getItemIsPreviewed: @escaping (StickerPackItem) -> Bool) {
+ init(context: AccountContext, controllerInteraction: ChatControllerInteraction, getItemIsPreviewed: @escaping (StickerPackItem) -> Bool) {
self.context = context
self.controllerInteraction = controllerInteraction
self.getItemIsPreviewed = getItemIsPreviewed
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageActionButtonsNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageActionButtonsNode.swift
index e90094f074..97d3659fe1 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageActionButtonsNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageActionButtonsNode.swift
@@ -5,6 +5,7 @@ import TelegramCore
import Postbox
import Display
import TelegramPresentationData
+import AccountContext
private let titleFont = Font.medium(16.0)
@@ -82,7 +83,7 @@ private final class ChatMessageActionButtonNode: ASDisplayNode {
}
}
- class func asyncLayout(_ maybeNode: ChatMessageActionButtonNode?) -> (_ context: AccountContextImpl, _ theme: ChatPresentationThemeData, _ strings: PresentationStrings, _ message: Message, _ button: ReplyMarkupButton, _ constrainedWidth: CGFloat, _ position: MessageBubbleActionButtonPosition) -> (minimumWidth: CGFloat, layout: ((CGFloat) -> (CGSize, () -> ChatMessageActionButtonNode))) {
+ class func asyncLayout(_ maybeNode: ChatMessageActionButtonNode?) -> (_ context: AccountContext, _ theme: ChatPresentationThemeData, _ strings: PresentationStrings, _ message: Message, _ button: ReplyMarkupButton, _ constrainedWidth: CGFloat, _ position: MessageBubbleActionButtonPosition) -> (minimumWidth: CGFloat, layout: ((CGFloat) -> (CGSize, () -> ChatMessageActionButtonNode))) {
let titleLayout = TextNode.asyncLayout(maybeNode?.titleNode)
return { context, theme, strings, message, button, constrainedWidth, position in
@@ -214,7 +215,7 @@ final class ChatMessageActionButtonsNode: ASDisplayNode {
}
}
- class func asyncLayout(_ maybeNode: ChatMessageActionButtonsNode?) -> (_ context: AccountContextImpl, _ theme: ChatPresentationThemeData, _ strings: PresentationStrings, _ replyMarkup: ReplyMarkupMessageAttribute, _ message: Message, _ constrainedWidth: CGFloat) -> (minWidth: CGFloat, layout: (CGFloat) -> (CGSize, (_ animated: Bool) -> ChatMessageActionButtonsNode)) {
+ class func asyncLayout(_ maybeNode: ChatMessageActionButtonsNode?) -> (_ context: AccountContext, _ theme: ChatPresentationThemeData, _ strings: PresentationStrings, _ replyMarkup: ReplyMarkupMessageAttribute, _ message: Message, _ constrainedWidth: CGFloat) -> (minWidth: CGFloat, layout: (CGFloat) -> (CGSize, (_ animated: Bool) -> ChatMessageActionButtonsNode)) {
let currentButtonLayouts = maybeNode?.buttonNodes.map { ChatMessageActionButtonNode.asyncLayout($0) } ?? []
return { context, theme, strings, replyMarkup, message, constrainedWidth in
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageActionUrlAuthController.swift b/submodules/TelegramUI/TelegramUI/ChatMessageActionUrlAuthController.swift
index 06a390302e..9fcf97cfdb 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageActionUrlAuthController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageActionUrlAuthController.swift
@@ -8,6 +8,7 @@ import TelegramCore
import TelegramPresentationData
import CheckNode
import TextFormat
+import AccountContext
private let textFont = Font.regular(13.0)
private let boldTextFont = Font.semibold(13.0)
@@ -296,7 +297,7 @@ private final class ChatMessageActionUrlAuthAlertContentNode: AlertContentNode {
}
}
-func chatMessageActionUrlAuthController(context: AccountContextImpl, defaultUrl: String, domain: String, bot: Peer, requestWriteAccess: Bool, displayName: String, open: @escaping (Bool, Bool) -> Void) -> AlertController {
+func chatMessageActionUrlAuthController(context: AccountContext, defaultUrl: String, domain: String, bot: Peer, requestWriteAccess: Bool, displayName: String, open: @escaping (Bool, Bool) -> Void) -> AlertController {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let theme = presentationData.theme
let strings = presentationData.strings
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageAnimatedStickerItemNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageAnimatedStickerItemNode.swift
index 727f4f45d4..92f05cc5a7 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageAnimatedStickerItemNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageAnimatedStickerItemNode.swift
@@ -9,6 +9,7 @@ import CoreImage
import TelegramPresentationData
import Compression
import TextFormat
+import AccountContext
private let nameFont = Font.medium(14.0)
private let inlineBotPrefixFont = Font.regular(14.0)
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageAttachedContentNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageAttachedContentNode.swift
index 1d11c9589d..296b850d18 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageAttachedContentNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageAttachedContentNode.swift
@@ -9,6 +9,7 @@ import Postbox
import TelegramPresentationData
import TelegramUIPreferences
import TextFormat
+import AccountContext
private let titleFont = Font.semibold(15.0)
private let textFont = Font.regular(15.0)
@@ -229,7 +230,7 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
private var additionalImageBadgeNode: ChatMessageInteractiveMediaBadge?
private var linkHighlightingNode: LinkHighlightingNode?
- private var context: AccountContextImpl?
+ private var context: AccountContext?
private var message: Message?
private var media: Media?
private var theme: ChatPresentationThemeData?
@@ -271,7 +272,7 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
self.addSubnode(self.statusNode)
}
- func asyncLayout() -> (_ presentationData: ChatPresentationData, _ automaticDownloadSettings: MediaAutoDownloadSettings, _ associatedData: ChatMessageItemAssociatedData, _ context: AccountContextImpl, _ controllerInteraction: ChatControllerInteraction, _ message: Message, _ messageRead: Bool, _ title: String?, _ subtitle: NSAttributedString?, _ text: String?, _ entities: [MessageTextEntity]?, _ media: (Media, ChatMessageAttachedContentNodeMediaFlags)?, _ mediaBadge: String?, _ actionIcon: ChatMessageAttachedContentActionIcon?, _ actionTitle: String?, _ displayLine: Bool, _ layoutConstants: ChatMessageItemLayoutConstants, _ constrainedSize: CGSize) -> (CGFloat, (CGSize, ChatMessageBubbleContentPosition) -> (CGFloat, (CGFloat) -> (CGSize, (ListViewItemUpdateAnimation, Bool) -> Void))) {
+ func asyncLayout() -> (_ presentationData: ChatPresentationData, _ automaticDownloadSettings: MediaAutoDownloadSettings, _ associatedData: ChatMessageItemAssociatedData, _ context: AccountContext, _ controllerInteraction: ChatControllerInteraction, _ message: Message, _ messageRead: Bool, _ title: String?, _ subtitle: NSAttributedString?, _ text: String?, _ entities: [MessageTextEntity]?, _ media: (Media, ChatMessageAttachedContentNodeMediaFlags)?, _ mediaBadge: String?, _ actionIcon: ChatMessageAttachedContentActionIcon?, _ actionTitle: String?, _ displayLine: Bool, _ layoutConstants: ChatMessageItemLayoutConstants, _ constrainedSize: CGSize) -> (CGFloat, (CGSize, ChatMessageBubbleContentPosition) -> (CGFloat, (CGFloat) -> (CGSize, (ListViewItemUpdateAnimation, Bool) -> Void))) {
let textAsyncLayout = TextNode.asyncLayout(self.textNode)
let currentImage = self.media as? TelegramMediaImage
let imageLayout = self.inlineImageNode.asyncLayout()
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageAvatarAccessoryItem.swift b/submodules/TelegramUI/TelegramUI/ChatMessageAvatarAccessoryItem.swift
index ba500c8f21..21477ded25 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageAvatarAccessoryItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageAvatarAccessoryItem.swift
@@ -4,11 +4,13 @@ import Postbox
import Display
import TelegramCore
import TelegramPresentationData
+import AvatarNode
+import AccountContext
private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 16.0)!
final class ChatMessageAvatarAccessoryItem: ListViewAccessoryItem {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let peerId: PeerId
private let peer: Peer?
private let messageReference: MessageReference?
@@ -17,7 +19,7 @@ final class ChatMessageAvatarAccessoryItem: ListViewAccessoryItem {
private let day: Int32
- init(context: AccountContextImpl, peerId: PeerId, peer: Peer?, messageReference: MessageReference?, messageTimestamp: Int32, emptyColor: UIColor) {
+ init(context: AccountContext, peerId: PeerId, peer: Peer?, messageReference: MessageReference?, messageTimestamp: Int32, emptyColor: UIColor) {
self.context = context
self.peerId = peerId
self.peer = peer
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageBubbleContentNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageBubbleContentNode.swift
index 605abf112c..4e3bb82232 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageBubbleContentNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageBubbleContentNode.swift
@@ -5,6 +5,7 @@ import Display
import Postbox
import TelegramCore
import TelegramUIPreferences
+import AccountContext
enum ChatMessageBubbleContentBackgroundHiding {
case never
@@ -81,14 +82,14 @@ enum ChatMessageBubbleContentTapAction {
}
final class ChatMessageBubbleContentItem {
- let context: AccountContextImpl
+ let context: AccountContext
let controllerInteraction: ChatControllerInteraction
let message: Message
let read: Bool
let presentationData: ChatPresentationData
let associatedData: ChatMessageItemAssociatedData
- init(context: AccountContextImpl, controllerInteraction: ChatControllerInteraction, message: Message, read: Bool, presentationData: ChatPresentationData, associatedData: ChatMessageItemAssociatedData) {
+ init(context: AccountContext, controllerInteraction: ChatControllerInteraction, message: Message, read: Bool, presentationData: ChatPresentationData, associatedData: ChatMessageItemAssociatedData) {
self.context = context
self.controllerInteraction = controllerInteraction
self.message = message
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageBubbleItemNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageBubbleItemNode.swift
index fa9438ff29..c347b94226 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageBubbleItemNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageBubbleItemNode.swift
@@ -7,6 +7,8 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import TextFormat
+import AccountContext
+import TemporaryCachedPeerDataManager
private func contentNodeMessagesAndClassesForItem(_ item: ChatMessageItem) -> [(Message, AnyClass)] {
var result: [(Message, AnyClass)] = []
@@ -372,9 +374,9 @@ class ChatMessageBubbleItemNode: ChatMessageItemView {
authorNameLayout: (TextNodeLayoutArguments) -> (TextNodeLayout, () -> TextNode),
adminBadgeLayout: (TextNodeLayoutArguments) -> (TextNodeLayout, () -> TextNode),
forwardInfoLayout: (ChatPresentationData, PresentationStrings, ChatMessageForwardInfoType, Peer?, String?, CGSize) -> (CGSize, () -> ChatMessageForwardInfoNode),
- replyInfoLayout: (ChatPresentationData, PresentationStrings, AccountContextImpl, ChatMessageReplyInfoType, Message, CGSize) -> (CGSize, () -> ChatMessageReplyInfoNode),
- actionButtonsLayout: (AccountContextImpl, ChatPresentationThemeData, PresentationStrings, ReplyMarkupMessageAttribute, Message, CGFloat) -> (minWidth: CGFloat, layout: (CGFloat) -> (CGSize, (Bool) -> ChatMessageActionButtonsNode)),
- mosaicStatusLayout: (AccountContextImpl, ChatPresentationData, Bool, Int?, String, ChatMessageDateAndStatusType, CGSize) -> (CGSize, (Bool) -> ChatMessageDateAndStatusNode),
+ replyInfoLayout: (ChatPresentationData, PresentationStrings, AccountContext, ChatMessageReplyInfoType, Message, CGSize) -> (CGSize, () -> ChatMessageReplyInfoNode),
+ actionButtonsLayout: (AccountContext, ChatPresentationThemeData, PresentationStrings, ReplyMarkupMessageAttribute, Message, CGFloat) -> (minWidth: CGFloat, layout: (CGFloat) -> (CGSize, (Bool) -> ChatMessageActionButtonsNode)),
+ mosaicStatusLayout: (AccountContext, ChatPresentationData, Bool, Int?, String, ChatMessageDateAndStatusType, CGSize) -> (CGSize, (Bool) -> ChatMessageDateAndStatusNode),
currentShareButtonNode: HighlightableButtonNode?,
layoutConstants: ChatMessageItemLayoutConstants,
currentItem: ChatMessageItem?,
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageContactBubbleContentNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageContactBubbleContentNode.swift
index eea254f241..1ede92f814 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageContactBubbleContentNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageContactBubbleContentNode.swift
@@ -6,6 +6,8 @@ import SwiftSignalKit
import Postbox
import TelegramCore
import TelegramPresentationData
+import AvatarNode
+import AccountContext
private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 16.0)!
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageDateAndStatusNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageDateAndStatusNode.swift
index 4266ffcdc1..d78286a8ad 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageDateAndStatusNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageDateAndStatusNode.swift
@@ -5,6 +5,7 @@ import Postbox
import Display
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
private let dateFont = UIFont.italicSystemFont(ofSize: 11.0)
@@ -127,7 +128,7 @@ class ChatMessageDateAndStatusNode: ASDisplayNode {
self.addSubnode(self.dateNode)
}
- func asyncLayout() -> (_ context: AccountContextImpl, _ presentationData: ChatPresentationData, _ edited: Bool, _ impressionCount: Int?, _ dateText: String, _ type: ChatMessageDateAndStatusType, _ constrainedSize: CGSize) -> (CGSize, (Bool) -> Void) {
+ func asyncLayout() -> (_ context: AccountContext, _ presentationData: ChatPresentationData, _ edited: Bool, _ impressionCount: Int?, _ dateText: String, _ type: ChatMessageDateAndStatusType, _ constrainedSize: CGSize) -> (CGSize, (Bool) -> Void) {
let dateLayout = TextNode.asyncLayout(self.dateNode)
var checkReadNode = self.checkReadNode
@@ -506,7 +507,7 @@ class ChatMessageDateAndStatusNode: ASDisplayNode {
}
}
- static func asyncLayout(_ node: ChatMessageDateAndStatusNode?) -> (_ context: AccountContextImpl, _ presentationData: ChatPresentationData, _ edited: Bool, _ impressionCount: Int?, _ dateText: String, _ type: ChatMessageDateAndStatusType, _ constrainedSize: CGSize) -> (CGSize, (Bool) -> ChatMessageDateAndStatusNode) {
+ static func asyncLayout(_ node: ChatMessageDateAndStatusNode?) -> (_ context: AccountContext, _ presentationData: ChatPresentationData, _ edited: Bool, _ impressionCount: Int?, _ dateText: String, _ type: ChatMessageDateAndStatusType, _ constrainedSize: CGSize) -> (CGSize, (Bool) -> ChatMessageDateAndStatusNode) {
let currentLayout = node?.asyncLayout()
return { context, presentationData, edited, impressionCount, dateText, type, constrainedSize in
let resultNode: ChatMessageDateAndStatusNode
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageDateHeader.swift b/submodules/TelegramUI/TelegramUI/ChatMessageDateHeader.swift
index ff80ca22b1..3ea4bdb968 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageDateHeader.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageDateHeader.swift
@@ -4,6 +4,7 @@ import Display
import AsyncDisplayKit
import TelegramPresentationData
import Postbox
+import AccountContext
private let timezoneOffset: Int32 = {
let nowTimestamp = Int32(CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970)
@@ -21,10 +22,10 @@ final class ChatMessageDateHeader: ListViewItemHeader {
let id: Int64
let presentationData: ChatPresentationData
- let context: AccountContextImpl
+ let context: AccountContext
let action: ((Int32) -> Void)?
- init(timestamp: Int32, presentationData: ChatPresentationData, context: AccountContextImpl, action: ((Int32) -> Void)? = nil) {
+ init(timestamp: Int32, presentationData: ChatPresentationData, context: AccountContext, action: ((Int32) -> Void)? = nil) {
self.timestamp = timestamp
self.presentationData = presentationData
self.context = context
@@ -86,13 +87,13 @@ final class ChatMessageDateHeaderNode: ListViewItemHeaderNode {
private let localTimestamp: Int32
private var presentationData: ChatPresentationData
- private let context: AccountContextImpl
+ private let context: AccountContext
private var flashingOnScrolling = false
private var stickDistanceFactor: CGFloat = 0.0
private var action: ((Int32) -> Void)? = nil
- init(localTimestamp: Int32, presentationData: ChatPresentationData, context: AccountContextImpl, action: ((Int32) -> Void)? = nil) {
+ init(localTimestamp: Int32, presentationData: ChatPresentationData, context: AccountContext, action: ((Int32) -> Void)? = nil) {
self.presentationData = presentationData
self.context = context
@@ -161,7 +162,7 @@ final class ChatMessageDateHeaderNode: ListViewItemHeaderNode {
self.view.addGestureRecognizer(ListViewTapGestureRecognizer(target: self, action: #selector(self.tapGesture(_:))))
}
- func updatePresentationData(_ presentationData: ChatPresentationData, context: AccountContextImpl) {
+ func updatePresentationData(_ presentationData: ChatPresentationData, context: AccountContext) {
let graphics = PresentationResourcesChat.principalGraphics(mediaBox: context.account.postbox.mediaBox, knockoutWallpaper: context.sharedContext.immediateExperimentalUISettings.knockoutWallpaper, theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper)
self.backgroundNode.image = graphics.dateStaticBackground
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageInstantVideoItemNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageInstantVideoItemNode.swift
index 1c6b12f95f..58830a2d43 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageInstantVideoItemNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageInstantVideoItemNode.swift
@@ -8,6 +8,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import TextFormat
+import AccountContext
private let nameFont = Font.medium(14.0)
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveFileNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveFileNode.swift
index 20a898be70..d07e1eb221 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveFileNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveFileNode.swift
@@ -7,6 +7,7 @@ import Display
import TelegramCore
import UniversalMediaPlayer
import TelegramPresentationData
+import AccountContext
private struct FetchControls {
let fetch: () -> Void
@@ -60,7 +61,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode {
var activateLocalContent: () -> Void = { }
var requestUpdateLayout: (Bool) -> Void = { _ in }
- private var context: AccountContextImpl?
+ private var context: AccountContext?
private var message: Message?
private var themeAndStrings: (ChatPresentationThemeData, PresentationStrings, String)?
private var file: TelegramMediaFile?
@@ -184,7 +185,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode {
}
}
- func asyncLayout() -> (_ context: AccountContextImpl, _ presentationData: ChatPresentationData, _ message: Message, _ file: TelegramMediaFile, _ automaticDownload: Bool, _ incoming: Bool, _ isRecentActions: Bool, _ forcedResourceStatus: FileMediaResourceStatus?, _ dateAndStatusType: ChatMessageDateAndStatusType?, _ constrainedSize: CGSize) -> (CGFloat, (CGSize) -> (CGFloat, (CGFloat) -> (CGSize, (Bool) -> Void))) {
+ func asyncLayout() -> (_ context: AccountContext, _ presentationData: ChatPresentationData, _ message: Message, _ file: TelegramMediaFile, _ automaticDownload: Bool, _ incoming: Bool, _ isRecentActions: Bool, _ forcedResourceStatus: FileMediaResourceStatus?, _ dateAndStatusType: ChatMessageDateAndStatusType?, _ constrainedSize: CGSize) -> (CGFloat, (CGSize) -> (CGFloat, (CGFloat) -> (CGSize, (Bool) -> Void))) {
let currentFile = self.file
let titleAsyncLayout = TextNode.asyncLayout(self.titleNode)
@@ -859,12 +860,12 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode {
self.fetchingCompactTextNode.frame = CGRect(origin: self.descriptionNode.frame.origin, size: fetchingCompactSize)
}
- static func asyncLayout(_ node: ChatMessageInteractiveFileNode?) -> (_ context: AccountContextImpl, _ presentationData: ChatPresentationData, _ message: Message, _ file: TelegramMediaFile, _ automaticDownload: Bool, _ incoming: Bool, _ isRecentActions: Bool, _ forcedResourceStatus: FileMediaResourceStatus?, _ dateAndStatusType: ChatMessageDateAndStatusType?, _ constrainedSize: CGSize) -> (CGFloat, (CGSize) -> (CGFloat, (CGFloat) -> (CGSize, (Bool) -> ChatMessageInteractiveFileNode))) {
+ static func asyncLayout(_ node: ChatMessageInteractiveFileNode?) -> (_ context: AccountContext, _ presentationData: ChatPresentationData, _ message: Message, _ file: TelegramMediaFile, _ automaticDownload: Bool, _ incoming: Bool, _ isRecentActions: Bool, _ forcedResourceStatus: FileMediaResourceStatus?, _ dateAndStatusType: ChatMessageDateAndStatusType?, _ constrainedSize: CGSize) -> (CGFloat, (CGSize) -> (CGFloat, (CGFloat) -> (CGSize, (Bool) -> ChatMessageInteractiveFileNode))) {
let currentAsyncLayout = node?.asyncLayout()
return { context, presentationData, message, file, automaticDownload, incoming, isRecentActions, forcedResourceStatus, dateAndStatusType, constrainedSize in
var fileNode: ChatMessageInteractiveFileNode
- var fileLayout: (_ context: AccountContextImpl, _ presentationData: ChatPresentationData, _ message: Message, _ file: TelegramMediaFile, _ automaticDownload: Bool, _ incoming: Bool, _ isRecentActions: Bool, _ forcedResourceStatus: FileMediaResourceStatus?, _ dateAndStatusType: ChatMessageDateAndStatusType?, _ constrainedSize: CGSize) -> (CGFloat, (CGSize) -> (CGFloat, (CGFloat) -> (CGSize, (Bool) -> Void)))
+ var fileLayout: (_ context: AccountContext, _ presentationData: ChatPresentationData, _ message: Message, _ file: TelegramMediaFile, _ automaticDownload: Bool, _ incoming: Bool, _ isRecentActions: Bool, _ forcedResourceStatus: FileMediaResourceStatus?, _ dateAndStatusType: ChatMessageDateAndStatusType?, _ constrainedSize: CGSize) -> (CGFloat, (CGSize) -> (CGFloat, (CGFloat) -> (CGSize, (Bool) -> Void)))
if let node = node, let currentAsyncLayout = currentAsyncLayout {
fileNode = node
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveInstantVideoNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveInstantVideoNode.swift
index ab9c101940..0f7ca428ff 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveInstantVideoNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveInstantVideoNode.swift
@@ -7,6 +7,7 @@ import Postbox
import TelegramCore
import UniversalMediaPlayer
import TelegramPresentationData
+import AccountContext
struct ChatMessageInstantVideoItemLayoutResult {
let contentSize: CGSize
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveMediaNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveMediaNode.swift
index 626a095eb4..2dababfa93 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveMediaNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveMediaNode.swift
@@ -9,6 +9,7 @@ import TelegramPresentationData
import TelegramUIPreferences
import UniversalMediaPlayer
import TextFormat
+import AccountContext
private struct FetchControls {
let fetch: (Bool) -> Void
@@ -53,7 +54,7 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode {
private var badgeNode: ChatMessageInteractiveMediaBadge?
private var tapRecognizer: UITapGestureRecognizer?
- private var context: AccountContextImpl?
+ private var context: AccountContext?
private var message: Message?
private var media: Media?
private var themeAndStrings: (PresentationTheme, PresentationStrings, String)?
@@ -200,7 +201,7 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode {
}
}
- func asyncLayout() -> (_ context: AccountContextImpl, _ theme: PresentationTheme, _ strings: PresentationStrings, _ dateTimeFormat: PresentationDateTimeFormat, _ message: Message, _ media: Media, _ automaticDownload: InteractiveMediaNodeAutodownloadMode, _ peerType: MediaAutoDownloadPeerType, _ sizeCalculation: InteractiveMediaNodeSizeCalculation, _ layoutConstants: ChatMessageItemLayoutConstants, _ contentMode: InteractiveMediaNodeContentMode) -> (CGSize, CGFloat, (CGSize, Bool, Bool, ImageCorners) -> (CGFloat, (CGFloat) -> (CGSize, (ContainedViewLayoutTransition, Bool) -> Void))) {
+ func asyncLayout() -> (_ context: AccountContext, _ theme: PresentationTheme, _ strings: PresentationStrings, _ dateTimeFormat: PresentationDateTimeFormat, _ message: Message, _ media: Media, _ automaticDownload: InteractiveMediaNodeAutodownloadMode, _ peerType: MediaAutoDownloadPeerType, _ sizeCalculation: InteractiveMediaNodeSizeCalculation, _ layoutConstants: ChatMessageItemLayoutConstants, _ contentMode: InteractiveMediaNodeContentMode) -> (CGSize, CGFloat, (CGSize, Bool, Bool, ImageCorners) -> (CGFloat, (CGFloat) -> (CGSize, (ContainedViewLayoutTransition, Bool) -> Void))) {
let currentMessage = self.message
let currentMedia = self.media
let imageLayout = self.imageNode.asyncLayout()
@@ -1201,12 +1202,12 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode {
}
}
- static func asyncLayout(_ node: ChatMessageInteractiveMediaNode?) -> (_ context: AccountContextImpl, _ theme: PresentationTheme, _ strings: PresentationStrings, _ dateTimeFormat: PresentationDateTimeFormat, _ message: Message, _ media: Media, _ automaticDownload: InteractiveMediaNodeAutodownloadMode, _ peerType: MediaAutoDownloadPeerType, _ sizeCalculation: InteractiveMediaNodeSizeCalculation, _ layoutConstants: ChatMessageItemLayoutConstants, _ contentMode: InteractiveMediaNodeContentMode) -> (CGSize, CGFloat, (CGSize, Bool, Bool, ImageCorners) -> (CGFloat, (CGFloat) -> (CGSize, (ContainedViewLayoutTransition, Bool) -> ChatMessageInteractiveMediaNode))) {
+ static func asyncLayout(_ node: ChatMessageInteractiveMediaNode?) -> (_ context: AccountContext, _ theme: PresentationTheme, _ strings: PresentationStrings, _ dateTimeFormat: PresentationDateTimeFormat, _ message: Message, _ media: Media, _ automaticDownload: InteractiveMediaNodeAutodownloadMode, _ peerType: MediaAutoDownloadPeerType, _ sizeCalculation: InteractiveMediaNodeSizeCalculation, _ layoutConstants: ChatMessageItemLayoutConstants, _ contentMode: InteractiveMediaNodeContentMode) -> (CGSize, CGFloat, (CGSize, Bool, Bool, ImageCorners) -> (CGFloat, (CGFloat) -> (CGSize, (ContainedViewLayoutTransition, Bool) -> ChatMessageInteractiveMediaNode))) {
let currentAsyncLayout = node?.asyncLayout()
return { context, theme, strings, dateTimeFormat, message, media, automaticDownload, peerType, sizeCalculation, layoutConstants, contentMode in
var imageNode: ChatMessageInteractiveMediaNode
- var imageLayout: (_ context: AccountContextImpl, _ theme: PresentationTheme, _ strings: PresentationStrings, _ dateTimeFormat: PresentationDateTimeFormat, _ message: Message, _ media: Media, _ automaticDownload: InteractiveMediaNodeAutodownloadMode, _ peerType: MediaAutoDownloadPeerType, _ sizeCalculation: InteractiveMediaNodeSizeCalculation, _ layoutConstants: ChatMessageItemLayoutConstants, _ contentMode: InteractiveMediaNodeContentMode) -> (CGSize, CGFloat, (CGSize, Bool, Bool, ImageCorners) -> (CGFloat, (CGFloat) -> (CGSize, (ContainedViewLayoutTransition, Bool) -> Void)))
+ var imageLayout: (_ context: AccountContext, _ theme: PresentationTheme, _ strings: PresentationStrings, _ dateTimeFormat: PresentationDateTimeFormat, _ message: Message, _ media: Media, _ automaticDownload: InteractiveMediaNodeAutodownloadMode, _ peerType: MediaAutoDownloadPeerType, _ sizeCalculation: InteractiveMediaNodeSizeCalculation, _ layoutConstants: ChatMessageItemLayoutConstants, _ contentMode: InteractiveMediaNodeContentMode) -> (CGSize, CGFloat, (CGSize, Bool, Bool, ImageCorners) -> (CGFloat, (CGFloat) -> (CGSize, (ContainedViewLayoutTransition, Bool) -> Void)))
if let node = node, let currentAsyncLayout = currentAsyncLayout {
imageNode = node
@@ -1306,7 +1307,7 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode {
if let videoNode = self.videoNode, let context = self.context, (self.automaticPlayback ?? false) && !isAnimated {
return ({ timecode in
if let timecode = timecode {
- context.sharedContext.mediaManager.playlistControl(.playback(.pause))
+ context.sharedContext.mediaManager.playlistControl(.playback(.pause), type: nil)
videoNode.playOnceWithSound(playAndRecord: false, seek: .timecode(timecode), actionAtEnd: actionAtEnd)
} else {
let _ = (context.sharedContext.mediaManager.globalMediaPlayerState
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageItem.swift b/submodules/TelegramUI/TelegramUI/ChatMessageItem.swift
index 56868c88df..155a64cb8f 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageItem.swift
@@ -7,6 +7,7 @@ import SwiftSignalKit
import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
+import AccountContext
public enum ChatMessageItemContent: Sequence {
case message(message: Message, read: Bool, selection: ChatHistoryMessageSelection, attributes: ChatMessageEntryAttributes)
@@ -246,7 +247,7 @@ public final class ChatMessageItemAssociatedData: Equatable {
public final class ChatMessageItem: ListViewItem, CustomStringConvertible {
let presentationData: ChatPresentationData
- let context: AccountContextImpl
+ let context: AccountContext
let chatLocation: ChatLocation
let associatedData: ChatMessageItemAssociatedData
let controllerInteraction: ChatControllerInteraction
@@ -276,7 +277,7 @@ public final class ChatMessageItem: ListViewItem, CustomStringConvertible {
}
}
- public init(presentationData: ChatPresentationData, context: AccountContextImpl, chatLocation: ChatLocation, associatedData: ChatMessageItemAssociatedData, controllerInteraction: ChatControllerInteraction, content: ChatMessageItemContent, disableDate: Bool = false, additionalContent: ChatMessageItemAdditionalContent? = nil) {
+ public init(presentationData: ChatPresentationData, context: AccountContext, chatLocation: ChatLocation, associatedData: ChatMessageItemAssociatedData, controllerInteraction: ChatControllerInteraction, content: ChatMessageItemContent, disableDate: Bool = false, additionalContent: ChatMessageItemAdditionalContent? = nil) {
self.presentationData = presentationData
self.context = context
self.chatLocation = chatLocation
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageItemView.swift b/submodules/TelegramUI/TelegramUI/ChatMessageItemView.swift
index 64cbd15aa9..76f4c4e8dc 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageItemView.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageItemView.swift
@@ -4,6 +4,7 @@ import AsyncDisplayKit
import Display
import Postbox
import TelegramCore
+import AccountContext
struct ChatMessageItemWidthFill {
let compactInset: CGFloat
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageLiveLocationPositionNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageLiveLocationPositionNode.swift
index e492a7ce61..9ecdfbd2fe 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageLiveLocationPositionNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageLiveLocationPositionNode.swift
@@ -5,6 +5,7 @@ import AsyncDisplayKit
import TelegramCore
import Postbox
import TelegramPresentationData
+import AvatarNode
private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 24.0)!
private let avatarBackgroundImage = UIImage(bundleImageName: "Chat/Message/LocationPin")?.precomposed()
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageLiveLocationTextNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageLiveLocationTextNode.swift
index f4a5872358..e1cc7e6739 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageLiveLocationTextNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageLiveLocationTextNode.swift
@@ -4,6 +4,7 @@ import AsyncDisplayKit
import Display
import TelegramPresentationData
import TelegramUIPreferences
+import TelegramStringFormatting
private let textFont: UIFont = Font.regular(14.0)
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageMapBubbleContentNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageMapBubbleContentNode.swift
index d6b9423015..4e0700c33c 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageMapBubbleContentNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageMapBubbleContentNode.swift
@@ -5,6 +5,7 @@ import Display
import SwiftSignalKit
import Postbox
import TelegramCore
+import LiveLocationTimerNode
private let titleFont = Font.medium(14.0)
private let liveTitleFont = Font.medium(16.0)
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageMediaBubbleContentNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageMediaBubbleContentNode.swift
index 78ae58ebcf..6926a26b28 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageMediaBubbleContentNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageMediaBubbleContentNode.swift
@@ -6,6 +6,7 @@ import SwiftSignalKit
import Postbox
import TelegramCore
import TelegramUIPreferences
+import AccountContext
class ChatMessageMediaBubbleContentNode: ChatMessageBubbleContentNode {
override var supportsMosaic: Bool {
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageNotificationItem.swift b/submodules/TelegramUI/TelegramUI/ChatMessageNotificationItem.swift
index 5f820f907a..4e5d45eca8 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageNotificationItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageNotificationItem.swift
@@ -7,9 +7,11 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import TelegramUIPreferences
+import AvatarNode
+import AccountContext
public final class ChatMessageNotificationItem: NotificationItem {
- let context: AccountContextImpl
+ let context: AccountContext
let strings: PresentationStrings
let nameDisplayOrder: PresentationPersonNameOrder
let messages: [Message]
@@ -20,7 +22,7 @@ public final class ChatMessageNotificationItem: NotificationItem {
return messages.first?.id.peerId
}
- public init(context: AccountContextImpl, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, messages: [Message], tapAction: @escaping () -> Bool, expandAction: @escaping (() -> (ASDisplayNode?, () -> Void)) -> Void) {
+ public init(context: AccountContext, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, messages: [Message], tapAction: @escaping () -> Bool, expandAction: @escaping (() -> (ASDisplayNode?, () -> Void)) -> Void) {
self.context = context
self.strings = strings
self.nameDisplayOrder = nameDisplayOrder
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageReplyInfoNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageReplyInfoNode.swift
index bd17d3fe45..7cd6983b75 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageReplyInfoNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageReplyInfoNode.swift
@@ -6,6 +6,7 @@ import Display
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
private let titleFont = Font.medium(14.0)
private let textFont = Font.regular(14.0)
@@ -41,7 +42,7 @@ class ChatMessageReplyInfoNode: ASDisplayNode {
self.contentNode.addSubnode(self.lineNode)
}
- class func asyncLayout(_ maybeNode: ChatMessageReplyInfoNode?) -> (_ theme: ChatPresentationData, _ strings: PresentationStrings, _ context: AccountContextImpl, _ type: ChatMessageReplyInfoType, _ message: Message, _ constrainedSize: CGSize) -> (CGSize, () -> ChatMessageReplyInfoNode) {
+ class func asyncLayout(_ maybeNode: ChatMessageReplyInfoNode?) -> (_ theme: ChatPresentationData, _ strings: PresentationStrings, _ context: AccountContext, _ type: ChatMessageReplyInfoType, _ message: Message, _ constrainedSize: CGSize) -> (CGSize, () -> ChatMessageReplyInfoNode) {
let titleNodeLayout = TextNode.asyncLayout(maybeNode?.titleNode)
let textNodeLayout = TextNode.asyncLayout(maybeNode?.textNode)
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageStickerItemNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageStickerItemNode.swift
index 8a36354cfc..f7d51055a3 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageStickerItemNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageStickerItemNode.swift
@@ -7,6 +7,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import TextFormat
+import AccountContext
private let nameFont = Font.medium(14.0)
private let inlineBotPrefixFont = Font.regular(14.0)
diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageWebpageBubbleContentNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageWebpageBubbleContentNode.swift
index 1241971ba7..5f12057862 100644
--- a/submodules/TelegramUI/TelegramUI/ChatMessageWebpageBubbleContentNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatMessageWebpageBubbleContentNode.swift
@@ -7,6 +7,7 @@ import SwiftSignalKit
import TelegramCore
import TelegramUIPreferences
import TextFormat
+import AccountContext
enum WebsiteType {
case generic
diff --git a/submodules/TelegramUI/TelegramUI/ChatPanelInterfaceInteraction.swift b/submodules/TelegramUI/TelegramUI/ChatPanelInterfaceInteraction.swift
index e041698ced..babac77bb7 100644
--- a/submodules/TelegramUI/TelegramUI/ChatPanelInterfaceInteraction.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatPanelInterfaceInteraction.swift
@@ -4,6 +4,7 @@ import Postbox
import SwiftSignalKit
import TelegramCore
import Display
+import AccountContext
public enum ChatFinishMediaRecordingAction {
case dismiss
diff --git a/submodules/TelegramUI/TelegramUI/ChatPinnedMessageTitlePanelNode.swift b/submodules/TelegramUI/TelegramUI/ChatPinnedMessageTitlePanelNode.swift
index 0abcf97a3b..d45c99d556 100644
--- a/submodules/TelegramUI/TelegramUI/ChatPinnedMessageTitlePanelNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatPinnedMessageTitlePanelNode.swift
@@ -7,9 +7,10 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import TelegramUIPreferences
+import AccountContext
final class ChatPinnedMessageTitlePanelNode: ChatTitleAccessoryPanelNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let tapButton: HighlightTrackingButtonNode
private let closeButton: HighlightableButtonNode
private let lineNode: ASImageNode
@@ -27,7 +28,7 @@ final class ChatPinnedMessageTitlePanelNode: ChatTitleAccessoryPanelNode {
private let queue = Queue()
- init(context: AccountContextImpl) {
+ init(context: AccountContext) {
self.context = context
self.tapButton = HighlightTrackingButtonNode()
diff --git a/submodules/TelegramUI/TelegramUI/ChatRecentActionsController.swift b/submodules/TelegramUI/TelegramUI/ChatRecentActionsController.swift
index 1f3748bec1..005efebfd9 100644
--- a/submodules/TelegramUI/TelegramUI/ChatRecentActionsController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatRecentActionsController.swift
@@ -5,13 +5,15 @@ import TelegramCore
import Postbox
import SwiftSignalKit
import TelegramPresentationData
+import TelegramBaseController
+import AccountContext
-final class ChatRecentActionsController: TelegramController {
+final class ChatRecentActionsController: TelegramBaseController {
private var controllerNode: ChatRecentActionsControllerNode {
return self.displayNode as! ChatRecentActionsControllerNode
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private let peer: Peer
private var presentationData: PresentationData
private var presentationDataDisposable: Disposable?
@@ -21,7 +23,7 @@ final class ChatRecentActionsController: TelegramController {
private let titleView: ChatRecentActionsTitleView
- init(context: AccountContextImpl, peer: Peer) {
+ init(context: AccountContext, peer: Peer) {
self.context = context
self.peer = peer
diff --git a/submodules/TelegramUI/TelegramUI/ChatRecentActionsControllerNode.swift b/submodules/TelegramUI/TelegramUI/ChatRecentActionsControllerNode.swift
index beaa38c8d3..651448a985 100644
--- a/submodules/TelegramUI/TelegramUI/ChatRecentActionsControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatRecentActionsControllerNode.swift
@@ -8,6 +8,8 @@ import Display
import TelegramPresentationData
import TelegramUIPreferences
import SafariServices
+import AccountContext
+import TemporaryCachedPeerDataManager
private final class ChatRecentActionsListOpaqueState {
let entries: [ChatRecentActionsEntry]
@@ -20,7 +22,7 @@ private final class ChatRecentActionsListOpaqueState {
}
final class ChatRecentActionsControllerNode: ViewControllerTracingNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let peer: Peer
private var presentationData: PresentationData
@@ -71,7 +73,7 @@ final class ChatRecentActionsControllerNode: ViewControllerTracingNode {
private var adminsState: ChannelMemberListState?
private let banDisposables = DisposableDict()
- init(context: AccountContextImpl, peer: Peer, presentationData: PresentationData, interaction: ChatRecentActionsInteraction, pushController: @escaping (ViewController) -> Void, presentController: @escaping (ViewController, Any?) -> Void, getNavigationController: @escaping () -> NavigationController?) {
+ init(context: AccountContext, peer: Peer, presentationData: PresentationData, interaction: ChatRecentActionsInteraction, pushController: @escaping (ViewController) -> Void, presentController: @escaping (ViewController, Any?) -> Void, getNavigationController: @escaping () -> NavigationController?) {
self.context = context
self.peer = peer
self.presentationData = presentationData
@@ -144,7 +146,7 @@ final class ChatRecentActionsControllerNode: ViewControllerTracingNode {
break
}
}
- return openChatMessage(context: context, message: message, standalone: true, reverseMessageGalleryOrder: false, navigationController: navigationController, dismissInput: {
+ return context.sharedContext.openChatMessage(OpenChatMessageParams(context: context, message: message, standalone: true, reverseMessageGalleryOrder: false, navigationController: navigationController, dismissInput: {
//self?.chatDisplayNode.dismissInput()
}, present: { c, a in
self?.presentController(c, a)
@@ -171,7 +173,7 @@ final class ChatRecentActionsControllerNode: ViewControllerTracingNode {
}, callPeer: { peerId in
self?.controllerInteraction?.callPeer(peerId)
}, enqueueMessage: { _ in
- }, sendSticker: nil, setupTemporaryHiddenMedia: { _, _, _ in }, chatAvatarHiddenMedia: { _, _ in})
+ }, sendSticker: nil, setupTemporaryHiddenMedia: { _, _, _ in }, chatAvatarHiddenMedia: { _, _ in }))
}
return false
}, openPeer: { [weak self] peerId, _, message in
diff --git a/submodules/TelegramUI/TelegramUI/ChatRecentActionsFilterController.swift b/submodules/TelegramUI/TelegramUI/ChatRecentActionsFilterController.swift
index 0b6499df5f..fd48fcd01f 100644
--- a/submodules/TelegramUI/TelegramUI/ChatRecentActionsFilterController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatRecentActionsFilterController.swift
@@ -7,6 +7,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AccountContext
private final class ChatRecentActionsFilterControllerArguments {
let account: Account
@@ -360,7 +361,7 @@ private func channelRecentActionsFilterControllerEntries(presentationData: Prese
return entries
}
-public func channelRecentActionsFilterController(context: AccountContextImpl, peer: Peer, events: AdminLogEventsFlags, adminPeerIds: [PeerId]?, apply: @escaping (_ events: AdminLogEventsFlags, _ adminPeerIds: [PeerId]?) -> Void) -> ViewController {
+public func channelRecentActionsFilterController(context: AccountContext, peer: Peer, events: AdminLogEventsFlags, adminPeerIds: [PeerId]?, apply: @escaping (_ events: AdminLogEventsFlags, _ adminPeerIds: [PeerId]?) -> Void) -> ViewController {
let statePromise = ValuePromise(ChatRecentActionsFilterControllerState(events: events, adminPeerIds: adminPeerIds), ignoreRepeated: true)
let stateValue = Atomic(value: ChatRecentActionsFilterControllerState(events: events, adminPeerIds: adminPeerIds))
let updateState: ((ChatRecentActionsFilterControllerState) -> ChatRecentActionsFilterControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/ChatRecentActionsHistoryTransition.swift b/submodules/TelegramUI/TelegramUI/ChatRecentActionsHistoryTransition.swift
index b3eca557c5..a5cd298699 100644
--- a/submodules/TelegramUI/TelegramUI/ChatRecentActionsHistoryTransition.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatRecentActionsHistoryTransition.swift
@@ -5,6 +5,7 @@ import TelegramCore
import Postbox
import TelegramPresentationData
import MergeLists
+import AccountContext
enum ChatRecentActionsEntryContentIndex: Int32 {
case header = 0
@@ -104,7 +105,7 @@ struct ChatRecentActionsEntry: Comparable, Identifiable {
return self.id
}
- func item(context: AccountContextImpl, peer: Peer, controllerInteraction: ChatControllerInteraction) -> ListViewItem {
+ func item(context: AccountContext, peer: Peer, controllerInteraction: ChatControllerInteraction) -> ListViewItem {
switch self.entry.event.action {
case let .changeTitle(_, new):
var peers = SimpleDictionary()
@@ -1059,7 +1060,7 @@ struct ChatRecentActionsHistoryTransition {
let isEmpty: Bool
}
-func chatRecentActionsHistoryPreparedTransition(from fromEntries: [ChatRecentActionsEntry], to toEntries: [ChatRecentActionsEntry], type: ChannelAdminEventLogUpdateType, canLoadEarlier: Bool, displayingResults: Bool, context: AccountContextImpl, peer: Peer, controllerInteraction: ChatControllerInteraction) -> ChatRecentActionsHistoryTransition {
+func chatRecentActionsHistoryPreparedTransition(from fromEntries: [ChatRecentActionsEntry], to toEntries: [ChatRecentActionsEntry], type: ChannelAdminEventLogUpdateType, canLoadEarlier: Bool, displayingResults: Bool, context: AccountContext, peer: Peer, controllerInteraction: ChatControllerInteraction) -> ChatRecentActionsHistoryTransition {
let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries)
let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) }
diff --git a/submodules/TelegramUI/TelegramUI/ChatRestrictedInputPanelNode.swift b/submodules/TelegramUI/TelegramUI/ChatRestrictedInputPanelNode.swift
index 37c743d542..799682520b 100644
--- a/submodules/TelegramUI/TelegramUI/ChatRestrictedInputPanelNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatRestrictedInputPanelNode.swift
@@ -5,6 +5,7 @@ import Display
import TelegramCore
import Postbox
import SwiftSignalKit
+import TelegramStringFormatting
final class ChatRestrictedInputPanelNode: ChatInputPanelNode {
private let textNode: ImmediateTextNode
diff --git a/submodules/TelegramUI/TelegramUI/ChatSecretAutoremoveTimerActionSheet.swift b/submodules/TelegramUI/TelegramUI/ChatSecretAutoremoveTimerActionSheet.swift
index 9b386f7f79..6dd5289115 100644
--- a/submodules/TelegramUI/TelegramUI/ChatSecretAutoremoveTimerActionSheet.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatSecretAutoremoveTimerActionSheet.swift
@@ -7,6 +7,7 @@ import TelegramCore
import SwiftSignalKit
import Photos
import TelegramPresentationData
+import AccountContext
final class ChatSecretAutoremoveTimerActionSheetController: ActionSheetController {
private var presentationDisposable: Disposable?
@@ -16,7 +17,7 @@ final class ChatSecretAutoremoveTimerActionSheetController: ActionSheetControlle
return self._ready
}
- init(context: AccountContextImpl, currentValue: Int32, applyValue: @escaping (Int32) -> Void) {
+ init(context: AccountContext, currentValue: Int32, applyValue: @escaping (Int32) -> Void) {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let theme = presentationData.theme
let strings = presentationData.strings
diff --git a/submodules/TelegramUI/TelegramUI/ChatSendMessageActionSheetController.swift b/submodules/TelegramUI/TelegramUI/ChatSendMessageActionSheetController.swift
index 9c035db637..a34fa006fd 100644
--- a/submodules/TelegramUI/TelegramUI/ChatSendMessageActionSheetController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatSendMessageActionSheetController.swift
@@ -4,13 +4,14 @@ import Display
import AsyncDisplayKit
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
final class ChatSendMessageActionSheetController: ViewController {
var controllerNode: ChatSendMessageActionSheetControllerNode {
return self.displayNode as! ChatSendMessageActionSheetControllerNode
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private let controllerInteraction: ChatControllerInteraction?
private let interfaceState: ChatPresentationInterfaceState
private let sendButtonFrame: CGRect
@@ -25,7 +26,7 @@ final class ChatSendMessageActionSheetController: ViewController {
private let hapticFeedback = HapticFeedback()
- init(context: AccountContextImpl, controllerInteraction: ChatControllerInteraction?, interfaceState: ChatPresentationInterfaceState, sendButtonFrame: CGRect, textInputNode: EditableTextNode, completion: @escaping () -> Void) {
+ init(context: AccountContext, controllerInteraction: ChatControllerInteraction?, interfaceState: ChatPresentationInterfaceState, sendButtonFrame: CGRect, textInputNode: EditableTextNode, completion: @escaping () -> Void) {
self.context = context
self.controllerInteraction = controllerInteraction
self.interfaceState = interfaceState
diff --git a/submodules/TelegramUI/TelegramUI/ChatSendMessageActionSheetControllerNode.swift b/submodules/TelegramUI/TelegramUI/ChatSendMessageActionSheetControllerNode.swift
index 74877cbe4f..0a2be8b93e 100644
--- a/submodules/TelegramUI/TelegramUI/ChatSendMessageActionSheetControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatSendMessageActionSheetControllerNode.swift
@@ -6,6 +6,7 @@ import Display
import Postbox
import TelegramCore
import TelegramPresentationData
+import AccountContext
private let leftInset: CGFloat = 16.0
private let rightInset: CGFloat = 46.0
@@ -100,7 +101,7 @@ private final class ActionSheetItemNode: ASDisplayNode {
}
final class ChatSendMessageActionSheetControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var presentationData: PresentationData
private let sendButtonFrame: CGRect
private let textFieldFrame: CGRect
@@ -129,7 +130,7 @@ final class ChatSendMessageActionSheetControllerNode: ViewControllerTracingNode,
private var validLayout: ContainerViewLayout?
- init(context: AccountContextImpl, sendButtonFrame: CGRect, textInputNode: EditableTextNode, forwardedCount: Int?, send: (() -> Void)?, sendSilently: (() -> Void)?, cancel: (() -> Void)?) {
+ init(context: AccountContext, sendButtonFrame: CGRect, textInputNode: EditableTextNode, forwardedCount: Int?, send: (() -> Void)?, sendSilently: (() -> Void)?, cancel: (() -> Void)?) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
self.sendButtonFrame = sendButtonFrame
diff --git a/submodules/TelegramUI/TelegramUI/ChatTextFormat.swift b/submodules/TelegramUI/TelegramUI/ChatTextFormat.swift
index f832b5aedc..fef4a10caf 100644
--- a/submodules/TelegramUI/TelegramUI/ChatTextFormat.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatTextFormat.swift
@@ -1,5 +1,6 @@
import Foundation
import TextFormat
+import AccountContext
func chatTextInputAddFormattingAttribute(_ state: ChatTextInputState, attribute: NSAttributedString.Key) -> ChatTextInputState {
if !state.selectionRange.isEmpty {
diff --git a/submodules/TelegramUI/TelegramUI/ChatTextInputAudioRecordingTimeNode.swift b/submodules/TelegramUI/TelegramUI/ChatTextInputAudioRecordingTimeNode.swift
index 4af1545a4f..b3c17a2531 100644
--- a/submodules/TelegramUI/TelegramUI/ChatTextInputAudioRecordingTimeNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatTextInputAudioRecordingTimeNode.swift
@@ -4,6 +4,7 @@ import AsyncDisplayKit
import Display
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
private final class ChatTextInputAudioRecordingTimeNodeParameters: NSObject {
let timestamp: Double
diff --git a/submodules/TelegramUI/TelegramUI/ChatTextInputMediaRecordingButton.swift b/submodules/TelegramUI/TelegramUI/ChatTextInputMediaRecordingButton.swift
index 8feb54bcc1..c13c723532 100644
--- a/submodules/TelegramUI/TelegramUI/ChatTextInputMediaRecordingButton.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatTextInputMediaRecordingButton.swift
@@ -6,6 +6,7 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import LegacyComponents
+import AccountContext
private let offsetThreshold: CGFloat = 10.0
private let dismissOffsetThreshold: CGFloat = 70.0
diff --git a/submodules/TelegramUI/TelegramUI/ChatTextInputPanelNode.swift b/submodules/TelegramUI/TelegramUI/ChatTextInputPanelNode.swift
index d5bd5cd33a..f6c727c1c7 100644
--- a/submodules/TelegramUI/TelegramUI/ChatTextInputPanelNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatTextInputPanelNode.swift
@@ -7,6 +7,7 @@ import TelegramCore
import MobileCoreServices
import TelegramPresentationData
import TextFormat
+import AccountContext
private let searchLayoutProgressImage = generateImage(CGSize(width: 22.0, height: 22.0), contextGenerator: { size, context in
context.clear(CGRect(origin: CGPoint(), size: size))
@@ -261,7 +262,7 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
}
}
- override var context: AccountContextImpl? {
+ override var context: AccountContext? {
didSet {
self.actionButtons.micButton.account = self.context?.account
}
diff --git a/submodules/TelegramUI/TelegramUI/ChatTextInputPanelState.swift b/submodules/TelegramUI/TelegramUI/ChatTextInputPanelState.swift
index 8ea3b67761..d6712aae61 100644
--- a/submodules/TelegramUI/TelegramUI/ChatTextInputPanelState.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatTextInputPanelState.swift
@@ -1,4 +1,5 @@
import Foundation
+import AccountContext
struct ChatTextInputPanelState: Equatable {
let accessoryItems: [ChatTextInputAccessoryItem]
diff --git a/submodules/TelegramUI/TelegramUI/ChatTextLinkEditController.swift b/submodules/TelegramUI/TelegramUI/ChatTextLinkEditController.swift
index 3a48fe08e3..e33d462d61 100644
--- a/submodules/TelegramUI/TelegramUI/ChatTextLinkEditController.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatTextLinkEditController.swift
@@ -6,6 +6,7 @@ import Display
import Postbox
import TelegramCore
import TelegramPresentationData
+import AccountContext
private final class ChatTextLinkEditInputFieldNode: ASDisplayNode, ASEditableTextNodeDelegate {
private var theme: PresentationTheme
@@ -380,7 +381,7 @@ private final class ChatTextLinkEditAlertContentNode: AlertContentNode {
}
}
-func chatTextLinkEditController(sharedContext: SharedAccountContextImpl, account: Account, text: String, link: String?, apply: @escaping (String?) -> Void) -> AlertController {
+func chatTextLinkEditController(sharedContext: SharedAccountContext, account: Account, text: String, link: String?, apply: @escaping (String?) -> Void) -> AlertController {
let presentationData = sharedContext.currentPresentationData.with { $0 }
var dismissImpl: ((Bool) -> Void)?
diff --git a/submodules/TelegramUI/TelegramUI/ChatTitleView.swift b/submodules/TelegramUI/TelegramUI/ChatTitleView.swift
index 217286e4c9..839f2fc34a 100644
--- a/submodules/TelegramUI/TelegramUI/ChatTitleView.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatTitleView.swift
@@ -9,6 +9,7 @@ import LegacyComponents
import TelegramPresentationData
import TelegramUIPreferences
import ActivityIndicator
+import TelegramStringFormatting
enum ChatTitleContent {
case peer(peerView: PeerView, onlineMemberCount: Int32?)
diff --git a/submodules/TelegramUI/TelegramUI/ChatUnreadItem.swift b/submodules/TelegramUI/TelegramUI/ChatUnreadItem.swift
index e73f376609..4d78f52459 100644
--- a/submodules/TelegramUI/TelegramUI/ChatUnreadItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ChatUnreadItem.swift
@@ -5,6 +5,7 @@ import AsyncDisplayKit
import Display
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
private let titleFont = UIFont.systemFont(ofSize: 13.0)
@@ -13,7 +14,7 @@ class ChatUnreadItem: ListViewItem {
let presentationData: ChatPresentationData
let header: ChatMessageDateHeader
- init(index: MessageIndex, presentationData: ChatPresentationData, context: AccountContextImpl) {
+ init(index: MessageIndex, presentationData: ChatPresentationData, context: AccountContext) {
self.index = index
self.presentationData = presentationData
self.header = ChatMessageDateHeader(timestamp: index.timestamp, presentationData: presentationData, context: context)
diff --git a/submodules/TelegramUI/TelegramUI/CheckDiskSpace.swift b/submodules/TelegramUI/TelegramUI/CheckDiskSpace.swift
index 3be22a3d3f..7f5bd2f86e 100644
--- a/submodules/TelegramUI/TelegramUI/CheckDiskSpace.swift
+++ b/submodules/TelegramUI/TelegramUI/CheckDiskSpace.swift
@@ -1,6 +1,7 @@
import Foundation
import Display
import TelegramCore
+import AccountContext
func totalDiskSpace() -> Int64 {
do {
@@ -20,7 +21,7 @@ func freeDiskSpace() -> Int64 {
}
}
-func checkAvailableDiskSpace(context: AccountContextImpl, threshold: Int64 = 100 * 1024 * 1024, present: @escaping (ViewController, Any?) -> Void) -> Bool {
+func checkAvailableDiskSpace(context: AccountContext, threshold: Int64 = 100 * 1024 * 1024, present: @escaping (ViewController, Any?) -> Void) -> Bool {
guard freeDiskSpace() < threshold else {
return true
}
diff --git a/submodules/TelegramUI/TelegramUI/CommandChatInputContextPanelNode.swift b/submodules/TelegramUI/TelegramUI/CommandChatInputContextPanelNode.swift
index eae103c380..4af459c6ef 100644
--- a/submodules/TelegramUI/TelegramUI/CommandChatInputContextPanelNode.swift
+++ b/submodules/TelegramUI/TelegramUI/CommandChatInputContextPanelNode.swift
@@ -6,6 +6,7 @@ import TelegramCore
import Display
import TelegramPresentationData
import MergeLists
+import AccountContext
private struct CommandChatInputContextPanelEntryStableId: Hashable {
let command: PeerCommand
@@ -60,7 +61,7 @@ final class CommandChatInputContextPanelNode: ChatInputContextPanelNode {
private var enqueuedTransitions: [(CommandChatInputContextPanelTransition, Bool)] = []
private var validLayout: (CGSize, CGFloat, CGFloat)?
- override init(context: AccountContextImpl, theme: PresentationTheme, strings: PresentationStrings) {
+ override init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings) {
self.listView = ListView()
self.listView.isOpaque = false
self.listView.stackFromBottom = true
diff --git a/submodules/TelegramUI/TelegramUI/CommandChatInputPanelItem.swift b/submodules/TelegramUI/TelegramUI/CommandChatInputPanelItem.swift
index f66a30bcb4..c1350cc9bc 100644
--- a/submodules/TelegramUI/TelegramUI/CommandChatInputPanelItem.swift
+++ b/submodules/TelegramUI/TelegramUI/CommandChatInputPanelItem.swift
@@ -6,6 +6,7 @@ import TelegramCore
import SwiftSignalKit
import Postbox
import TelegramPresentationData
+import AvatarNode
final class CommandChatInputPanelItem: ListViewItem {
fileprivate let account: Account
diff --git a/submodules/TelegramUI/TelegramUI/ComposeController.swift b/submodules/TelegramUI/TelegramUI/ComposeController.swift
index 225bdf2a56..47a90275c7 100644
--- a/submodules/TelegramUI/TelegramUI/ComposeController.swift
+++ b/submodules/TelegramUI/TelegramUI/ComposeController.swift
@@ -6,9 +6,10 @@ import Postbox
import SwiftSignalKit
import TelegramCore
import TelegramPresentationData
+import AccountContext
public class ComposeController: ViewController {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var contactsNode: ComposeControllerNode {
return self.displayNode as! ComposeControllerNode
@@ -28,7 +29,7 @@ public class ComposeController: ViewController {
private var searchContentNode: NavigationBarSearchContentNode?
- public init(context: AccountContextImpl) {
+ public init(context: AccountContext) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/ComposeControllerNode.swift b/submodules/TelegramUI/TelegramUI/ComposeControllerNode.swift
index 5a4473cb37..3439974240 100644
--- a/submodules/TelegramUI/TelegramUI/ComposeControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ComposeControllerNode.swift
@@ -5,11 +5,12 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
final class ComposeControllerNode: ASDisplayNode {
let contactListNode: ContactListNode
- private let context: AccountContextImpl
+ private let context: AccountContext
private var searchDisplayController: SearchDisplayController?
private var containerLayout: (ContainerViewLayout, CGFloat)?
@@ -26,7 +27,7 @@ final class ComposeControllerNode: ASDisplayNode {
private var presentationData: PresentationData
private var presentationDataDisposable: Disposable?
- init(context: AccountContextImpl) {
+ init(context: AccountContext) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/ConfirmPhoneNumberController.swift b/submodules/TelegramUI/TelegramUI/ConfirmPhoneNumberController.swift
index 2344a048dd..f790c14291 100644
--- a/submodules/TelegramUI/TelegramUI/ConfirmPhoneNumberController.swift
+++ b/submodules/TelegramUI/TelegramUI/ConfirmPhoneNumberController.swift
@@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import AccountContext
private final class ConfirmPhoneNumberCodeControllerArguments {
let updateEntryText: (String) -> Void
@@ -157,7 +158,7 @@ protocol ConfirmPhoneNumberCodeController: class {
private final class ConfirmPhoneNumberCodeControllerImpl: ItemListController, ConfirmPhoneNumberCodeController {
private let applyCodeImpl: (Int) -> Void
- init(context: AccountContextImpl, state: Signal<(ItemListControllerState, (ItemListNodeState, ConfirmPhoneNumberCodeEntry.ItemGenerationArguments)), NoError>, applyCodeImpl: @escaping (Int) -> Void) {
+ init(context: AccountContext, state: Signal<(ItemListControllerState, (ItemListNodeState, ConfirmPhoneNumberCodeEntry.ItemGenerationArguments)), NoError>, applyCodeImpl: @escaping (Int) -> Void) {
self.applyCodeImpl = applyCodeImpl
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
@@ -173,7 +174,7 @@ private final class ConfirmPhoneNumberCodeControllerImpl: ItemListController ViewController {
+func confirmPhoneNumberCodeController(context: AccountContext, phoneNumber: String, codeData: CancelAccountResetData) -> ViewController {
let initialState = ConfirmPhoneNumberCodeControllerState(codeText: "", checking: false)
let statePromise = ValuePromise(initialState, ignoreRepeated: true)
diff --git a/submodules/TelegramUI/TelegramUI/ContactListNode.swift b/submodules/TelegramUI/TelegramUI/ContactListNode.swift
index e642a48c1e..c9b2b8b6f3 100644
--- a/submodules/TelegramUI/TelegramUI/ContactListNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ContactListNode.swift
@@ -766,7 +766,7 @@ enum ContactListFilter {
}
final class ContactListNode: ASDisplayNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var presentation: ContactListPresentation?
private let filters: [ContactListFilter]
@@ -833,7 +833,7 @@ final class ContactListNode: ASDisplayNode {
private var authorizationNode: PermissionContentNode
private let displayPermissionPlaceholder: Bool
- init(context: AccountContextImpl, presentation: Signal, filters: [ContactListFilter] = [.excludeSelf], selectionState: ContactListNodeGroupSelectionState? = nil, displayPermissionPlaceholder: Bool = true, displaySortOptions: Bool = false) {
+ init(context: AccountContext, presentation: Signal, filters: [ContactListFilter] = [.excludeSelf], selectionState: ContactListNodeGroupSelectionState? = nil, displayPermissionPlaceholder: Bool = true, displaySortOptions: Bool = false) {
self.context = context
self.filters = filters
self.displayPermissionPlaceholder = displayPermissionPlaceholder
diff --git a/submodules/TelegramUI/TelegramUI/ContactMultiselectionController.swift b/submodules/TelegramUI/TelegramUI/ContactMultiselectionController.swift
index e375f6478c..f767f47ced 100644
--- a/submodules/TelegramUI/TelegramUI/ContactMultiselectionController.swift
+++ b/submodules/TelegramUI/TelegramUI/ContactMultiselectionController.swift
@@ -7,6 +7,7 @@ import SwiftSignalKit
import TelegramCore
import TelegramPresentationData
import ProgressNavigationButtonNode
+import AccountContext
enum ContactMultiselectionControllerMode {
case groupCreation
@@ -15,7 +16,7 @@ enum ContactMultiselectionControllerMode {
}
class ContactMultiselectionController: ViewController {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let mode: ContactMultiselectionControllerMode
private let titleView: CounterContollerTitleView
@@ -65,7 +66,7 @@ class ContactMultiselectionController: ViewController {
private let options: [ContactListAdditionalOption]
private let filters: [ContactListFilter]
- init(context: AccountContextImpl, mode: ContactMultiselectionControllerMode, options: [ContactListAdditionalOption], filters: [ContactListFilter] = [.excludeSelf]) {
+ init(context: AccountContext, mode: ContactMultiselectionControllerMode, options: [ContactListAdditionalOption], filters: [ContactListFilter] = [.excludeSelf]) {
self.context = context
self.mode = mode
self.options = options
diff --git a/submodules/TelegramUI/TelegramUI/ContactMultiselectionControllerNode.swift b/submodules/TelegramUI/TelegramUI/ContactMultiselectionControllerNode.swift
index f142a9c164..3cc6d08353 100644
--- a/submodules/TelegramUI/TelegramUI/ContactMultiselectionControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ContactMultiselectionControllerNode.swift
@@ -6,6 +6,7 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import MergeLists
+import AccountContext
private struct SearchResultEntry: Identifiable {
let index: Int
@@ -29,7 +30,7 @@ final class ContactMultiselectionControllerNode: ASDisplayNode {
let tokenListNode: EditableTokenListNode
var searchResultsNode: ContactListNode?
- private let context: AccountContextImpl
+ private let context: AccountContext
private var containerLayout: (ContainerViewLayout, CGFloat, CGFloat)?
@@ -46,7 +47,7 @@ final class ContactMultiselectionControllerNode: ASDisplayNode {
private var presentationData: PresentationData
private var presentationDataDisposable: Disposable?
- init(context: AccountContextImpl, mode: ContactMultiselectionControllerMode, options: [ContactListAdditionalOption], filters: [ContactListFilter]) {
+ init(context: AccountContext, mode: ContactMultiselectionControllerMode, options: [ContactListAdditionalOption], filters: [ContactListFilter]) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/ContactSelectionController.swift b/submodules/TelegramUI/TelegramUI/ContactSelectionController.swift
index 9997e097c8..be63a182ea 100644
--- a/submodules/TelegramUI/TelegramUI/ContactSelectionController.swift
+++ b/submodules/TelegramUI/TelegramUI/ContactSelectionController.swift
@@ -7,9 +7,10 @@ import SwiftSignalKit
import TelegramCore
import TelegramPresentationData
import ProgressNavigationButtonNode
+import AccountContext
class ContactSelectionController: ViewController, PresentableController {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let autoDismiss: Bool
private var contactsNode: ContactSelectionControllerNode {
@@ -64,7 +65,7 @@ class ContactSelectionController: ViewController, PresentableController {
}
}
- init(context: AccountContextImpl, autoDismiss: Bool = true, title: @escaping (PresentationStrings) -> String, options: [ContactListAdditionalOption] = [], displayDeviceContacts: Bool = false, confirmation: @escaping (ContactListPeer) -> Signal = { _ in .single(true) }) {
+ init(context: AccountContext, autoDismiss: Bool = true, title: @escaping (PresentationStrings) -> String, options: [ContactListAdditionalOption] = [], displayDeviceContacts: Bool = false, confirmation: @escaping (ContactListPeer) -> Signal = { _ in .single(true) }) {
self.context = context
self.autoDismiss = autoDismiss
self.titleProducer = title
diff --git a/submodules/TelegramUI/TelegramUI/ContactSelectionControllerNode.swift b/submodules/TelegramUI/TelegramUI/ContactSelectionControllerNode.swift
index 3e02fd1f02..08a17a1356 100644
--- a/submodules/TelegramUI/TelegramUI/ContactSelectionControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ContactSelectionControllerNode.swift
@@ -5,6 +5,7 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
final class ContactSelectionControllerNode: ASDisplayNode {
var displayProgress: Bool = false {
@@ -21,7 +22,7 @@ final class ContactSelectionControllerNode: ASDisplayNode {
let contactListNode: ContactListNode
private let dimNode: ASDisplayNode
- private let context: AccountContextImpl
+ private let context: AccountContext
private var searchDisplayController: SearchDisplayController?
private var containerLayout: (ContainerViewLayout, CGFloat)?
@@ -35,7 +36,7 @@ final class ContactSelectionControllerNode: ASDisplayNode {
var presentationData: PresentationData
var presentationDataDisposable: Disposable?
- init(context: AccountContextImpl, options: [ContactListAdditionalOption], displayDeviceContacts: Bool) {
+ init(context: AccountContext, options: [ContactListAdditionalOption], displayDeviceContacts: Bool) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
self.displayDeviceContacts = displayDeviceContacts
diff --git a/submodules/TelegramUI/TelegramUI/ContactsController.swift b/submodules/TelegramUI/TelegramUI/ContactsController.swift
index b642a2e916..30665e8680 100644
--- a/submodules/TelegramUI/TelegramUI/ContactsController.swift
+++ b/submodules/TelegramUI/TelegramUI/ContactsController.swift
@@ -8,6 +8,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import DeviceAccess
+import AccountContext
private func fixListNodeScrolling(_ listNode: ListView, searchNode: NavigationBarSearchContentNode) -> Bool {
if searchNode.expansionProgress > 0.0 && searchNode.expansionProgress < 1.0 {
@@ -54,7 +55,7 @@ private func fixListNodeScrolling(_ listNode: ListView, searchNode: NavigationBa
}
public class ContactsController: ViewController {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var contactsNode: ContactsControllerNode {
return self.displayNode as! ContactsControllerNode
@@ -83,7 +84,7 @@ public class ContactsController: ViewController {
}
}
- public init(context: AccountContextImpl) {
+ public init(context: AccountContext) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/ContactsControllerNode.swift b/submodules/TelegramUI/TelegramUI/ContactsControllerNode.swift
index 44006d914f..bb1a44cf79 100644
--- a/submodules/TelegramUI/TelegramUI/ContactsControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ContactsControllerNode.swift
@@ -8,6 +8,7 @@ import SwiftSignalKit
import TelegramPresentationData
import TelegramUIPreferences
import DeviceAccess
+import AccountContext
private final class ContactsControllerNodeView: UITracingLayerView, PreviewingHostView {
var previewingDelegate: PreviewingHostViewDelegate? {
@@ -24,7 +25,7 @@ private final class ContactsControllerNodeView: UITracingLayerView, PreviewingHo
final class ContactsControllerNode: ASDisplayNode {
let contactListNode: ContactListNode
- private let context: AccountContextImpl
+ private let context: AccountContext
private(set) var searchDisplayController: SearchDisplayController?
private var containerLayout: (ContainerViewLayout, CGFloat)?
@@ -41,7 +42,7 @@ final class ContactsControllerNode: ASDisplayNode {
weak var controller: ContactsController?
- init(context: AccountContextImpl, sortOrder: Signal, present: @escaping (ViewController, Any?) -> Void, controller: ContactsController) {
+ init(context: AccountContext, sortOrder: Signal, present: @escaping (ViewController, Any?) -> Void, controller: ContactsController) {
self.context = context
self.controller = controller
diff --git a/submodules/TelegramUI/TelegramUI/ContactsPeerItem.swift b/submodules/TelegramUI/TelegramUI/ContactsPeerItem.swift
index 2935e9f173..f59d089d54 100644
--- a/submodules/TelegramUI/TelegramUI/ContactsPeerItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ContactsPeerItem.swift
@@ -9,6 +9,9 @@ import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import CheckNode
+import AvatarNode
+import TelegramStringFormatting
+import AccountContext
private let titleFont = Font.regular(17.0)
private let titleBoldFont = Font.medium(17.0)
diff --git a/submodules/TelegramUI/TelegramUI/ContactsSearchContainerNode.swift b/submodules/TelegramUI/TelegramUI/ContactsSearchContainerNode.swift
index ba54a53c16..c0f3089817 100644
--- a/submodules/TelegramUI/TelegramUI/ContactsSearchContainerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ContactsSearchContainerNode.swift
@@ -8,6 +8,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import MergeLists
+import AccountContext
private enum ContactListSearchGroup {
case contacts
@@ -127,7 +128,7 @@ struct ContactsSearchCategories: OptionSet {
}
final class ContactsSearchContainerNode: SearchDisplayControllerContentNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let openPeer: (ContactListPeer) -> Void
private let dimNode: ASDisplayNode
@@ -142,7 +143,7 @@ final class ContactsSearchContainerNode: SearchDisplayControllerContentNode {
private var containerViewLayout: (ContainerViewLayout, CGFloat)?
private var enqueuedTransitions: [ContactListSearchContainerTransition] = []
- init(context: AccountContextImpl, onlyWriteable: Bool, categories: ContactsSearchCategories, filters: [ContactListFilter] = [.excludeSelf], openPeer: @escaping (ContactListPeer) -> Void) {
+ init(context: AccountContext, onlyWriteable: Bool, categories: ContactsSearchCategories, filters: [ContactListFilter] = [.excludeSelf], openPeer: @escaping (ContactListPeer) -> Void) {
self.context = context
self.openPeer = openPeer
diff --git a/submodules/TelegramUI/TelegramUI/ConvertToSupergroupController.swift b/submodules/TelegramUI/TelegramUI/ConvertToSupergroupController.swift
index 498beb2401..15b6941b46 100644
--- a/submodules/TelegramUI/TelegramUI/ConvertToSupergroupController.swift
+++ b/submodules/TelegramUI/TelegramUI/ConvertToSupergroupController.swift
@@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import AccountContext
private final class ConvertToSupergroupArguments {
let convert: () -> Void
@@ -115,7 +116,7 @@ private func convertToSupergroupEntries(presentationData: PresentationData) -> [
return entries
}
-public func convertToSupergroupController(context: AccountContextImpl, peerId: PeerId) -> ViewController {
+public func convertToSupergroupController(context: AccountContext, peerId: PeerId) -> ViewController {
var replaceControllerImpl: ((ViewController) -> Void)?
var presentControllerImpl: ((ViewController, Any?) -> Void)?
diff --git a/submodules/TelegramUI/TelegramUI/CreateChannelController.swift b/submodules/TelegramUI/TelegramUI/CreateChannelController.swift
index b9d30c7d19..d087bbbe5e 100644
--- a/submodules/TelegramUI/TelegramUI/CreateChannelController.swift
+++ b/submodules/TelegramUI/TelegramUI/CreateChannelController.swift
@@ -7,6 +7,7 @@ import TelegramCore
import TelegramPresentationData
import LegacyComponents
import ItemListUI
+import AccountContext
private struct CreateChannelArguments {
let account: Account
@@ -187,7 +188,7 @@ private func CreateChannelEntries(presentationData: PresentationData, state: Cre
return entries
}
-public func createChannelController(context: AccountContextImpl) -> ViewController {
+public func createChannelController(context: AccountContext) -> ViewController {
let initialState = CreateChannelState(creating: false, editingName: ItemListAvatarAndNameInfoItemName.title(title: "", type: .channel), editingDescriptionText: "", avatar: nil)
let statePromise = ValuePromise(initialState, ignoreRepeated: true)
let stateValue = Atomic(value: initialState)
diff --git a/submodules/TelegramUI/TelegramUI/CreateGroupController.swift b/submodules/TelegramUI/TelegramUI/CreateGroupController.swift
index 04db31d318..7a9fcb2a7a 100644
--- a/submodules/TelegramUI/TelegramUI/CreateGroupController.swift
+++ b/submodules/TelegramUI/TelegramUI/CreateGroupController.swift
@@ -8,6 +8,7 @@ import TelegramPresentationData
import TelegramUIPreferences
import LegacyComponents
import ItemListUI
+import AccountContext
public enum CreateGroupMode {
case generic
@@ -288,7 +289,7 @@ private func createGroupEntries(presentationData: PresentationData, state: Creat
return entries
}
-public func createGroupController(context: AccountContextImpl, peerIds: [PeerId], initialTitle: String? = nil, mode: CreateGroupMode = .generic, completion: ((PeerId, @escaping () -> Void) -> Void)? = nil) -> ViewController {
+public func createGroupController(context: AccountContext, peerIds: [PeerId], initialTitle: String? = nil, mode: CreateGroupMode = .generic, completion: ((PeerId, @escaping () -> Void) -> Void)? = nil) -> ViewController {
var location: PeerGeoLocation?
if case let .locatedGroup(latitude, longitude, address) = mode {
location = PeerGeoLocation(latitude: latitude, longitude: longitude, address: address ?? "")
diff --git a/submodules/TelegramUI/TelegramUI/CreatePasswordController.swift b/submodules/TelegramUI/TelegramUI/CreatePasswordController.swift
index 02422b5344..7cbb9ad385 100644
--- a/submodules/TelegramUI/TelegramUI/CreatePasswordController.swift
+++ b/submodules/TelegramUI/TelegramUI/CreatePasswordController.swift
@@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import AccountContext
private enum CreatePasswordField {
case password
@@ -221,7 +222,7 @@ enum CreatePasswordState: Equatable {
case pendingVerification(emailPattern: String)
}
-func createPasswordController(context: AccountContextImpl, createPasswordContext: CreatePasswordContext, state: CreatePasswordState, completion: @escaping (String, String, Bool) -> Void, updatePasswordEmailConfirmation: @escaping ((String, String)?) -> Void, processPasswordEmailConfirmation: Bool = true) -> ViewController {
+func createPasswordController(context: AccountContext, createPasswordContext: CreatePasswordContext, state: CreatePasswordState, completion: @escaping (String, String, Bool) -> Void, updatePasswordEmailConfirmation: @escaping ((String, String)?) -> Void, processPasswordEmailConfirmation: Bool = true) -> ViewController {
let statePromise = ValuePromise(CreatePasswordControllerState(state: state), ignoreRepeated: true)
let stateValue = Atomic(value: CreatePasswordControllerState(state: state))
let updateState: ((CreatePasswordControllerState) -> CreatePasswordControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/CreatePollController.swift b/submodules/TelegramUI/TelegramUI/CreatePollController.swift
index cdc64c9034..b98d3ba148 100644
--- a/submodules/TelegramUI/TelegramUI/CreatePollController.swift
+++ b/submodules/TelegramUI/TelegramUI/CreatePollController.swift
@@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import AccountContext
private let maxTextLength = 255
private let maxOptionLength = 100
@@ -195,7 +196,7 @@ private func createPollControllerEntries(presentationData: PresentationData, sta
return entries
}
-public func createPollController(context: AccountContextImpl, peerId: PeerId, completion: @escaping (EnqueueMessage) -> Void) -> ViewController {
+public func createPollController(context: AccountContext, peerId: PeerId, completion: @escaping (EnqueueMessage) -> Void) -> ViewController {
let statePromise = ValuePromise(CreatePollControllerState(), ignoreRepeated: true)
let stateValue = Atomic(value: CreatePollControllerState())
let updateState: ((CreatePollControllerState) -> CreatePollControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/CustomWallpaperPicker.swift b/submodules/TelegramUI/TelegramUI/CustomWallpaperPicker.swift
index eeda8c94d5..b6c9fe9ca1 100644
--- a/submodules/TelegramUI/TelegramUI/CustomWallpaperPicker.swift
+++ b/submodules/TelegramUI/TelegramUI/CustomWallpaperPicker.swift
@@ -7,8 +7,9 @@ import TelegramCore
import LegacyComponents
import TelegramUIPreferences
import MediaResources
+import AccountContext
-func presentCustomWallpaperPicker(context: AccountContextImpl, present: @escaping (ViewController) -> Void) {
+func presentCustomWallpaperPicker(context: AccountContext, present: @escaping (ViewController) -> Void) {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let _ = legacyWallpaperPicker(context: context, presentationData: presentationData).start(next: { generator in
let legacyController = LegacyController(presentation: .modal(animateIn: true), theme: presentationData.theme)
@@ -42,7 +43,7 @@ func presentCustomWallpaperPicker(context: AccountContextImpl, present: @escapin
})
}
-func uploadCustomWallpaper(context: AccountContextImpl, wallpaper: WallpaperGalleryEntry, mode: WallpaperPresentationOptions, cropRect: CGRect?, completion: @escaping () -> Void) {
+func uploadCustomWallpaper(context: AccountContext, wallpaper: WallpaperGalleryEntry, mode: WallpaperPresentationOptions, cropRect: CGRect?, completion: @escaping () -> Void) {
let imageSignal: Signal
switch wallpaper {
case let .wallpaper(wallpaper, _):
diff --git a/submodules/TelegramUI/TelegramUI/DataAndStorageSettingsController.swift b/submodules/TelegramUI/TelegramUI/DataAndStorageSettingsController.swift
index 3b83bb0b67..24cd66d65d 100644
--- a/submodules/TelegramUI/TelegramUI/DataAndStorageSettingsController.swift
+++ b/submodules/TelegramUI/TelegramUI/DataAndStorageSettingsController.swift
@@ -8,6 +8,7 @@ import LegacyComponents
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AccountContext
private final class DataAndStorageControllerArguments {
let openStorageUsage: () -> Void
@@ -455,7 +456,7 @@ private func dataAndStorageControllerEntries(state: DataAndStorageControllerStat
return entries
}
-func dataAndStorageController(context: AccountContextImpl, focusOnItemTag: DataAndStorageEntryTag? = nil) -> ViewController {
+func dataAndStorageController(context: AccountContext, focusOnItemTag: DataAndStorageEntryTag? = nil) -> ViewController {
let initialState = DataAndStorageControllerState()
let statePromise = ValuePromise(initialState, ignoreRepeated: true)
diff --git a/submodules/TelegramUI/TelegramUI/DataPrivacySettingsController.swift b/submodules/TelegramUI/TelegramUI/DataPrivacySettingsController.swift
index bce29af8f5..dea90aca28 100644
--- a/submodules/TelegramUI/TelegramUI/DataPrivacySettingsController.swift
+++ b/submodules/TelegramUI/TelegramUI/DataPrivacySettingsController.swift
@@ -7,6 +7,8 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import OverlayStatusController
+import AccountContext
private final class DataPrivacyControllerArguments {
let account: Account
@@ -279,7 +281,7 @@ private func dataPrivacyControllerEntries(presentationData: PresentationData, st
return entries
}
-public func dataPrivacyController(context: AccountContextImpl) -> ViewController {
+public func dataPrivacyController(context: AccountContext) -> ViewController {
let statePromise = ValuePromise(DataPrivacyControllerState(), ignoreRepeated: true)
let stateValue = Atomic(value: DataPrivacyControllerState())
let updateState: ((DataPrivacyControllerState) -> DataPrivacyControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/DateFormat.swift b/submodules/TelegramUI/TelegramUI/DateFormat.swift
deleted file mode 100644
index f7ace2b5de..0000000000
--- a/submodules/TelegramUI/TelegramUI/DateFormat.swift
+++ /dev/null
@@ -1,111 +0,0 @@
-import Foundation
-import TelegramPresentationData
-import TelegramUIPreferences
-
-func stringForShortTimestamp(hours: Int32, minutes: Int32, dateTimeFormat: PresentationDateTimeFormat) -> String {
- switch dateTimeFormat.timeFormat {
- case .regular:
- let hourString: String
- if hours == 0 {
- hourString = "12"
- } else if hours > 12 {
- hourString = "\(hours - 12)"
- } else {
- hourString = "\(hours)"
- }
-
- let periodString: String
- if hours >= 12 {
- periodString = "PM"
- } else {
- periodString = "AM"
- }
- if minutes >= 10 {
- return "\(hourString):\(minutes) \(periodString)"
- } else {
- return "\(hourString):0\(minutes) \(periodString)"
- }
- case .military:
- return String(format: "%02d:%02d", arguments: [Int(hours), Int(minutes)])
- }
-}
-
-func stringForMessageTimestamp(timestamp: Int32, dateTimeFormat: PresentationDateTimeFormat, local: Bool = true) -> String {
- var t = Int(timestamp)
- var timeinfo = tm()
- if local {
- localtime_r(&t, &timeinfo)
- } else {
- gmtime_r(&t, &timeinfo)
- }
-
- return stringForShortTimestamp(hours: timeinfo.tm_hour, minutes: timeinfo.tm_min, dateTimeFormat: dateTimeFormat)
-}
-
-func stringForFullDate(timestamp: Int32, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat) -> String {
- var t: time_t = Int(timestamp)
- var timeinfo = tm()
- localtime_r(&t, &timeinfo);
-
- switch timeinfo.tm_mon + 1 {
- case 1:
- return strings.Time_PreciseDate_m1("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
- case 2:
- return strings.Time_PreciseDate_m2("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
- case 3:
- return strings.Time_PreciseDate_m3("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
- case 4:
- return strings.Time_PreciseDate_m4("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
- case 5:
- return strings.Time_PreciseDate_m5("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
- case 6:
- return strings.Time_PreciseDate_m6("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
- case 7:
- return strings.Time_PreciseDate_m7("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
- case 8:
- return strings.Time_PreciseDate_m8("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
- case 9:
- return strings.Time_PreciseDate_m9("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
- case 10:
- return strings.Time_PreciseDate_m10("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
- case 11:
- return strings.Time_PreciseDate_m11("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
- case 12:
- return strings.Time_PreciseDate_m12("\(timeinfo.tm_mday)", "\(2000 + timeinfo.tm_year - 100)", stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)).0
- default:
- return ""
- }
-}
-
-func stringForDate(timestamp: Int32, strings: PresentationStrings) -> String {
- let formatter = DateFormatter()
- formatter.timeStyle = .none
- formatter.dateStyle = .medium
- formatter.timeZone = TimeZone(secondsFromGMT: 0)
- formatter.locale = localeWithStrings(strings)
- return formatter.string(from: Date(timeIntervalSince1970: Double(timestamp)))
-}
-
-func stringForDateWithoutYear(date: Date, strings: PresentationStrings) -> String {
- let formatter = DateFormatter()
- formatter.timeStyle = .none
- formatter.timeZone = TimeZone(secondsFromGMT: 0)
- formatter.locale = localeWithStrings(strings)
- formatter.setLocalizedDateFormatFromTemplate("MMMMd")
- return formatter.string(from: date)
-}
-
-func roundDateToDays(_ timestamp: Int32) -> Int32 {
- var calendar = Calendar(identifier: .gregorian)
- calendar.timeZone = TimeZone(secondsFromGMT: 0)!
- var components = calendar.dateComponents(Set([.era, .year, .month, .day]), from: Date(timeIntervalSince1970: Double(timestamp)))
- components.hour = 0
- components.minute = 0
- components.second = 0
-
- guard let date = calendar.date(from: components) else {
- assertionFailure()
- return timestamp
- }
- return Int32(date.timeIntervalSince1970)
-}
diff --git a/submodules/TelegramUI/TelegramUI/DateSelectionActionSheetController.swift b/submodules/TelegramUI/TelegramUI/DateSelectionActionSheetController.swift
index 5315435abb..2fe02a1825 100644
--- a/submodules/TelegramUI/TelegramUI/DateSelectionActionSheetController.swift
+++ b/submodules/TelegramUI/TelegramUI/DateSelectionActionSheetController.swift
@@ -7,6 +7,8 @@ import SwiftSignalKit
import TelegramCore
import Photos
import TelegramPresentationData
+import TelegramStringFormatting
+import AccountContext
final class DateSelectionActionSheetController: ActionSheetController {
private var presentationDisposable: Disposable?
@@ -16,7 +18,7 @@ final class DateSelectionActionSheetController: ActionSheetController {
return self._ready
}
- init(context: AccountContextImpl, title: String?, currentValue: Int32, minimumDate: Date? = nil, maximumDate: Date? = nil, emptyTitle: String? = nil, applyValue: @escaping (Int32?) -> Void) {
+ init(context: AccountContext, title: String?, currentValue: Int32, minimumDate: Date? = nil, maximumDate: Date? = nil, emptyTitle: String? = nil, applyValue: @escaping (Int32?) -> Void) {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let theme = presentationData.theme
let strings = presentationData.strings
diff --git a/submodules/TelegramUI/TelegramUI/DebugAccountsController.swift b/submodules/TelegramUI/TelegramUI/DebugAccountsController.swift
index 3ed886ce2f..511c5405c5 100644
--- a/submodules/TelegramUI/TelegramUI/DebugAccountsController.swift
+++ b/submodules/TelegramUI/TelegramUI/DebugAccountsController.swift
@@ -6,15 +6,16 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import AccountContext
private final class DebugAccountsControllerArguments {
- let context: AccountContextImpl
+ let context: AccountContext
let presentController: (ViewController, ViewControllerPresentationArguments) -> Void
let switchAccount: (AccountRecordId) -> Void
let loginNewAccount: () -> Void
- init(context: AccountContextImpl, presentController: @escaping (ViewController, ViewControllerPresentationArguments) -> Void, switchAccount: @escaping (AccountRecordId) -> Void, loginNewAccount: @escaping () -> Void) {
+ init(context: AccountContext, presentController: @escaping (ViewController, ViewControllerPresentationArguments) -> Void, switchAccount: @escaping (AccountRecordId) -> Void, loginNewAccount: @escaping () -> Void) {
self.context = context
self.presentController = presentController
self.switchAccount = switchAccount
@@ -98,7 +99,7 @@ private func debugAccountsControllerEntries(view: AccountRecordsView, presentati
return entries
}
-public func debugAccountsController(context: AccountContextImpl, accountManager: AccountManager) -> ViewController {
+public func debugAccountsController(context: AccountContext, accountManager: AccountManager) -> ViewController {
var presentControllerImpl: ((ViewController, ViewControllerPresentationArguments?) -> Void)?
let arguments = DebugAccountsControllerArguments(context: context, presentController: { controller, arguments in
diff --git a/submodules/TelegramUI/TelegramUI/DebugController.swift b/submodules/TelegramUI/TelegramUI/DebugController.swift
index af6b45a7f1..125465f295 100644
--- a/submodules/TelegramUI/TelegramUI/DebugController.swift
+++ b/submodules/TelegramUI/TelegramUI/DebugController.swift
@@ -13,15 +13,17 @@ import MessageUI
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import OverlayStatusController
+import AccountContext
private final class DebugControllerArguments {
- let sharedContext: SharedAccountContextImpl
- let context: AccountContextImpl?
+ let sharedContext: SharedAccountContext
+ let context: AccountContext?
let presentController: (ViewController, ViewControllerPresentationArguments?) -> Void
let pushController: (ViewController) -> Void
let getRootController: () -> UIViewController?
- init(sharedContext: SharedAccountContextImpl, context: AccountContextImpl?, presentController: @escaping (ViewController, ViewControllerPresentationArguments?) -> Void, pushController: @escaping (ViewController) -> Void, getRootController: @escaping () -> UIViewController?) {
+ init(sharedContext: SharedAccountContext, context: AccountContext?, presentController: @escaping (ViewController, ViewControllerPresentationArguments?) -> Void, pushController: @escaping (ViewController) -> Void, getRootController: @escaping () -> UIViewController?) {
self.sharedContext = sharedContext
self.context = context
self.presentController = presentController
@@ -557,7 +559,7 @@ private func debugControllerEntries(presentationData: PresentationData, loggingS
return entries
}
-public func debugController(sharedContext: SharedAccountContextImpl, context: AccountContextImpl?, modal: Bool = false) -> ViewController {
+public func debugController(sharedContext: SharedAccountContext, context: AccountContext?, modal: Bool = false) -> ViewController {
var presentControllerImpl: ((ViewController, ViewControllerPresentationArguments?) -> Void)?
var pushControllerImpl: ((ViewController) -> Void)?
var dismissImpl: (() -> Void)?
diff --git a/submodules/TelegramUI/TelegramUI/DeclareEncodables.swift b/submodules/TelegramUI/TelegramUI/DeclareEncodables.swift
index ce51ccde4d..16b1fd51fe 100644
--- a/submodules/TelegramUI/TelegramUI/DeclareEncodables.swift
+++ b/submodules/TelegramUI/TelegramUI/DeclareEncodables.swift
@@ -1,5 +1,5 @@
import Postbox
-
+import TemporaryCachedPeerDataManager
import TelegramUIPreferences
private var telegramUIDeclaredEncodables: Void = {
diff --git a/submodules/TelegramUI/TelegramUI/DeleteChatPeerActionSheetItem.swift b/submodules/TelegramUI/TelegramUI/DeleteChatPeerActionSheetItem.swift
index 0bfca45d17..41fea3f083 100644
--- a/submodules/TelegramUI/TelegramUI/DeleteChatPeerActionSheetItem.swift
+++ b/submodules/TelegramUI/TelegramUI/DeleteChatPeerActionSheetItem.swift
@@ -4,6 +4,8 @@ import Display
import Postbox
import TelegramCore
import TelegramPresentationData
+import AvatarNode
+import AccountContext
enum DeleteChatPeerAction {
case delete
@@ -11,13 +13,13 @@ enum DeleteChatPeerAction {
}
final class DeleteChatPeerActionSheetItem: ActionSheetItem {
- let context: AccountContextImpl
+ let context: AccountContext
let peer: Peer
let chatPeer: Peer
let action: DeleteChatPeerAction
let strings: PresentationStrings
- init(context: AccountContextImpl, peer: Peer, chatPeer: Peer, action: DeleteChatPeerAction, strings: PresentationStrings) {
+ init(context: AccountContext, peer: Peer, chatPeer: Peer, action: DeleteChatPeerAction, strings: PresentationStrings) {
self.context = context
self.peer = peer
self.chatPeer = chatPeer
@@ -44,7 +46,7 @@ private final class DeleteChatPeerActionSheetItemNode: ActionSheetItemNode {
private let accessibilityArea: AccessibilityAreaNode
- init(theme: ActionSheetControllerTheme, strings: PresentationStrings, context: AccountContextImpl, peer: Peer, chatPeer: Peer, action: DeleteChatPeerAction) {
+ init(theme: ActionSheetControllerTheme, strings: PresentationStrings, context: AccountContext, peer: Peer, chatPeer: Peer, action: DeleteChatPeerAction) {
self.theme = theme
self.strings = strings
diff --git a/submodules/TelegramUI/TelegramUI/DeviceContactDataManager.swift b/submodules/TelegramUI/TelegramUI/DeviceContactDataManager.swift
index 5aea10f670..0b00278e21 100644
--- a/submodules/TelegramUI/TelegramUI/DeviceContactDataManager.swift
+++ b/submodules/TelegramUI/TelegramUI/DeviceContactDataManager.swift
@@ -6,8 +6,7 @@ import Contacts
import AddressBook
import TelegramUIPreferences
import DeviceAccess
-
-public typealias DeviceContactStableId = String
+import AccountContext
private protocol DeviceContactDataContext {
func personNameDisplayOrder() -> PresentationPersonNameOrder
@@ -473,7 +472,7 @@ private final class BasicDataForNormalizedNumberContext {
}
}
-private final class DeviceContactDataManagerImpl {
+private final class DeviceContactDataManagerPrivateImpl {
private let queue: Queue
private var accessInitialized = false
@@ -760,14 +759,14 @@ private final class DeviceContactDataManagerImpl {
}
}
-public final class DeviceContactDataManager {
+public final class DeviceContactDataManagerImpl: DeviceContactDataManager {
private let queue = Queue()
- private let impl: QueueLocalObject
+ private let impl: QueueLocalObject
init() {
let queue = self.queue
self.impl = QueueLocalObject(queue: queue, generate: {
- return DeviceContactDataManagerImpl(queue: queue)
+ return DeviceContactDataManagerPrivateImpl(queue: queue)
})
}
@@ -856,7 +855,7 @@ public final class DeviceContactDataManager {
}
}
- func appendContactData(_ contactData: DeviceContactExtendedData, to stableId: DeviceContactStableId) -> Signal {
+ public func appendContactData(_ contactData: DeviceContactExtendedData, to stableId: DeviceContactStableId) -> Signal {
return Signal { subscriber in
let disposable = MetaDisposable()
self.impl.with({ impl in
@@ -869,7 +868,7 @@ public final class DeviceContactDataManager {
}
}
- func appendPhoneNumber(_ phoneNumber: DeviceContactPhoneNumberData, to stableId: DeviceContactStableId) -> Signal {
+ public func appendPhoneNumber(_ phoneNumber: DeviceContactPhoneNumberData, to stableId: DeviceContactStableId) -> Signal {
return Signal { subscriber in
let disposable = MetaDisposable()
self.impl.with({ impl in
@@ -882,7 +881,7 @@ public final class DeviceContactDataManager {
}
}
- func createContactWithData(_ contactData: DeviceContactExtendedData) -> Signal<(DeviceContactStableId, DeviceContactExtendedData)?, NoError> {
+ public func createContactWithData(_ contactData: DeviceContactExtendedData) -> Signal<(DeviceContactStableId, DeviceContactExtendedData)?, NoError> {
return Signal { subscriber in
let disposable = MetaDisposable()
self.impl.with({ impl in
@@ -895,7 +894,7 @@ public final class DeviceContactDataManager {
}
}
- func deleteContactWithAppSpecificReference(peerId: PeerId) -> Signal {
+ public func deleteContactWithAppSpecificReference(peerId: PeerId) -> Signal {
return Signal { subscriber in
let disposable = MetaDisposable()
self.impl.with({ impl in
diff --git a/submodules/TelegramUI/TelegramUI/DeviceContactInfoController.swift b/submodules/TelegramUI/TelegramUI/DeviceContactInfoController.swift
index 26e7b5c0fb..68db49a79f 100644
--- a/submodules/TelegramUI/TelegramUI/DeviceContactInfoController.swift
+++ b/submodules/TelegramUI/TelegramUI/DeviceContactInfoController.swift
@@ -7,6 +7,8 @@ import TelegramCore
import MessageUI
import TelegramPresentationData
import ItemListUI
+import TelegramStringFormatting
+import AccountContext
private enum DeviceContactInfoAction {
case sendMessage
@@ -798,7 +800,7 @@ private final class DeviceContactInfoController: ItemListController Void)? = nil, cancelled: (() -> Void)? = nil) -> ViewController {
+public func deviceContactInfoController(context: AccountContext, subject: DeviceContactInfoSubject, completed: (() -> Void)? = nil, cancelled: (() -> Void)? = nil) -> ViewController {
var initialState = DeviceContactInfoState()
if case let .create(peer, contactData, _, _, _) = subject {
var peerPhoneNumber: String?
@@ -1311,7 +1313,7 @@ public func deviceContactInfoController(context: AccountContextImpl, subject: De
return controller
}
-private func addContactToExisting(context: AccountContextImpl, parentController: ViewController, contactData: DeviceContactExtendedData, completion: @escaping (Peer?, DeviceContactStableId, DeviceContactExtendedData) -> Void) {
+private func addContactToExisting(context: AccountContext, parentController: ViewController, contactData: DeviceContactExtendedData, completion: @escaping (Peer?, DeviceContactStableId, DeviceContactExtendedData) -> Void) {
let contactsController = ContactSelectionController(context: context, title: { $0.Contacts_Title }, displayDeviceContacts: true)
parentController.present(contactsController, in: .window(.root), with: ViewControllerPresentationArguments(presentationAnimation: .modalSheet))
let _ = (contactsController.result
@@ -1380,7 +1382,7 @@ private func addContactToExisting(context: AccountContextImpl, parentController:
})
}
-func addContactOptionsController(context: AccountContextImpl, peer: Peer?, contactData: DeviceContactExtendedData) -> ActionSheetController {
+func addContactOptionsController(context: AccountContext, peer: Peer?, contactData: DeviceContactExtendedData) -> ActionSheetController {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let controller = ActionSheetController(presentationTheme: presentationData.theme)
let dismissAction: () -> Void = { [weak controller] in
diff --git a/submodules/TelegramUI/TelegramUI/DisabledContextResultsChatInputContextPanelNode.swift b/submodules/TelegramUI/TelegramUI/DisabledContextResultsChatInputContextPanelNode.swift
index 98b232b193..56e45b7044 100644
--- a/submodules/TelegramUI/TelegramUI/DisabledContextResultsChatInputContextPanelNode.swift
+++ b/submodules/TelegramUI/TelegramUI/DisabledContextResultsChatInputContextPanelNode.swift
@@ -4,6 +4,8 @@ import TelegramCore
import AsyncDisplayKit
import Display
import TelegramPresentationData
+import TelegramStringFormatting
+import AccountContext
final class DisabledContextResultsChatInputContextPanelNode: ChatInputContextPanelNode {
private let containerNode: ASDisplayNode
@@ -12,7 +14,7 @@ final class DisabledContextResultsChatInputContextPanelNode: ChatInputContextPan
private var validLayout: (CGSize, CGFloat, CGFloat)?
- override init(context: AccountContextImpl, theme: PresentationTheme, strings: PresentationStrings) {
+ override init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings) {
self.containerNode = ASDisplayNode()
self.separatorNode = ASDisplayNode()
self.textNode = ImmediateTextNode()
diff --git a/submodules/TelegramUI/TelegramUI/EditAccessoryPanelNode.swift b/submodules/TelegramUI/TelegramUI/EditAccessoryPanelNode.swift
index bce1ae5b4b..b7d7fc965b 100644
--- a/submodules/TelegramUI/TelegramUI/EditAccessoryPanelNode.swift
+++ b/submodules/TelegramUI/TelegramUI/EditAccessoryPanelNode.swift
@@ -8,6 +8,7 @@ import Display
import TelegramPresentationData
import TelegramUIPreferences
import ActivityIndicator
+import AccountContext
final class EditAccessoryPanelNode: AccessoryPanelNode {
let messageId: MessageId
@@ -54,12 +55,12 @@ final class EditAccessoryPanelNode: AccessoryPanelNode {
}
}
- private let context: AccountContextImpl
+ private let context: AccountContext
var theme: PresentationTheme
var strings: PresentationStrings
var nameDisplayOrder: PresentationPersonNameOrder
- init(context: AccountContextImpl, messageId: MessageId, theme: PresentationTheme, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder) {
+ init(context: AccountContext, messageId: MessageId, theme: PresentationTheme, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder) {
self.context = context
self.messageId = messageId
self.theme = theme
diff --git a/submodules/TelegramUI/TelegramUI/EditSettingsController.swift b/submodules/TelegramUI/TelegramUI/EditSettingsController.swift
index 5e3c4f3e08..cbb9c6cca9 100644
--- a/submodules/TelegramUI/TelegramUI/EditSettingsController.swift
+++ b/submodules/TelegramUI/TelegramUI/EditSettingsController.swift
@@ -8,9 +8,10 @@ import TelegramCore
import LegacyComponents
import TelegramPresentationData
import ItemListUI
+import AccountContext
private struct EditSettingsItemArguments {
- let context: AccountContextImpl
+ let context: AccountContext
let accountManager: AccountManager
let avatarAndNameInfoContext: ItemListAvatarAndNameInfoItemContext
@@ -298,7 +299,7 @@ private func editSettingsEntries(presentationData: PresentationData, state: Edit
return entries
}
-func editSettingsController(context: AccountContextImpl, currentName: ItemListAvatarAndNameInfoItemName, currentBioText: String, accountManager: AccountManager, canAddAccounts: Bool, focusOnItemTag: EditSettingsEntryTag? = nil) -> ViewController {
+func editSettingsController(context: AccountContext, currentName: ItemListAvatarAndNameInfoItemName, currentBioText: String, accountManager: AccountManager, canAddAccounts: Bool, focusOnItemTag: EditSettingsEntryTag? = nil) -> ViewController {
let initialState = EditSettingsState(editingName: currentName, editingBioText: currentBioText)
let statePromise = ValuePromise(initialState, ignoreRepeated: true)
let stateValue = Atomic(value: initialState)
diff --git a/submodules/TelegramUI/TelegramUI/EmojisChatInputContextPanelNode.swift b/submodules/TelegramUI/TelegramUI/EmojisChatInputContextPanelNode.swift
index 2d0a9eb872..34d4c64e00 100644
--- a/submodules/TelegramUI/TelegramUI/EmojisChatInputContextPanelNode.swift
+++ b/submodules/TelegramUI/TelegramUI/EmojisChatInputContextPanelNode.swift
@@ -6,6 +6,7 @@ import TelegramCore
import Display
import TelegramPresentationData
import MergeLists
+import AccountContext
private struct EmojisChatInputContextPanelEntryStableId: Hashable, Equatable {
let symbol: String
@@ -101,7 +102,7 @@ final class EmojisChatInputContextPanelNode: ChatInputContextPanelNode {
private var enqueuedTransitions: [(EmojisChatInputContextPanelTransition, Bool)] = []
private var validLayout: (CGSize, CGFloat, CGFloat)?
- override init(context: AccountContextImpl, theme: PresentationTheme, strings: PresentationStrings) {
+ override init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings) {
self.backgroundNode = ASImageNode()
self.backgroundNode.displayWithoutProcessing = true
self.backgroundNode.displaysAsynchronously = false
diff --git a/submodules/TelegramUI/TelegramUI/FeaturedStickerPacksController.swift b/submodules/TelegramUI/TelegramUI/FeaturedStickerPacksController.swift
index 55ec3b8dde..09d19e9971 100644
--- a/submodules/TelegramUI/TelegramUI/FeaturedStickerPacksController.swift
+++ b/submodules/TelegramUI/TelegramUI/FeaturedStickerPacksController.swift
@@ -7,6 +7,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AccountContext
private final class FeaturedStickerPacksControllerArguments {
let account: Account
@@ -159,7 +160,7 @@ private func featuredStickerPacksControllerEntries(presentationData: Presentatio
return entries
}
-public func featuredStickerPacksController(context: AccountContextImpl) -> ViewController {
+public func featuredStickerPacksController(context: AccountContext) -> ViewController {
let statePromise = ValuePromise(FeaturedStickerPacksControllerState(), ignoreRepeated: true)
var presentControllerImpl: ((ViewController, ViewControllerPresentationArguments?) -> Void)?
diff --git a/submodules/TelegramUI/TelegramUI/FetchManager.swift b/submodules/TelegramUI/TelegramUI/FetchManager.swift
index e02ae126c1..bfc760d4d4 100644
--- a/submodules/TelegramUI/TelegramUI/FetchManager.swift
+++ b/submodules/TelegramUI/TelegramUI/FetchManager.swift
@@ -4,6 +4,7 @@ import TelegramCore
import SwiftSignalKit
import Postbox
import TelegramUIPreferences
+import AccountContext
private struct FetchManagerLocationEntryId: Hashable {
let location: FetchManagerLocation
@@ -28,65 +29,6 @@ private struct FetchManagerLocationEntryId: Hashable {
}
}
-enum FetchManagerForegroundDirection {
- case toEarlier
- case toLater
-}
-
-enum FetchManagerPriority: Comparable {
- case userInitiated
- case foregroundPrefetch(direction: FetchManagerForegroundDirection, localOrder: MessageIndex)
- case backgroundPrefetch(locationOrder: HistoryPreloadIndex, localOrder: MessageIndex)
-
- static func <(lhs: FetchManagerPriority, rhs: FetchManagerPriority) -> Bool {
- switch lhs {
- case .userInitiated:
- switch rhs {
- case .userInitiated:
- return false
- case .foregroundPrefetch:
- return true
- case .backgroundPrefetch:
- return true
- }
- case let .foregroundPrefetch(lhsDirection, lhsLocalOrder):
- switch rhs {
- case .userInitiated:
- return false
- case let .foregroundPrefetch(rhsDirection, rhsLocalOrder):
- if lhsDirection == rhsDirection {
- switch lhsDirection {
- case .toEarlier:
- return lhsLocalOrder > rhsLocalOrder
- case .toLater:
- return lhsLocalOrder < rhsLocalOrder
- }
- } else {
- if lhsDirection == .toEarlier {
- return true
- } else {
- return false
- }
- }
- case .backgroundPrefetch:
- return true
- }
- case let .backgroundPrefetch(lhsLocationOrder, lhsLocalOrder):
- switch rhs {
- case .userInitiated:
- return false
- case .foregroundPrefetch:
- return false
- case let .backgroundPrefetch(rhsLocationOrder, rhsLocalOrder):
- if lhsLocationOrder != rhsLocationOrder {
- return lhsLocationOrder < rhsLocationOrder
- }
- return lhsLocalOrder > rhsLocalOrder
- }
- }
- }
-}
-
private final class FetchManagerLocationEntry {
let id: FetchManagerLocationEntryId
let episode: Int32
@@ -516,7 +458,7 @@ private final class FetchManagerCategoryContext {
}
}
-public final class FetchManager {
+public final class FetchManagerImpl: FetchManager {
private let queue = Queue.mainQueue()
private let postbox: Postbox
private let storeManager: DownloadedMediaStoreManager?
@@ -588,7 +530,7 @@ public final class FetchManager {
}
}
- func interactivelyFetched(category: FetchManagerCategory, location: FetchManagerLocation, locationKey: FetchManagerLocationKey, mediaReference: AnyMediaReference?, resourceReference: MediaResourceReference, ranges: IndexSet = IndexSet(integersIn: 0 ..< Int(Int32.max) as Range), statsCategory: MediaResourceStatsCategory, elevatedPriority: Bool, userInitiated: Bool, priority: FetchManagerPriority = .userInitiated, storeToDownloadsPeerType: MediaAutoDownloadPeerType? = nil) -> Signal {
+ public func interactivelyFetched(category: FetchManagerCategory, location: FetchManagerLocation, locationKey: FetchManagerLocationKey, mediaReference: AnyMediaReference?, resourceReference: MediaResourceReference, ranges: IndexSet, statsCategory: MediaResourceStatsCategory, elevatedPriority: Bool, userInitiated: Bool, priority: FetchManagerPriority = .userInitiated, storeToDownloadsPeerType: MediaAutoDownloadPeerType?) -> Signal {
let queue = self.queue
return Signal { [weak self] subscriber in
if let strongSelf = self {
@@ -663,7 +605,7 @@ public final class FetchManager {
} |> runOn(self.queue)
}
- func cancelInteractiveFetches(category: FetchManagerCategory, location: FetchManagerLocation, locationKey: FetchManagerLocationKey, resource: MediaResource) {
+ public func cancelInteractiveFetches(category: FetchManagerCategory, location: FetchManagerLocation, locationKey: FetchManagerLocationKey, resource: MediaResource) {
self.queue.async {
self.withCategoryContext(category, { context in
context.cancelEntry(FetchManagerLocationEntryId(location: location, resourceId: resource.id, locationKey: locationKey))
@@ -673,7 +615,7 @@ public final class FetchManager {
}
}
- func fetchStatus(category: FetchManagerCategory, location: FetchManagerLocation, locationKey: FetchManagerLocationKey, resource: MediaResource) -> Signal {
+ public func fetchStatus(category: FetchManagerCategory, location: FetchManagerLocation, locationKey: FetchManagerLocationKey, resource: MediaResource) -> Signal {
let queue = self.queue
return Signal { [weak self] subscriber in
if let strongSelf = self {
diff --git a/submodules/TelegramUI/TelegramUI/FetchManagerLocation.swift b/submodules/TelegramUI/TelegramUI/FetchManagerLocation.swift
index 5d36b3aedd..7c6c2b2ca0 100644
--- a/submodules/TelegramUI/TelegramUI/FetchManagerLocation.swift
+++ b/submodules/TelegramUI/TelegramUI/FetchManagerLocation.swift
@@ -1,140 +1,2 @@
import Foundation
import Postbox
-
-enum FetchManagerCategory: Int32 {
- case image
- case file
- case voice
- case animation
-}
-
-enum FetchManagerLocationKey: Comparable, Hashable {
- case messageId(MessageId)
- case free
-
- static func ==(lhs: FetchManagerLocationKey, rhs: FetchManagerLocationKey) -> Bool {
- switch lhs {
- case let .messageId(id):
- if case .messageId(id) = rhs {
- return true
- } else {
- return false
- }
- case .free:
- if case .free = rhs {
- return true
- } else {
- return false
- }
- }
- }
-
- static func <(lhs: FetchManagerLocationKey, rhs: FetchManagerLocationKey) -> Bool {
- switch lhs {
- case let .messageId(lhsId):
- if case let .messageId(rhsId) = rhs {
- return lhsId < rhsId
- } else {
- return true
- }
- case .free:
- if case .free = rhs {
- return false
- } else {
- return false
- }
- }
- }
-
- var hashValue: Int {
- switch self {
- case let .messageId(id):
- return id.hashValue
- case .free:
- return 1
- }
- }
-}
-
-struct FetchManagerPriorityKey: Comparable {
- let locationKey: FetchManagerLocationKey
- let hasElevatedPriority: Bool
- let userInitiatedPriority: Int32?
- let topReference: FetchManagerPriority?
-
- static func ==(lhs: FetchManagerPriorityKey, rhs: FetchManagerPriorityKey) -> Bool {
- if lhs.locationKey != rhs.locationKey {
- return false
- }
- if lhs.hasElevatedPriority != rhs.hasElevatedPriority {
- return false
- }
- if lhs.userInitiatedPriority != rhs.userInitiatedPriority {
- return false
- }
- if lhs.topReference != rhs.topReference {
- return false
- }
- return true
- }
-
- static func <(lhs: FetchManagerPriorityKey, rhs: FetchManagerPriorityKey) -> Bool {
- if let lhsUserInitiatedPriority = lhs.userInitiatedPriority, let rhsUserInitiatedPriority = rhs.userInitiatedPriority {
- if lhsUserInitiatedPriority != rhsUserInitiatedPriority {
- if lhsUserInitiatedPriority > rhsUserInitiatedPriority {
- return false
- } else {
- return true
- }
- }
- } else if (lhs.userInitiatedPriority != nil) != (rhs.userInitiatedPriority != nil) {
- if lhs.userInitiatedPriority != nil {
- return true
- } else {
- return false
- }
- }
-
- if lhs.hasElevatedPriority != rhs.hasElevatedPriority {
- if lhs.hasElevatedPriority {
- return true
- } else {
- return false
- }
- }
-
- if lhs.topReference != rhs.topReference {
- if let lhsTopReference = lhs.topReference, let rhsTopReference = rhs.topReference {
- return lhsTopReference < rhsTopReference
- } else if lhs.topReference != nil {
- return true
- } else {
- return false
- }
- }
-
- return lhs.locationKey < rhs.locationKey
- }
-}
-
-enum FetchManagerLocation: Hashable {
- case chat(PeerId)
-
- static func ==(lhs: FetchManagerLocation, rhs: FetchManagerLocation) -> Bool {
- switch lhs {
- case let .chat(peerId):
- if case .chat(peerId) = rhs {
- return true
- } else {
- return false
- }
- }
- }
-
- var hashValue: Int {
- switch self {
- case let .chat(peerId):
- return peerId.hashValue
- }
- }
-}
diff --git a/submodules/TelegramUI/TelegramUI/FetchMediaUtils.swift b/submodules/TelegramUI/TelegramUI/FetchMediaUtils.swift
index 9da9890068..3cb2be962a 100644
--- a/submodules/TelegramUI/TelegramUI/FetchMediaUtils.swift
+++ b/submodules/TelegramUI/TelegramUI/FetchMediaUtils.swift
@@ -4,6 +4,7 @@ import TelegramCore
import Postbox
import SwiftSignalKit
import TelegramUIPreferences
+import AccountContext
public func freeMediaFileInteractiveFetched(account: Account, fileReference: FileMediaReference) -> Signal {
return fetchedMediaResource(mediaBox: account.postbox.mediaBox, reference: fileReference.resourceReference(fileReference.media.resource))
@@ -27,32 +28,32 @@ private func fetchCategoryForFile(_ file: TelegramMediaFile) -> FetchManagerCate
}
}
-public func messageMediaFileInteractiveFetched(context: AccountContextImpl, message: Message, file: TelegramMediaFile, userInitiated: Bool) -> Signal {
+public func messageMediaFileInteractiveFetched(context: AccountContext, message: Message, file: TelegramMediaFile, userInitiated: Bool) -> Signal {
return messageMediaFileInteractiveFetched(fetchManager: context.fetchManager, messageId: message.id, messageReference: MessageReference(message), file: file, userInitiated: userInitiated, priority: .userInitiated)
}
func messageMediaFileInteractiveFetched(fetchManager: FetchManager, messageId: MessageId, messageReference: MessageReference, file: TelegramMediaFile, ranges: IndexSet = IndexSet(integersIn: 0 ..< Int(Int32.max) as Range), userInitiated: Bool, priority: FetchManagerPriority) -> Signal {
let mediaReference = AnyMediaReference.message(message: messageReference, media: file)
- return fetchManager.interactivelyFetched(category: fetchCategoryForFile(file), location: .chat(messageId.peerId), locationKey: .messageId(messageId), mediaReference: mediaReference, resourceReference: mediaReference.resourceReference(file.resource), ranges: ranges, statsCategory: statsCategoryForFileWithAttributes(file.attributes), elevatedPriority: false, userInitiated: userInitiated, priority: priority)
+ return fetchManager.interactivelyFetched(category: fetchCategoryForFile(file), location: .chat(messageId.peerId), locationKey: .messageId(messageId), mediaReference: mediaReference, resourceReference: mediaReference.resourceReference(file.resource), ranges: ranges, statsCategory: statsCategoryForFileWithAttributes(file.attributes), elevatedPriority: false, userInitiated: userInitiated, priority: priority, storeToDownloadsPeerType: nil)
}
-func messageMediaFileCancelInteractiveFetch(context: AccountContextImpl, messageId: MessageId, file: TelegramMediaFile) {
+func messageMediaFileCancelInteractiveFetch(context: AccountContext, messageId: MessageId, file: TelegramMediaFile) {
context.fetchManager.cancelInteractiveFetches(category: fetchCategoryForFile(file), location: .chat(messageId.peerId), locationKey: .messageId(messageId), resource: file.resource)
}
-public func messageMediaImageInteractiveFetched(context: AccountContextImpl, message: Message, image: TelegramMediaImage, resource: MediaResource, storeToDownloadsPeerType: MediaAutoDownloadPeerType?) -> Signal {
+public func messageMediaImageInteractiveFetched(context: AccountContext, message: Message, image: TelegramMediaImage, resource: MediaResource, storeToDownloadsPeerType: MediaAutoDownloadPeerType?) -> Signal {
return messageMediaImageInteractiveFetched(fetchManager: context.fetchManager, messageId: message.id, messageReference: MessageReference(message), image: image, resource: resource, userInitiated: true, priority: .userInitiated, storeToDownloadsPeerType: storeToDownloadsPeerType)
}
func messageMediaImageInteractiveFetched(fetchManager: FetchManager, messageId: MessageId, messageReference: MessageReference, image: TelegramMediaImage, resource: MediaResource, userInitiated: Bool, priority: FetchManagerPriority, storeToDownloadsPeerType: MediaAutoDownloadPeerType?) -> Signal {
let mediaReference = AnyMediaReference.message(message: messageReference, media: image)
- return fetchManager.interactivelyFetched(category: .image, location: .chat(messageId.peerId), locationKey: .messageId(messageId), mediaReference: mediaReference, resourceReference: mediaReference.resourceReference(resource), statsCategory: .image, elevatedPriority: false, userInitiated: userInitiated, priority: priority, storeToDownloadsPeerType: storeToDownloadsPeerType)
+ return fetchManager.interactivelyFetched(category: .image, location: .chat(messageId.peerId), locationKey: .messageId(messageId), mediaReference: mediaReference, resourceReference: mediaReference.resourceReference(resource), ranges: FetchCompleteRange, statsCategory: .image, elevatedPriority: false, userInitiated: userInitiated, priority: priority, storeToDownloadsPeerType: storeToDownloadsPeerType)
}
-func messageMediaImageCancelInteractiveFetch(context: AccountContextImpl, messageId: MessageId, image: TelegramMediaImage, resource: MediaResource) {
+func messageMediaImageCancelInteractiveFetch(context: AccountContext, messageId: MessageId, image: TelegramMediaImage, resource: MediaResource) {
context.fetchManager.cancelInteractiveFetches(category: .image, location: .chat(messageId.peerId), locationKey: .messageId(messageId), resource: resource)
}
-func messageMediaFileStatus(context: AccountContextImpl, messageId: MessageId, file: TelegramMediaFile) -> Signal {
+func messageMediaFileStatus(context: AccountContext, messageId: MessageId, file: TelegramMediaFile) -> Signal {
return context.fetchManager.fetchStatus(category: fetchCategoryForFile(file), location: .chat(messageId.peerId), locationKey: .messageId(messageId), resource: file.resource)
}
diff --git a/submodules/TelegramUI/TelegramUI/FileMediaResourceStatus.swift b/submodules/TelegramUI/TelegramUI/FileMediaResourceStatus.swift
index 26dc3a42db..1bf2cf5aab 100644
--- a/submodules/TelegramUI/TelegramUI/FileMediaResourceStatus.swift
+++ b/submodules/TelegramUI/TelegramUI/FileMediaResourceStatus.swift
@@ -4,6 +4,7 @@ import TelegramCore
import Postbox
import SwiftSignalKit
import UniversalMediaPlayer
+import AccountContext
enum FileMediaResourcePlaybackStatus: Equatable {
case playing
@@ -20,7 +21,7 @@ enum FileMediaResourceMediaStatus: Equatable {
case playbackStatus(FileMediaResourcePlaybackStatus)
}
-private func internalMessageFileMediaPlaybackStatus(context: AccountContextImpl, file: TelegramMediaFile, message: Message, isRecentActions: Bool) -> Signal {
+private func internalMessageFileMediaPlaybackStatus(context: AccountContext, file: TelegramMediaFile, message: Message, isRecentActions: Bool) -> Signal {
guard let playerType = peerMessageMediaPlayerType(message) else {
return .single(nil)
}
@@ -35,7 +36,7 @@ private func internalMessageFileMediaPlaybackStatus(context: AccountContextImpl,
}
}
-func messageFileMediaPlaybackStatus(context: AccountContextImpl, file: TelegramMediaFile, message: Message, isRecentActions: Bool) -> Signal {
+func messageFileMediaPlaybackStatus(context: AccountContext, file: TelegramMediaFile, message: Message, isRecentActions: Bool) -> Signal {
var duration = 0.0
if let value = file.duration {
duration = Double(value)
@@ -46,7 +47,7 @@ func messageFileMediaPlaybackStatus(context: AccountContextImpl, file: TelegramM
}
}
-func messageFileMediaResourceStatus(context: AccountContextImpl, file: TelegramMediaFile, message: Message, isRecentActions: Bool) -> Signal {
+func messageFileMediaResourceStatus(context: AccountContext, file: TelegramMediaFile, message: Message, isRecentActions: Bool) -> Signal {
let playbackStatus = internalMessageFileMediaPlaybackStatus(context: context, file: file, message: message, isRecentActions: isRecentActions) |> map { status -> MediaPlayerPlaybackStatus? in
return status?.status
}
diff --git a/submodules/TelegramUI/TelegramUI/ForwardAccessoryPanelNode.swift b/submodules/TelegramUI/TelegramUI/ForwardAccessoryPanelNode.swift
index 1135d928b6..6e0003995b 100644
--- a/submodules/TelegramUI/TelegramUI/ForwardAccessoryPanelNode.swift
+++ b/submodules/TelegramUI/TelegramUI/ForwardAccessoryPanelNode.swift
@@ -6,6 +6,7 @@ import Postbox
import SwiftSignalKit
import Display
import TelegramPresentationData
+import AccountContext
func textStringForForwardedMessage(_ message: Message, strings: PresentationStrings) -> (String, Bool) {
for media in message.media {
@@ -78,7 +79,7 @@ final class ForwardAccessoryPanelNode: AccessoryPanelNode {
var theme: PresentationTheme
- init(context: AccountContextImpl, messageIds: [MessageId], theme: PresentationTheme, strings: PresentationStrings) {
+ init(context: AccountContext, messageIds: [MessageId], theme: PresentationTheme, strings: PresentationStrings) {
self.messageIds = messageIds
self.theme = theme
diff --git a/submodules/TelegramUI/TelegramUI/ForwardPrivacyChatPreviewItem.swift b/submodules/TelegramUI/TelegramUI/ForwardPrivacyChatPreviewItem.swift
index e86d01087d..1923fc8fbd 100644
--- a/submodules/TelegramUI/TelegramUI/ForwardPrivacyChatPreviewItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ForwardPrivacyChatPreviewItem.swift
@@ -8,9 +8,10 @@ import Postbox
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AccountContext
class ForwardPrivacyChatPreviewItem: ListViewItem, ItemListItem {
- let context: AccountContextImpl
+ let context: AccountContext
let theme: PresentationTheme
let strings: PresentationStrings
let sectionId: ItemListSectionId
@@ -22,7 +23,7 @@ class ForwardPrivacyChatPreviewItem: ListViewItem, ItemListItem {
let linkEnabled: Bool
let tooltipText: String
- init(context: AccountContextImpl, theme: PresentationTheme, strings: PresentationStrings, sectionId: ItemListSectionId, fontSize: PresentationFontSize, wallpaper: TelegramWallpaper, dateTimeFormat: PresentationDateTimeFormat, nameDisplayOrder: PresentationPersonNameOrder, peerName: String, linkEnabled: Bool, tooltipText: String) {
+ init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, sectionId: ItemListSectionId, fontSize: PresentationFontSize, wallpaper: TelegramWallpaper, dateTimeFormat: PresentationDateTimeFormat, nameDisplayOrder: PresentationPersonNameOrder, peerName: String, linkEnabled: Bool, tooltipText: String) {
self.context = context
self.theme = theme
self.strings = strings
diff --git a/submodules/TelegramUI/TelegramUI/GalleryController.swift b/submodules/TelegramUI/TelegramUI/GalleryController.swift
index 2395f68746..b30a9b5866 100644
--- a/submodules/TelegramUI/TelegramUI/GalleryController.swift
+++ b/submodules/TelegramUI/TelegramUI/GalleryController.swift
@@ -9,6 +9,7 @@ import TelegramCore
import SafariServices
import TelegramPresentationData
import TextFormat
+import AccountContext
private func tagsForMessage(_ message: Message) -> MessageTags? {
for media in message.media {
@@ -135,7 +136,7 @@ private func galleryMessageCaptionText(_ message: Message) -> String {
return message.text
}
-func galleryItemForEntry(context: AccountContextImpl, presentationData: PresentationData, entry: MessageHistoryEntry, isCentral: Bool = false, streamVideos: Bool, loopVideos: Bool = false, hideControls: Bool = false, fromPlayingVideo: Bool = false, landscape: Bool = false, timecode: Double? = nil, tempFilePath: String? = nil, playbackCompleted: @escaping () -> Void = {}, performAction: @escaping (GalleryControllerInteractionTapAction) -> Void = { _ in }, openActionOptions: @escaping (GalleryControllerInteractionTapAction) -> Void = { _ in }) -> GalleryItem? {
+func galleryItemForEntry(context: AccountContext, presentationData: PresentationData, entry: MessageHistoryEntry, isCentral: Bool = false, streamVideos: Bool, loopVideos: Bool = false, hideControls: Bool = false, fromPlayingVideo: Bool = false, landscape: Bool = false, timecode: Double? = nil, tempFilePath: String? = nil, playbackCompleted: @escaping () -> Void = {}, performAction: @escaping (GalleryControllerInteractionTapAction) -> Void = { _ in }, openActionOptions: @escaping (GalleryControllerInteractionTapAction) -> Void = { _ in }) -> GalleryItem? {
let message = entry.message
let location = entry.location
if let (media, mediaImage) = mediaForMessage(message: message) {
@@ -268,26 +269,6 @@ public enum GalleryControllerItemNodeAction {
case timecode(Double)
}
-final class GalleryControllerActionInteraction {
- let openUrl: (String, Bool) -> Void
- let openUrlIn: (String) -> Void
- let openPeerMention: (String) -> Void
- let openPeer: (PeerId) -> Void
- let openHashtag: (String?, String) -> Void
- let openBotCommand: (String) -> Void
- let addContact: (String) -> Void
-
- init(openUrl: @escaping (String, Bool) -> Void, openUrlIn: @escaping (String) -> Void, openPeerMention: @escaping (String) -> Void, openPeer: @escaping (PeerId) -> Void, openHashtag: @escaping (String?, String) -> Void, openBotCommand: @escaping (String) -> Void, addContact: @escaping (String) -> Void) {
- self.openUrl = openUrl
- self.openUrlIn = openUrlIn
- self.openPeerMention = openPeerMention
- self.openPeer = openPeer
- self.openHashtag = openHashtag
- self.openBotCommand = openBotCommand
- self.addContact = addContact
- }
-}
-
class GalleryController: ViewController {
static let darkNavigationTheme = NavigationBarTheme(buttonColor: .white, disabledButtonColor: UIColor(rgb: 0x525252), primaryTextColor: .white, backgroundColor: UIColor(white: 0.0, alpha: 0.6), separatorColor: UIColor(white: 0.0, alpha: 0.8), badgeBackgroundColor: .clear, badgeStrokeColor: .clear, badgeTextColor: .clear)
static let lightNavigationTheme = NavigationBarTheme(buttonColor: UIColor(rgb: 0x007ee5), disabledButtonColor: UIColor(rgb: 0xd0d0d0), primaryTextColor: .black, backgroundColor: UIColor(red: 0.968626451, green: 0.968626451, blue: 0.968626451, alpha: 1.0), separatorColor: UIColor(red: 0.6953125, green: 0.6953125, blue: 0.6953125, alpha: 1.0), badgeBackgroundColor: .clear, badgeStrokeColor: .clear, badgeTextColor: .clear)
@@ -296,7 +277,7 @@ class GalleryController: ViewController {
return self.displayNode as! GalleryControllerNode
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private var presentationData: PresentationData
private let source: GalleryControllerItemSource
@@ -340,7 +321,7 @@ class GalleryController: ViewController {
private var performAction: (GalleryControllerInteractionTapAction) -> Void
private var openActionOptions: (GalleryControllerInteractionTapAction) -> Void
- init(context: AccountContextImpl, source: GalleryControllerItemSource, invertItemOrder: Bool = false, streamSingleVideo: Bool = false, fromPlayingVideo: Bool = false, landscape: Bool = false, timecode: Double? = nil, synchronousLoad: Bool = false, replaceRootController: @escaping (ViewController, ValuePromise?) -> Void, baseNavigationController: NavigationController?, actionInteraction: GalleryControllerActionInteraction? = nil) {
+ init(context: AccountContext, source: GalleryControllerItemSource, invertItemOrder: Bool = false, streamSingleVideo: Bool = false, fromPlayingVideo: Bool = false, landscape: Bool = false, timecode: Double? = nil, synchronousLoad: Bool = false, replaceRootController: @escaping (ViewController, ValuePromise?) -> Void, baseNavigationController: NavigationController?, actionInteraction: GalleryControllerActionInteraction? = nil) {
self.context = context
self.source = source
self.replaceRootController = replaceRootController
@@ -861,7 +842,7 @@ class GalleryController: ViewController {
if entry.message.stableId == self.centralEntryStableId {
isCentral = true
}
- if let item = galleryItemForEntry(context: context, presentationData: self.presentationData, entry: entry, streamVideos: self.streamVideos, fromPlayingVideo: isCentral && self.fromPlayingVideo, landscape: isCentral && self.landscape, timecode: isCentral ? self.timecode : nil, performAction: self.performAction, openActionOptions: self.openActionOptions) {
+ if let item = galleryItemForEntry(context: self.context, presentationData: self.presentationData, entry: entry, streamVideos: self.streamVideos, fromPlayingVideo: isCentral && self.fromPlayingVideo, landscape: isCentral && self.landscape, timecode: isCentral ? self.timecode : nil, performAction: self.performAction, openActionOptions: self.openActionOptions) {
if isCentral {
centralItemIndex = items.count
}
diff --git a/submodules/TelegramUI/TelegramUI/GalleryHiddenMediaManager.swift b/submodules/TelegramUI/TelegramUI/GalleryHiddenMediaManager.swift
index 86aa0ae74f..6ef1de21e7 100644
--- a/submodules/TelegramUI/TelegramUI/GalleryHiddenMediaManager.swift
+++ b/submodules/TelegramUI/TelegramUI/GalleryHiddenMediaManager.swift
@@ -3,28 +3,7 @@ import UIKit
import Postbox
import SwiftSignalKit
import AsyncDisplayKit
-
-enum GalleryHiddenMediaId: Hashable {
- case chat(AccountRecordId, MessageId, Media)
-
- static func ==(lhs: GalleryHiddenMediaId, rhs: GalleryHiddenMediaId) -> Bool {
- switch lhs {
- case let .chat(lhsAccountId ,lhsMessageId, lhsMedia):
- if case let .chat(rhsAccountId, rhsMessageId, rhsMedia) = rhs, lhsAccountId == rhsAccountId, lhsMessageId == rhsMessageId, lhsMedia.isEqual(to: rhsMedia) {
- return true
- } else {
- return false
- }
- }
- }
-
- var hashValue: Int {
- switch self {
- case let .chat(_, messageId, _):
- return messageId.hashValue
- }
- }
-}
+import AccountContext
private final class GalleryHiddenMediaContext {
private var ids = Set()
@@ -42,10 +21,6 @@ private final class GalleryHiddenMediaContext {
}
}
-protocol GalleryHiddenMediaTarget: class {
- func getTransitionInfo(messageId: MessageId, media: Media) -> ((UIView) -> Void, ASDisplayNode, () -> (UIView?, UIView?))?
-}
-
private final class GalleryHiddenMediaTargetHolder {
weak var target: GalleryHiddenMediaTarget?
@@ -54,7 +29,7 @@ private final class GalleryHiddenMediaTargetHolder {
}
}
-final class GalleryHiddenMediaManager {
+final class GalleryHiddenMediaManagerImpl: GalleryHiddenMediaManager {
private var nextId: Int32 = 0
private var contexts: [GalleryHiddenMediaId: GalleryHiddenMediaContext] = [:]
diff --git a/submodules/TelegramUI/TelegramUI/GalleryVideoDecoration.swift b/submodules/TelegramUI/TelegramUI/GalleryVideoDecoration.swift
index db3f3722d6..61e4250c29 100644
--- a/submodules/TelegramUI/TelegramUI/GalleryVideoDecoration.swift
+++ b/submodules/TelegramUI/TelegramUI/GalleryVideoDecoration.swift
@@ -4,6 +4,7 @@ import AsyncDisplayKit
import Display
import SwiftSignalKit
import UniversalMediaPlayer
+import AccountContext
final class GalleryVideoDecoration: UniversalVideoDecoration {
let backgroundNode: ASDisplayNode? = nil
diff --git a/submodules/TelegramUI/TelegramUI/GameController.swift b/submodules/TelegramUI/TelegramUI/GameController.swift
index 5a8ff15ae0..6c17dce60f 100644
--- a/submodules/TelegramUI/TelegramUI/GameController.swift
+++ b/submodules/TelegramUI/TelegramUI/GameController.swift
@@ -6,19 +6,20 @@ import TelegramCore
import SwiftSignalKit
import Postbox
import TelegramPresentationData
+import AccountContext
final class GameController: ViewController {
private var controllerNode: GameControllerNode {
return self.displayNode as! GameControllerNode
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private let url: String
private let message: Message
private var presentationData: PresentationData
- init(context: AccountContextImpl, url: String, message: Message) {
+ init(context: AccountContext, url: String, message: Message) {
self.context = context
self.url = url
self.message = message
diff --git a/submodules/TelegramUI/TelegramUI/GameControllerNode.swift b/submodules/TelegramUI/TelegramUI/GameControllerNode.swift
index 3b1914762e..82825076a6 100644
--- a/submodules/TelegramUI/TelegramUI/GameControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/GameControllerNode.swift
@@ -7,6 +7,7 @@ import TelegramCore
import Postbox
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
private class WeakGameScriptMessageHandler: NSObject, WKScriptMessageHandler {
private let f: (WKScriptMessage) -> ()
@@ -25,12 +26,12 @@ private class WeakGameScriptMessageHandler: NSObject, WKScriptMessageHandler {
final class GameControllerNode: ViewControllerTracingNode {
private var webView: WKWebView?
- private let context: AccountContextImpl
+ private let context: AccountContext
var presentationData: PresentationData
private let present: (ViewController, Any?) -> Void
private let message: Message
- init(context: AccountContextImpl, presentationData: PresentationData, url: String, present: @escaping (ViewController, Any?) -> Void, message: Message) {
+ init(context: AccountContext, presentationData: PresentationData, url: String, present: @escaping (ViewController, Any?) -> Void, message: Message) {
self.context = context
self.presentationData = presentationData
self.present = present
diff --git a/submodules/TelegramUI/TelegramUI/GifPaneSearchContentNode.swift b/submodules/TelegramUI/TelegramUI/GifPaneSearchContentNode.swift
index f23dc27815..3e3012006a 100644
--- a/submodules/TelegramUI/TelegramUI/GifPaneSearchContentNode.swift
+++ b/submodules/TelegramUI/TelegramUI/GifPaneSearchContentNode.swift
@@ -6,6 +6,7 @@ import SwiftSignalKit
import Postbox
import TelegramCore
import TelegramPresentationData
+import AccountContext
func paneGifSearchForQuery(account: Account, query: String, updateActivity: ((Bool) -> Void)?) -> Signal<[FileMediaReference]?, NoError> {
let delayRequest = true
@@ -98,7 +99,7 @@ func paneGifSearchForQuery(account: Account, query: String, updateActivity: ((Bo
}
final class GifPaneSearchContentNode: ASDisplayNode & PaneSearchContentNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let controllerInteraction: ChatControllerInteraction
private let inputNodeInteraction: ChatMediaInputNodeInteraction
@@ -122,7 +123,7 @@ final class GifPaneSearchContentNode: ASDisplayNode & PaneSearchContentNode {
var deactivateSearchBar: (() -> Void)?
var updateActivity: ((Bool) -> Void)?
- init(context: AccountContextImpl, theme: PresentationTheme, strings: PresentationStrings, controllerInteraction: ChatControllerInteraction, inputNodeInteraction: ChatMediaInputNodeInteraction, trendingPromise: Promise<[FileMediaReference]?>) {
+ init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, controllerInteraction: ChatControllerInteraction, inputNodeInteraction: ChatMediaInputNodeInteraction, trendingPromise: Promise<[FileMediaReference]?>) {
self.context = context
self.controllerInteraction = controllerInteraction
self.inputNodeInteraction = inputNodeInteraction
diff --git a/submodules/TelegramUI/TelegramUI/GridMessageItem.swift b/submodules/TelegramUI/TelegramUI/GridMessageItem.swift
index f6e8c8511c..292803a2a3 100644
--- a/submodules/TelegramUI/TelegramUI/GridMessageItem.swift
+++ b/submodules/TelegramUI/TelegramUI/GridMessageItem.swift
@@ -6,6 +6,8 @@ import TelegramCore
import Postbox
import SwiftSignalKit
import TelegramPresentationData
+import TelegramStringFormatting
+import AccountContext
private func mediaForMessage(_ message: Message) -> Media? {
for media in message.media {
@@ -105,12 +107,12 @@ final class GridMessageItemSectionNode: ASDisplayNode {
final class GridMessageItem: GridItem {
fileprivate let theme: PresentationTheme
private let strings: PresentationStrings
- private let context: AccountContextImpl
+ private let context: AccountContext
fileprivate let message: Message
private let controllerInteraction: ChatControllerInteraction
let section: GridSection?
- init(theme: PresentationTheme, strings: PresentationStrings, context: AccountContextImpl, message: Message, controllerInteraction: ChatControllerInteraction) {
+ init(theme: PresentationTheme, strings: PresentationStrings, context: AccountContext, message: Message, controllerInteraction: ChatControllerInteraction) {
self.theme = theme
self.strings = strings
self.context = context
@@ -139,7 +141,7 @@ final class GridMessageItem: GridItem {
}
final class GridMessageItemNode: GridItemNode {
- private var currentState: (AccountContextImpl, Media, CGSize)?
+ private var currentState: (AccountContext, Media, CGSize)?
private let imageNode: TransformImageNode
private(set) var messageId: MessageId?
private var item: GridMessageItem?
@@ -188,7 +190,7 @@ final class GridMessageItemNode: GridItemNode {
self.imageNode.view.addGestureRecognizer(recognizer)
}
- func setup(context: AccountContextImpl, item: GridMessageItem, media: Media, messageId: MessageId, controllerInteraction: ChatControllerInteraction, synchronousLoad: Bool) {
+ func setup(context: AccountContext, item: GridMessageItem, media: Media, messageId: MessageId, controllerInteraction: ChatControllerInteraction, synchronousLoad: Bool) {
self.item = item
if self.currentState == nil || self.currentState!.0 !== context || !self.currentState!.1.isEqual(to: media) {
diff --git a/submodules/TelegramUI/TelegramUI/GroupInfoController.swift b/submodules/TelegramUI/TelegramUI/GroupInfoController.swift
index 2145172fa4..b8c53ae207 100644
--- a/submodules/TelegramUI/TelegramUI/GroupInfoController.swift
+++ b/submodules/TelegramUI/TelegramUI/GroupInfoController.swift
@@ -12,9 +12,11 @@ import TelegramUIPreferences
import ItemListUI
import TextFormat
import AccountContext
+import TelegramStringFormatting
+import TemporaryCachedPeerDataManager
private final class GroupInfoArguments {
- let context: AccountContextImpl
+ let context: AccountContext
let avatarAndNameInfoContext: ItemListAvatarAndNameInfoItemContext
let tapAvatarAction: () -> Void
@@ -45,7 +47,7 @@ private final class GroupInfoArguments {
let changeLocation: () -> Void
let displayLocationContextMenu: (String) -> Void
- init(context: AccountContextImpl, avatarAndNameInfoContext: ItemListAvatarAndNameInfoItemContext, tapAvatarAction: @escaping () -> Void, changeProfilePhoto: @escaping () -> Void, pushController: @escaping (ViewController) -> Void, presentController: @escaping (ViewController, ViewControllerPresentationArguments) -> Void, changeNotificationMuteSettings: @escaping () -> Void, openPreHistory: @escaping () -> Void, openSharedMedia: @escaping () -> Void, openAdministrators: @escaping () -> Void, openPermissions: @escaping () -> Void, updateEditingName: @escaping (ItemListAvatarAndNameInfoItemName) -> Void, updateEditingDescriptionText: @escaping (String) -> Void, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, addMember: @escaping () -> Void, promotePeer: @escaping (RenderedChannelParticipant) -> Void, restrictPeer: @escaping (RenderedChannelParticipant) -> Void, removePeer: @escaping (PeerId) -> Void, leave: @escaping () -> Void, displayUsernameShareMenu: @escaping (String) -> Void, displayUsernameContextMenu: @escaping (String) -> Void, displayAboutContextMenu: @escaping (String) -> Void, aboutLinkAction: @escaping (TextLinkItemActionType, TextLinkItem) -> Void, openStickerPackSetup: @escaping () -> Void, openGroupTypeSetup: @escaping () -> Void, openLinkedChannelSetup: @escaping () -> Void, openLocation: @escaping (PeerGeoLocation) -> Void, changeLocation: @escaping () -> Void, displayLocationContextMenu: @escaping (String) -> Void) {
+ init(context: AccountContext, avatarAndNameInfoContext: ItemListAvatarAndNameInfoItemContext, tapAvatarAction: @escaping () -> Void, changeProfilePhoto: @escaping () -> Void, pushController: @escaping (ViewController) -> Void, presentController: @escaping (ViewController, ViewControllerPresentationArguments) -> Void, changeNotificationMuteSettings: @escaping () -> Void, openPreHistory: @escaping () -> Void, openSharedMedia: @escaping () -> Void, openAdministrators: @escaping () -> Void, openPermissions: @escaping () -> Void, updateEditingName: @escaping (ItemListAvatarAndNameInfoItemName) -> Void, updateEditingDescriptionText: @escaping (String) -> Void, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, addMember: @escaping () -> Void, promotePeer: @escaping (RenderedChannelParticipant) -> Void, restrictPeer: @escaping (RenderedChannelParticipant) -> Void, removePeer: @escaping (PeerId) -> Void, leave: @escaping () -> Void, displayUsernameShareMenu: @escaping (String) -> Void, displayUsernameContextMenu: @escaping (String) -> Void, displayAboutContextMenu: @escaping (String) -> Void, aboutLinkAction: @escaping (TextLinkItemActionType, TextLinkItem) -> Void, openStickerPackSetup: @escaping () -> Void, openGroupTypeSetup: @escaping () -> Void, openLinkedChannelSetup: @escaping () -> Void, openLocation: @escaping (PeerGeoLocation) -> Void, changeLocation: @escaping () -> Void, displayLocationContextMenu: @escaping (String) -> Void) {
self.context = context
self.avatarAndNameInfoContext = avatarAndNameInfoContext
self.tapAvatarAction = tapAvatarAction
@@ -1261,7 +1263,7 @@ private func valuesRequiringUpdate(state: GroupInfoState, view: PeerView) -> (ti
}
}
-public func groupInfoController(context: AccountContextImpl, peerId originalPeerId: PeerId, membersLoaded: @escaping () -> Void = {}) -> ViewController {
+public func groupInfoController(context: AccountContext, peerId originalPeerId: PeerId, membersLoaded: @escaping () -> Void = {}) -> ViewController {
let statePromise = ValuePromise(GroupInfoState(updatingAvatar: nil, editingState: nil, updatingName: nil, peerIdWithRevealedOptions: nil, temporaryParticipants: [], successfullyAddedParticipantIds: Set(), removingParticipantIds: Set(), savingData: false, searchingMembers: false), ignoreRepeated: true)
let stateValue = Atomic(value: GroupInfoState(updatingAvatar: nil, editingState: nil, updatingName: nil, peerIdWithRevealedOptions: nil, temporaryParticipants: [], successfullyAddedParticipantIds: Set(), removingParticipantIds: Set(), savingData: false, searchingMembers: false))
let updateState: ((GroupInfoState) -> GroupInfoState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/GroupInfoSearchItem.swift b/submodules/TelegramUI/TelegramUI/GroupInfoSearchItem.swift
index 31c71ee009..e546837462 100644
--- a/submodules/TelegramUI/TelegramUI/GroupInfoSearchItem.swift
+++ b/submodules/TelegramUI/TelegramUI/GroupInfoSearchItem.swift
@@ -6,9 +6,10 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import ItemListUI
+import AccountContext
final class ChannelMembersSearchItem: ItemListControllerSearch {
- let context: AccountContextImpl
+ let context: AccountContext
let peerId: PeerId
let searchContext: GroupMembersSearchContext?
let cancel: () -> Void
@@ -20,7 +21,7 @@ final class ChannelMembersSearchItem: ItemListControllerSearch {
private var activity: ValuePromise = ValuePromise(ignoreRepeated: false)
private let activityDisposable = MetaDisposable()
- init(context: AccountContextImpl, peerId: PeerId, searchContext: GroupMembersSearchContext?, searchMode: ChannelMembersSearchMode = .searchMembers, cancel: @escaping () -> Void, openPeer: @escaping (Peer, RenderedChannelParticipant?) -> Void, present: @escaping (ViewController, Any?) -> Void) {
+ init(context: AccountContext, peerId: PeerId, searchContext: GroupMembersSearchContext?, searchMode: ChannelMembersSearchMode = .searchMembers, cancel: @escaping () -> Void, openPeer: @escaping (Peer, RenderedChannelParticipant?) -> Void, present: @escaping (ViewController, Any?) -> Void) {
self.context = context
self.peerId = peerId
self.searchContext = searchContext
@@ -81,7 +82,7 @@ final class ChannelMembersSearchItem: ItemListControllerSearch {
private final class ChannelMembersSearchItemNode: ItemListControllerSearchNode {
private let containerNode: ChannelMembersSearchContainerNode
- init(context: AccountContextImpl, peerId: PeerId, searchMode: ChannelMembersSearchMode, searchContext: GroupMembersSearchContext?, openPeer: @escaping (Peer, RenderedChannelParticipant?) -> Void, cancel: @escaping () -> Void, updateActivity: @escaping(Bool) -> Void, present: @escaping (ViewController, Any?) -> Void) {
+ init(context: AccountContext, peerId: PeerId, searchMode: ChannelMembersSearchMode, searchContext: GroupMembersSearchContext?, openPeer: @escaping (Peer, RenderedChannelParticipant?) -> Void, cancel: @escaping () -> Void, updateActivity: @escaping(Bool) -> Void, present: @escaping (ViewController, Any?) -> Void) {
self.containerNode = ChannelMembersSearchContainerNode(context: context, peerId: peerId, mode: searchMode, filters: [], searchContext: searchContext, openPeer: { peer, participant in
openPeer(peer, participant)
}, updateActivity: updateActivity, present: present)
diff --git a/submodules/TelegramUI/TelegramUI/GroupPreHistorySetupController.swift b/submodules/TelegramUI/TelegramUI/GroupPreHistorySetupController.swift
index d4d14e9e9f..4e90bbc0d6 100644
--- a/submodules/TelegramUI/TelegramUI/GroupPreHistorySetupController.swift
+++ b/submodules/TelegramUI/TelegramUI/GroupPreHistorySetupController.swift
@@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import AccountContext
private final class GroupPreHistorySetupArguments {
let toggle: (Bool) -> Void
@@ -113,7 +114,7 @@ private func groupPreHistorySetupEntries(isSupergroup: Bool, presentationData: P
return entries
}
-public func groupPreHistorySetupController(context: AccountContextImpl, peerId: PeerId, upgradedToSupergroup: @escaping (PeerId, @escaping () -> Void) -> Void) -> ViewController {
+public func groupPreHistorySetupController(context: AccountContext, peerId: PeerId, upgradedToSupergroup: @escaping (PeerId, @escaping () -> Void) -> Void) -> ViewController {
let statePromise = ValuePromise(GroupPreHistorySetupState(), ignoreRepeated: true)
let stateValue = Atomic(value: GroupPreHistorySetupState())
let updateState: ((GroupPreHistorySetupState) -> GroupPreHistorySetupState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/GroupStickerPackSetupController.swift b/submodules/TelegramUI/TelegramUI/GroupStickerPackSetupController.swift
index 8d245b9dc2..58bbbdaaf1 100644
--- a/submodules/TelegramUI/TelegramUI/GroupStickerPackSetupController.swift
+++ b/submodules/TelegramUI/TelegramUI/GroupStickerPackSetupController.swift
@@ -7,6 +7,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AccountContext
private final class GroupStickerPackSetupControllerArguments {
let account: Account
@@ -303,7 +304,7 @@ private func groupStickerPackSetupControllerEntries(presentationData: Presentati
return entries
}
-public func groupStickerPackSetupController(context: AccountContextImpl, peerId: PeerId, currentPackInfo: StickerPackCollectionInfo?) -> ViewController {
+public func groupStickerPackSetupController(context: AccountContext, peerId: PeerId, currentPackInfo: StickerPackCollectionInfo?) -> ViewController {
let initialState = GroupStickerPackSetupControllerState(isSaving: false)
let statePromise = ValuePromise(initialState, ignoreRepeated: true)
diff --git a/submodules/TelegramUI/TelegramUI/GroupsInCommonController.swift b/submodules/TelegramUI/TelegramUI/GroupsInCommonController.swift
index af6a4d468d..1907d1f4e3 100644
--- a/submodules/TelegramUI/TelegramUI/GroupsInCommonController.swift
+++ b/submodules/TelegramUI/TelegramUI/GroupsInCommonController.swift
@@ -7,6 +7,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AccountContext
private final class GroupsInCommonControllerArguments {
let account: Account
@@ -25,24 +26,6 @@ private enum GroupsInCommonSection: Int32 {
private enum GroupsInCommonEntryStableId: Hashable {
case peer(PeerId)
-
- var hashValue: Int {
- switch self {
- case let .peer(peerId):
- return peerId.hashValue
- }
- }
-
- static func ==(lhs: GroupsInCommonEntryStableId, rhs: GroupsInCommonEntryStableId) -> Bool {
- switch lhs {
- case let .peer(peerId):
- if case .peer(peerId) = rhs {
- return true
- } else {
- return false
- }
- }
- }
}
private enum GroupsInCommonEntry: ItemListNodeEntry {
@@ -133,7 +116,7 @@ private func groupsInCommonControllerEntries(presentationData: PresentationData,
return entries
}
-public func groupsInCommonController(context: AccountContextImpl, peerId: PeerId) -> ViewController {
+public func groupsInCommonController(context: AccountContext, peerId: PeerId) -> ViewController {
let statePromise = ValuePromise(GroupsInCommonControllerState(), ignoreRepeated: true)
let stateValue = Atomic(value: GroupsInCommonControllerState())
let updateState: ((GroupsInCommonControllerState) -> GroupsInCommonControllerState) -> Void = { f in
diff --git a/submodules/TelegramUI/TelegramUI/HashtagChatInputContextPanelNode.swift b/submodules/TelegramUI/TelegramUI/HashtagChatInputContextPanelNode.swift
index 78f8825e46..bb0ac4cbaf 100644
--- a/submodules/TelegramUI/TelegramUI/HashtagChatInputContextPanelNode.swift
+++ b/submodules/TelegramUI/TelegramUI/HashtagChatInputContextPanelNode.swift
@@ -6,6 +6,8 @@ import TelegramCore
import Display
import TelegramPresentationData
import MergeLists
+import AccountContext
+import AccountContext
private struct HashtagChatInputContextPanelEntryStableId: Hashable {
let text: String
@@ -60,7 +62,7 @@ final class HashtagChatInputContextPanelNode: ChatInputContextPanelNode {
private var enqueuedTransitions: [(HashtagChatInputContextPanelTransition, Bool)] = []
private var validLayout: (CGSize, CGFloat, CGFloat)?
- override init(context: AccountContextImpl, theme: PresentationTheme, strings: PresentationStrings) {
+ override init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings) {
self.listView = ListView()
self.listView.isOpaque = false
self.listView.stackFromBottom = true
diff --git a/submodules/TelegramUI/TelegramUI/HashtagSearchController.swift b/submodules/TelegramUI/TelegramUI/HashtagSearchController.swift
index 58669c3b76..a47769403e 100644
--- a/submodules/TelegramUI/TelegramUI/HashtagSearchController.swift
+++ b/submodules/TelegramUI/TelegramUI/HashtagSearchController.swift
@@ -5,11 +5,13 @@ import TelegramCore
import Postbox
import SwiftSignalKit
import TelegramPresentationData
+import TelegramBaseController
+import AccountContext
-final class HashtagSearchController: TelegramController {
+final class HashtagSearchController: TelegramBaseController {
private let queue = Queue()
- private let context: AccountContextImpl
+ private let context: AccountContext
private let peer: Peer?
private let query: String
private var transitionDisposable: Disposable?
@@ -21,7 +23,7 @@ final class HashtagSearchController: TelegramController {
return self.displayNode as! HashtagSearchControllerNode
}
- init(context: AccountContextImpl, peer: Peer?, query: String) {
+ init(context: AccountContext, peer: Peer?, query: String) {
self.context = context
self.peer = peer
self.query = query
diff --git a/submodules/TelegramUI/TelegramUI/HashtagSearchControllerNode.swift b/submodules/TelegramUI/TelegramUI/HashtagSearchControllerNode.swift
index 03a2404d7e..2ff9dc7e45 100644
--- a/submodules/TelegramUI/TelegramUI/HashtagSearchControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/HashtagSearchControllerNode.swift
@@ -4,6 +4,7 @@ import AsyncDisplayKit
import Postbox
import TelegramCore
import TelegramPresentationData
+import AccountContext
final class HashtagSearchControllerNode: ASDisplayNode {
private let toolbarBackgroundNode: ASDisplayNode
@@ -13,7 +14,7 @@ final class HashtagSearchControllerNode: ASDisplayNode {
var chatController: ChatController?
- private let context: AccountContextImpl
+ private let context: AccountContext
private let query: String
private var containerLayout: (ContainerViewLayout, CGFloat)?
@@ -22,7 +23,7 @@ final class HashtagSearchControllerNode: ASDisplayNode {
var navigationBar: NavigationBar?
- init(context: AccountContextImpl, peer: Peer?, query: String, theme: PresentationTheme, strings: PresentationStrings) {
+ init(context: AccountContext, peer: Peer?, query: String, theme: PresentationTheme, strings: PresentationStrings) {
self.context = context
self.query = query
self.listNode = ListView()
diff --git a/submodules/TelegramUI/TelegramUI/HorizontalListContextResultsChatInputContextPanelNode.swift b/submodules/TelegramUI/TelegramUI/HorizontalListContextResultsChatInputContextPanelNode.swift
index f877c3dafa..caa47666e3 100644
--- a/submodules/TelegramUI/TelegramUI/HorizontalListContextResultsChatInputContextPanelNode.swift
+++ b/submodules/TelegramUI/TelegramUI/HorizontalListContextResultsChatInputContextPanelNode.swift
@@ -7,6 +7,7 @@ import Display
import SwiftSignalKit
import TelegramPresentationData
import MergeLists
+import AccountContext
private struct ChatContextResultStableId: Hashable {
let result: ChatContextResult
@@ -83,7 +84,7 @@ final class HorizontalListContextResultsChatInputContextPanelNode: ChatInputCont
private var enqueuedTransitions: [(HorizontalListContextResultsChatInputContextPanelTransition, Bool)] = []
private var hasValidLayout = false
- override init(context: AccountContextImpl, theme: PresentationTheme, strings: PresentationStrings) {
+ override init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings) {
self.strings = strings
self.separatorNode = ASDisplayNode()
diff --git a/submodules/TelegramUI/TelegramUI/HorizontalPeerItem.swift b/submodules/TelegramUI/TelegramUI/HorizontalPeerItem.swift
index 8b06486c62..a59d7fcb5b 100644
--- a/submodules/TelegramUI/TelegramUI/HorizontalPeerItem.swift
+++ b/submodules/TelegramUI/TelegramUI/HorizontalPeerItem.swift
@@ -6,6 +6,7 @@ import AsyncDisplayKit
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import TelegramStringFormatting
enum HorizontalPeerItemMode {
case list
diff --git a/submodules/TelegramUI/TelegramUI/HorizontalStickersChatContextPanelNode.swift b/submodules/TelegramUI/TelegramUI/HorizontalStickersChatContextPanelNode.swift
index 5cbb688673..eca241287f 100755
--- a/submodules/TelegramUI/TelegramUI/HorizontalStickersChatContextPanelNode.swift
+++ b/submodules/TelegramUI/TelegramUI/HorizontalStickersChatContextPanelNode.swift
@@ -7,6 +7,7 @@ import Display
import SwiftSignalKit
import TelegramPresentationData
import MergeLists
+import AccountContext
final class HorizontalStickersChatContextPanelInteraction {
var previewedStickerItem: StickerPackItem?
@@ -106,7 +107,7 @@ final class HorizontalStickersChatContextPanelNode: ChatInputContextPanelNode {
private var stickerPreviewController: StickerPreviewController?
- override init(context: AccountContextImpl, theme: PresentationTheme, strings: PresentationStrings) {
+ override init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings) {
self.strings = strings
self.backgroundNode = ASImageNode()
diff --git a/submodules/TelegramUI/TelegramUI/InChatPrefetchManager.swift b/submodules/TelegramUI/TelegramUI/InChatPrefetchManager.swift
index 616a793c93..d9c7e73b1d 100644
--- a/submodules/TelegramUI/TelegramUI/InChatPrefetchManager.swift
+++ b/submodules/TelegramUI/TelegramUI/InChatPrefetchManager.swift
@@ -3,7 +3,7 @@ import SwiftSignalKit
import Postbox
import TelegramCore
import TelegramUIPreferences
-import TelegramUIPreferences
+import AccountContext
private final class PrefetchMediaContext {
let fetchDisposable = MetaDisposable()
@@ -18,7 +18,7 @@ struct InChatPrefetchOptions: Equatable {
}
final class InChatPrefetchManager {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var settings: MediaAutoDownloadSettings
private var options: InChatPrefetchOptions?
@@ -27,7 +27,7 @@ final class InChatPrefetchManager {
private var contexts: [MediaId: PrefetchMediaContext] = [:]
- init(context: AccountContextImpl) {
+ init(context: AccountContext) {
self.context = context
self.settings = context.sharedContext.currentAutomaticMediaDownloadSettings.with { $0 }
}
diff --git a/submodules/TelegramUI/TelegramUI/InstalledStickerPacksController.swift b/submodules/TelegramUI/TelegramUI/InstalledStickerPacksController.swift
index 9f47e4bdf3..69ac4a5c2f 100644
--- a/submodules/TelegramUI/TelegramUI/InstalledStickerPacksController.swift
+++ b/submodules/TelegramUI/TelegramUI/InstalledStickerPacksController.swift
@@ -8,6 +8,7 @@ import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import TextFormat
+import AccountContext
private final class InstalledStickerPacksControllerArguments {
let account: Account
@@ -444,7 +445,7 @@ public enum InstalledStickerPacksControllerMode {
case masks
}
-public func installedStickerPacksController(context: AccountContextImpl, mode: InstalledStickerPacksControllerMode, archivedPacks: [ArchivedStickerPackItem]? = nil, updatedPacks: @escaping ([ArchivedStickerPackItem]?) -> Void = { _ in }, focusOnItemTag: InstalledStickerPacksEntryTag? = nil) -> ViewController {
+public func installedStickerPacksController(context: AccountContext, mode: InstalledStickerPacksControllerMode, archivedPacks: [ArchivedStickerPackItem]? = nil, updatedPacks: @escaping ([ArchivedStickerPackItem]?) -> Void = { _ in }, focusOnItemTag: InstalledStickerPacksEntryTag? = nil) -> ViewController {
let initialState = InstalledStickerPacksControllerState().withUpdatedEditing(mode == .modal)
let statePromise = ValuePromise(initialState, ignoreRepeated: true)
let stateValue = Atomic(value: initialState)
diff --git a/submodules/TelegramUI/TelegramUI/InstantImageGalleryItem.swift b/submodules/TelegramUI/TelegramUI/InstantImageGalleryItem.swift
index 72b1195e51..a39453aa27 100644
--- a/submodules/TelegramUI/TelegramUI/InstantImageGalleryItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantImageGalleryItem.swift
@@ -6,6 +6,7 @@ import SwiftSignalKit
import Postbox
import TelegramCore
import TelegramPresentationData
+import AccountContext
private struct InstantImageGalleryThumbnailItem: GalleryThumbnailItem {
let account: Account
@@ -31,7 +32,7 @@ private struct InstantImageGalleryThumbnailItem: GalleryThumbnailItem {
}
class InstantImageGalleryItem: GalleryItem {
- let context: AccountContextImpl
+ let context: AccountContext
let presentationData: PresentationData
let imageReference: ImageMediaReference
let caption: NSAttributedString
@@ -40,7 +41,7 @@ class InstantImageGalleryItem: GalleryItem {
let openUrl: (InstantPageUrlItem) -> Void
let openUrlOptions: (InstantPageUrlItem) -> Void
- init(context: AccountContextImpl, presentationData: PresentationData, imageReference: ImageMediaReference, caption: NSAttributedString, credit: NSAttributedString, location: InstantPageGalleryEntryLocation?, openUrl: @escaping (InstantPageUrlItem) -> Void, openUrlOptions: @escaping (InstantPageUrlItem) -> Void) {
+ init(context: AccountContext, presentationData: PresentationData, imageReference: ImageMediaReference, caption: NSAttributedString, credit: NSAttributedString, location: InstantPageGalleryEntryLocation?, openUrl: @escaping (InstantPageUrlItem) -> Void, openUrlOptions: @escaping (InstantPageUrlItem) -> Void) {
self.context = context
self.presentationData = presentationData
self.imageReference = imageReference
@@ -81,18 +82,18 @@ class InstantImageGalleryItem: GalleryItem {
}
final class InstantImageGalleryItemNode: ZoomableContentGalleryItemNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let imageNode: TransformImageNode
fileprivate let _ready = Promise()
fileprivate let _title = Promise()
private let footerContentNode: InstantPageGalleryFooterContentNode
- private var contextAndMedia: (AccountContextImpl, AnyMediaReference)?
+ private var contextAndMedia: (AccountContext, AnyMediaReference)?
private var fetchDisposable = MetaDisposable()
- init(context: AccountContextImpl, presentationData: PresentationData, openUrl: @escaping (InstantPageUrlItem) -> Void, openUrlOptions: @escaping (InstantPageUrlItem) -> Void) {
+ init(context: AccountContext, presentationData: PresentationData, openUrl: @escaping (InstantPageUrlItem) -> Void, openUrlOptions: @escaping (InstantPageUrlItem) -> Void) {
self.context = context
self.imageNode = TransformImageNode()
@@ -142,7 +143,7 @@ final class InstantImageGalleryItemNode: ZoomableContentGalleryItemNode {
self.footerContentNode.setShareMedia(imageReference.abstract)
}
- func setFile(context: AccountContextImpl, fileReference: FileMediaReference) {
+ func setFile(context: AccountContext, fileReference: FileMediaReference) {
if self.contextAndMedia == nil || !self.contextAndMedia!.1.media.isEqual(to: fileReference.media) {
if let largestSize = fileReference.media.dimensions {
let displaySize = largestSize.dividedByScreenScale()
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageAnchorItem.swift b/submodules/TelegramUI/TelegramUI/InstantPageAnchorItem.swift
index 8527391ca9..af563bbdfa 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageAnchorItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageAnchorItem.swift
@@ -4,6 +4,7 @@ import Postbox
import TelegramCore
import AsyncDisplayKit
import TelegramPresentationData
+import AccountContext
final class InstantPageAnchorItem: InstantPageItem {
let wantsNode: Bool = false
@@ -25,7 +26,7 @@ final class InstantPageAnchorItem: InstantPageItem {
func drawInTile(context: CGContext) {
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
return nil
}
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageArticleItem.swift b/submodules/TelegramUI/TelegramUI/InstantPageArticleItem.swift
index 407b14458a..20d4862668 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageArticleItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageArticleItem.swift
@@ -4,6 +4,7 @@ import Postbox
import TelegramCore
import AsyncDisplayKit
import TelegramPresentationData
+import AccountContext
final class InstantPageArticleItem: InstantPageItem {
var frame: CGRect
@@ -30,7 +31,7 @@ final class InstantPageArticleItem: InstantPageItem {
self.rtl = rtl
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
return InstantPageArticleNode(context: context, item: self, webPage: self.webPage, strings: strings, theme: theme, contentItems: self.contentItems, contentSize: self.contentSize, cover: self.cover, url: self.url, webpageId: self.webpageId, rtl: self.rtl, openUrl: openUrl)
}
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageArticleNode.swift b/submodules/TelegramUI/TelegramUI/InstantPageArticleNode.swift
index a0c17cf1db..9b0126ddc5 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageArticleNode.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageArticleNode.swift
@@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
final class InstantPageArticleNode: ASDisplayNode, InstantPageNode {
let item: InstantPageArticleItem
@@ -26,7 +27,7 @@ final class InstantPageArticleNode: ASDisplayNode, InstantPageNode {
private var fetchedDisposable = MetaDisposable()
- init(context: AccountContextImpl, item: InstantPageArticleItem, webPage: TelegramMediaWebpage, strings: PresentationStrings, theme: InstantPageTheme, contentItems: [InstantPageItem], contentSize: CGSize, cover: TelegramMediaImage?, url: String, webpageId: MediaId, rtl: Bool, openUrl: @escaping (InstantPageUrlItem) -> Void) {
+ init(context: AccountContext, item: InstantPageArticleItem, webPage: TelegramMediaWebpage, strings: PresentationStrings, theme: InstantPageTheme, contentItems: [InstantPageItem], contentSize: CGSize, cover: TelegramMediaImage?, url: String, webpageId: MediaId, rtl: Bool, openUrl: @escaping (InstantPageUrlItem) -> Void) {
self.item = item
self.url = url
self.webpageId = webpageId
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageAudioItem.swift b/submodules/TelegramUI/TelegramUI/InstantPageAudioItem.swift
index 852a16bcc3..64bcb67aee 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageAudioItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageAudioItem.swift
@@ -4,6 +4,7 @@ import Postbox
import TelegramCore
import AsyncDisplayKit
import TelegramPresentationData
+import AccountContext
final class InstantPageAudioItem: InstantPageItem {
var frame: CGRect
@@ -21,7 +22,7 @@ final class InstantPageAudioItem: InstantPageItem {
self.medias = [media]
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
return InstantPageAudioNode(context: context, strings: strings, theme: theme, webPage: self.webpage, media: self.media, openMedia: openMedia)
}
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageAudioNode.swift b/submodules/TelegramUI/TelegramUI/InstantPageAudioNode.swift
index 861031357a..a529218f55 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageAudioNode.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageAudioNode.swift
@@ -7,6 +7,7 @@ import AsyncDisplayKit
import Display
import TelegramPresentationData
import UniversalMediaPlayer
+import AccountContext
private func generatePlayButton(color: UIColor) -> UIImage? {
return generateImage(CGSize(width: 48.0, height: 48.0), rotatedContext: { size, context in
@@ -54,7 +55,7 @@ private func titleString(media: InstantPageMedia, theme: InstantPageTheme) -> NS
}
final class InstantPageAudioNode: ASDisplayNode, InstantPageNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
let media: InstantPageMedia
private let openMedia: (InstantPageMedia) -> Void
private var strings: PresentationStrings
@@ -75,7 +76,7 @@ final class InstantPageAudioNode: ASDisplayNode, InstantPageNode {
private var isPlaying: Bool = false
private var playbackState: SharedMediaPlayerItemPlaybackState?
- init(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, webPage: TelegramMediaWebpage, media: InstantPageMedia, openMedia: @escaping (InstantPageMedia) -> Void) {
+ init(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, webPage: TelegramMediaWebpage, media: InstantPageMedia, openMedia: @escaping (InstantPageMedia) -> Void) {
self.context = context
self.strings = strings
self.theme = theme
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageContentNode.swift b/submodules/TelegramUI/TelegramUI/InstantPageContentNode.swift
index 9e215c7483..234d8e714b 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageContentNode.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageContentNode.swift
@@ -6,9 +6,10 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
final class InstantPageContentNode : ASDisplayNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let strings: PresentationStrings
private let theme: InstantPageTheme
@@ -36,7 +37,7 @@ final class InstantPageContentNode : ASDisplayNode {
private var previousVisibleBounds: CGRect?
- init(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, items: [InstantPageItem], contentSize: CGSize, inOverlayPanel: Bool = false, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void) {
+ init(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, items: [InstantPageItem], contentSize: CGSize, inOverlayPanel: Bool = false, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void) {
self.context = context
self.strings = strings
self.theme = theme
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageController.swift b/submodules/TelegramUI/TelegramUI/InstantPageController.swift
index aae509e3d4..caa5b127e9 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageController.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageController.swift
@@ -6,9 +6,10 @@ import SwiftSignalKit
import Display
import TelegramPresentationData
import TelegramUIPreferences
+import AccountContext
final class InstantPageController: ViewController {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var webPage: TelegramMediaWebpage
private let sourcePeerType: MediaAutoDownloadPeerType
private let anchor: String?
@@ -31,7 +32,7 @@ final class InstantPageController: ViewController {
private var settingsDisposable: Disposable?
private var themeSettings: PresentationThemeSettings?
- init(context: AccountContextImpl, webPage: TelegramMediaWebpage, sourcePeerType: MediaAutoDownloadPeerType, anchor: String? = nil) {
+ init(context: AccountContext, webPage: TelegramMediaWebpage, sourcePeerType: MediaAutoDownloadPeerType, anchor: String? = nil) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageControllerNode.swift b/submodules/TelegramUI/TelegramUI/InstantPageControllerNode.swift
index befd12e5e0..e187377103 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageControllerNode.swift
@@ -8,9 +8,10 @@ import Display
import SafariServices
import TelegramPresentationData
import TelegramUIPreferences
+import AccountContext
final class InstantPageControllerNode: ASDisplayNode, UIScrollViewDelegate {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var settings: InstantPagePresentationSettings?
private var themeSettings: PresentationThemeSettings?
private var presentationTheme: PresentationTheme
@@ -80,7 +81,7 @@ final class InstantPageControllerNode: ASDisplayNode, UIScrollViewDelegate {
return InstantPageStoredState(contentOffset: Double(self.scrollNode.view.contentOffset.y), details: details)
}
- init(context: AccountContextImpl, settings: InstantPagePresentationSettings?, themeSettings: PresentationThemeSettings?, presentationTheme: PresentationTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, statusBar: StatusBar, sourcePeerType: MediaAutoDownloadPeerType, getNavigationController: @escaping () -> NavigationController?, present: @escaping (ViewController, Any?) -> Void, pushController: @escaping (ViewController) -> Void, openPeer: @escaping (PeerId) -> Void, navigateBack: @escaping () -> Void) {
+ init(context: AccountContext, settings: InstantPagePresentationSettings?, themeSettings: PresentationThemeSettings?, presentationTheme: PresentationTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, statusBar: StatusBar, sourcePeerType: MediaAutoDownloadPeerType, getNavigationController: @escaping () -> NavigationController?, present: @escaping (ViewController, Any?) -> Void, pushController: @escaping (ViewController) -> Void, openPeer: @escaping (PeerId) -> Void, navigateBack: @escaping () -> Void) {
self.context = context
self.presentationTheme = presentationTheme
self.dateTimeFormat = dateTimeFormat
@@ -1268,7 +1269,7 @@ final class InstantPageControllerNode: ASDisplayNode, UIScrollViewDelegate {
}
}
}
- self.context.sharedContext.mediaManager.setPlaylist((self.context.account, InstantPageMediaPlaylist(webPage: webPage, items: medias, initialItemIndex: initialIndex)), type: file.isVoice ? .voice : .music)
+ self.context.sharedContext.mediaManager.setPlaylist((self.context.account, InstantPageMediaPlaylist(webPage: webPage, items: medias, initialItemIndex: initialIndex)), type: file.isVoice ? .voice : .music, control: .playback(.play))
return
}
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageDetailsItem.swift b/submodules/TelegramUI/TelegramUI/InstantPageDetailsItem.swift
index 02503ba2f3..e35851ee9b 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageDetailsItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageDetailsItem.swift
@@ -5,6 +5,7 @@ import TelegramCore
import AsyncDisplayKit
import Display
import TelegramPresentationData
+import AccountContext
final class InstantPageDetailsItem: InstantPageItem {
var frame: CGRect
@@ -31,7 +32,7 @@ final class InstantPageDetailsItem: InstantPageItem {
self.index = index
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
var expanded: Bool?
if let expandedDetails = currentExpandedDetails, let currentlyExpanded = expandedDetails[self.index] {
expanded = currentlyExpanded
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageDetailsNode.swift b/submodules/TelegramUI/TelegramUI/InstantPageDetailsNode.swift
index fd6d414d7b..41703f4ae7 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageDetailsNode.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageDetailsNode.swift
@@ -6,12 +6,13 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
private let detailsInset: CGFloat = 17.0
private let titleInset: CGFloat = 22.0
final class InstantPageDetailsNode: ASDisplayNode, InstantPageNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let strings: PresentationStrings
private let theme: InstantPageTheme
let item: InstantPageDetailsItem
@@ -32,7 +33,7 @@ final class InstantPageDetailsNode: ASDisplayNode, InstantPageNode {
var requestLayoutUpdate: ((Bool) -> Void)?
- init(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, item: InstantPageDetailsItem, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, currentlyExpanded: Bool?, updateDetailsExpanded: @escaping (Bool) -> Void) {
+ init(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, item: InstantPageDetailsItem, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, currentlyExpanded: Bool?, updateDetailsExpanded: @escaping (Bool) -> Void) {
self.context = context
self.strings = strings
self.theme = theme
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageFeedbackItem.swift b/submodules/TelegramUI/TelegramUI/InstantPageFeedbackItem.swift
index fe25996829..d87a30f89e 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageFeedbackItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageFeedbackItem.swift
@@ -4,6 +4,7 @@ import Postbox
import TelegramCore
import AsyncDisplayKit
import TelegramPresentationData
+import AccountContext
final class InstantPageFeedbackItem: InstantPageItem {
var frame: CGRect
@@ -18,7 +19,7 @@ final class InstantPageFeedbackItem: InstantPageItem {
self.webPage = webPage
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
return InstantPageFeedbackNode(context: context, strings: strings, theme: theme, webPage: self.webPage, openUrl: openUrl)
}
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageFeedbackNode.swift b/submodules/TelegramUI/TelegramUI/InstantPageFeedbackNode.swift
index 46fa08056d..9805d1847b 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageFeedbackNode.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageFeedbackNode.swift
@@ -6,9 +6,10 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
final class InstantPageFeedbackNode: ASDisplayNode, InstantPageNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let webPage: TelegramMediaWebpage
private let openUrl: (InstantPageUrlItem) -> Void
@@ -18,7 +19,7 @@ final class InstantPageFeedbackNode: ASDisplayNode, InstantPageNode {
private let resolveDisposable = MetaDisposable()
- init(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, webPage: TelegramMediaWebpage, openUrl: @escaping (InstantPageUrlItem) -> Void) {
+ init(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, webPage: TelegramMediaWebpage, openUrl: @escaping (InstantPageUrlItem) -> Void) {
self.context = context
self.webPage = webPage
self.openUrl = openUrl
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageGalleryController.swift b/submodules/TelegramUI/TelegramUI/InstantPageGalleryController.swift
index f985e8b8ab..4e153fac20 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageGalleryController.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageGalleryController.swift
@@ -8,6 +8,7 @@ import AsyncDisplayKit
import TelegramCore
import SafariServices
import TelegramPresentationData
+import AccountContext
struct InstantPageGalleryEntryLocation: Equatable {
let position: Int32
@@ -30,7 +31,7 @@ struct InstantPageGalleryEntry: Equatable {
return lhs.index == rhs.index && lhs.pageId == rhs.pageId && lhs.media == rhs.media && lhs.caption == rhs.caption && lhs.credit == rhs.credit && lhs.location == rhs.location
}
- func item(context: AccountContextImpl, webPage: TelegramMediaWebpage, message: Message?, presentationData: PresentationData, fromPlayingVideo: Bool, landscape: Bool, openUrl: @escaping (InstantPageUrlItem) -> Void, openUrlOptions: @escaping (InstantPageUrlItem) -> Void) -> GalleryItem {
+ func item(context: AccountContext, webPage: TelegramMediaWebpage, message: Message?, presentationData: PresentationData, fromPlayingVideo: Bool, landscape: Bool, openUrl: @escaping (InstantPageUrlItem) -> Void, openUrlOptions: @escaping (InstantPageUrlItem) -> Void) -> GalleryItem {
let caption: NSAttributedString
let credit: NSAttributedString
@@ -129,7 +130,7 @@ class InstantPageGalleryController: ViewController {
return self.displayNode as! GalleryControllerNode
}
- private let context: AccountContextImpl
+ private let context: AccountContext
private let webPage: TelegramMediaWebpage
private let message: Message?
private var presentationData: PresentationData
@@ -166,7 +167,7 @@ class InstantPageGalleryController: ViewController {
private var innerOpenUrl: (InstantPageUrlItem) -> Void
private var openUrlOptions: (InstantPageUrlItem) -> Void
- init(context: AccountContextImpl, webPage: TelegramMediaWebpage, message: Message? = nil, entries: [InstantPageGalleryEntry], centralIndex: Int, fromPlayingVideo: Bool = false, landscape: Bool = false, timecode: Double? = nil, replaceRootController: @escaping (ViewController, ValuePromise?) -> Void, baseNavigationController: NavigationController?) {
+ init(context: AccountContext, webPage: TelegramMediaWebpage, message: Message? = nil, entries: [InstantPageGalleryEntry], centralIndex: Int, fromPlayingVideo: Bool = false, landscape: Bool = false, timecode: Double? = nil, replaceRootController: @escaping (ViewController, ValuePromise?) -> Void, baseNavigationController: NavigationController?) {
self.context = context
self.webPage = webPage
self.message = message
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageGalleryFooterContentNode.swift b/submodules/TelegramUI/TelegramUI/InstantPageGalleryFooterContentNode.swift
index f91f7f9359..08da327d59 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageGalleryFooterContentNode.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageGalleryFooterContentNode.swift
@@ -8,13 +8,14 @@ import SwiftSignalKit
import Photos
import TelegramPresentationData
import TextFormat
+import AccountContext
private let actionImage = generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Accessory Panels/MessageSelectionAction"), color: .white)
private let textFont = Font.regular(16.0)
final class InstantPageGalleryFooterContentNode: GalleryFooterContentNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var theme: PresentationTheme
private var strings: PresentationStrings
private var shareMedia: AnyMediaReference?
@@ -27,7 +28,7 @@ final class InstantPageGalleryFooterContentNode: GalleryFooterContentNode {
var openUrl: ((InstantPageUrlItem) -> Void)?
var openUrlOptions: ((InstantPageUrlItem) -> Void)?
- init(context: AccountContextImpl, presentationData: PresentationData) {
+ init(context: AccountContext, presentationData: PresentationData) {
self.context = context
self.theme = presentationData.theme
self.strings = presentationData.strings
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageImageItem.swift b/submodules/TelegramUI/TelegramUI/InstantPageImageItem.swift
index e113f60084..5d4f37303e 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageImageItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageImageItem.swift
@@ -4,6 +4,7 @@ import Postbox
import TelegramCore
import AsyncDisplayKit
import TelegramPresentationData
+import AccountContext
protocol InstantPageImageAttribute {
}
@@ -42,7 +43,7 @@ final class InstantPageImageItem: InstantPageItem {
self.fit = fit
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
return InstantPageImageNode(context: context, theme: theme, webPage: self.webPage, media: self.media, attributes: self.attributes, interactive: self.interactive, roundCorners: self.roundCorners, fit: self.fit, openMedia: openMedia, longPressMedia: longPressMedia)
}
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageImageNode.swift b/submodules/TelegramUI/TelegramUI/InstantPageImageNode.swift
index 180a4944a4..bc182217da 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageImageNode.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageImageNode.swift
@@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
private struct FetchControls {
let fetch: (Bool) -> Void
@@ -13,7 +14,7 @@ private struct FetchControls {
}
final class InstantPageImageNode: ASDisplayNode, InstantPageNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let webPage: TelegramMediaWebpage
private var theme: InstantPageTheme
let media: InstantPageMedia
@@ -39,7 +40,7 @@ final class InstantPageImageNode: ASDisplayNode, InstantPageNode {
private var themeUpdated: Bool = false
- init(context: AccountContextImpl, theme: InstantPageTheme, webPage: TelegramMediaWebpage, media: InstantPageMedia, attributes: [InstantPageImageAttribute], interactive: Bool, roundCorners: Bool, fit: Bool, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void) {
+ init(context: AccountContext, theme: InstantPageTheme, webPage: TelegramMediaWebpage, media: InstantPageMedia, attributes: [InstantPageImageAttribute], interactive: Bool, roundCorners: Bool, fit: Bool, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void) {
self.context = context
self.theme = theme
self.webPage = webPage
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageItem.swift b/submodules/TelegramUI/TelegramUI/InstantPageItem.swift
index f0c8fb4ad9..c60a5e39c5 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageItem.swift
@@ -4,6 +4,7 @@ import Postbox
import TelegramCore
import AsyncDisplayKit
import TelegramPresentationData
+import AccountContext
protocol InstantPageItem {
var frame: CGRect { get set }
@@ -13,7 +14,7 @@ protocol InstantPageItem {
func matchesAnchor(_ anchor: String) -> Bool
func drawInTile(context: CGContext)
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)?
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)?
func matchesNode(_ node: InstantPageNode) -> Bool
func linkSelectionRects(at point: CGPoint) -> [CGRect]
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageLayout.swift b/submodules/TelegramUI/TelegramUI/InstantPageLayout.swift
index 7df78329d1..02e5f542ef 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageLayout.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageLayout.swift
@@ -5,6 +5,7 @@ import Postbox
import Display
import TelegramPresentationData
import TelegramUIPreferences
+import TelegramStringFormatting
final class InstantPageLayout {
let origin: CGPoint
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageMediaPlaylist.swift b/submodules/TelegramUI/TelegramUI/InstantPageMediaPlaylist.swift
index 2aa3926791..c96a674d9c 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageMediaPlaylist.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageMediaPlaylist.swift
@@ -4,6 +4,7 @@ import SwiftSignalKit
import Postbox
import TelegramCore
import TelegramUIPreferences
+import AccountContext
struct InstantPageMediaPlaylistItemId: SharedMediaPlaylistItemId {
let index: Int
diff --git a/submodules/TelegramUI/TelegramUI/InstantPagePeerReferenceItem.swift b/submodules/TelegramUI/TelegramUI/InstantPagePeerReferenceItem.swift
index 6b89efa3d2..06b321ded9 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPagePeerReferenceItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPagePeerReferenceItem.swift
@@ -4,6 +4,7 @@ import Postbox
import TelegramCore
import AsyncDisplayKit
import TelegramPresentationData
+import AccountContext
final class InstantPagePeerReferenceItem: InstantPageItem {
var frame: CGRect
@@ -24,7 +25,7 @@ final class InstantPagePeerReferenceItem: InstantPageItem {
self.rtl = rtl
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
return InstantPagePeerReferenceNode(context: context, strings: strings, theme: theme, initialPeer: self.initialPeer, safeInset: self.safeInset, transparent: self.transparent, rtl: self.rtl, openPeer: openPeer)
}
diff --git a/submodules/TelegramUI/TelegramUI/InstantPagePeerReferenceNode.swift b/submodules/TelegramUI/TelegramUI/InstantPagePeerReferenceNode.swift
index 324610758d..ac1cb8cf7f 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPagePeerReferenceNode.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPagePeerReferenceNode.swift
@@ -7,6 +7,7 @@ import AsyncDisplayKit
import Display
import TelegramPresentationData
import ActivityIndicator
+import AccountContext
private enum JoinState: Equatable {
case none
@@ -45,7 +46,7 @@ private enum JoinState: Equatable {
}
final class InstantPagePeerReferenceNode: ASDisplayNode, InstantPageNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
let safeInset: CGFloat
private let transparent: Bool
private let rtl: Bool
@@ -66,7 +67,7 @@ final class InstantPagePeerReferenceNode: ASDisplayNode, InstantPageNode {
private let joinDisposable = MetaDisposable()
private var joinState: JoinState = .none
- init(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, initialPeer: Peer, safeInset: CGFloat, transparent: Bool, rtl: Bool, openPeer: @escaping (PeerId) -> Void) {
+ init(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, initialPeer: Peer, safeInset: CGFloat, transparent: Bool, rtl: Bool, openPeer: @escaping (PeerId) -> Void) {
self.context = context
self.strings = strings
self.theme = theme
diff --git a/submodules/TelegramUI/TelegramUI/InstantPagePlayableVideoItem.swift b/submodules/TelegramUI/TelegramUI/InstantPagePlayableVideoItem.swift
index 61ba4234ca..1f161067e3 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPagePlayableVideoItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPagePlayableVideoItem.swift
@@ -4,6 +4,7 @@ import Postbox
import TelegramCore
import AsyncDisplayKit
import TelegramPresentationData
+import AccountContext
final class InstantPagePlayableVideoItem: InstantPageItem {
var frame: CGRect
@@ -26,7 +27,7 @@ final class InstantPagePlayableVideoItem: InstantPageItem {
self.interactive = interactive
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
return InstantPagePlayableVideoNode(context: context, webPage: self.webPage, theme: theme, media: self.media, interactive: self.interactive, openMedia: openMedia)
}
diff --git a/submodules/TelegramUI/TelegramUI/InstantPagePlayableVideoNode.swift b/submodules/TelegramUI/TelegramUI/InstantPagePlayableVideoNode.swift
index 8b156133f0..36185ee686 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPagePlayableVideoNode.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPagePlayableVideoNode.swift
@@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
private struct FetchControls {
let fetch: (Bool) -> Void
@@ -13,7 +14,7 @@ private struct FetchControls {
}
final class InstantPagePlayableVideoNode: ASDisplayNode, InstantPageNode {
- private let context: AccountContextImpl
+ private let context: AccountContext
let media: InstantPageMedia
private let interactive: Bool
private let openMedia: (InstantPageMedia) -> Void
@@ -30,7 +31,7 @@ final class InstantPagePlayableVideoNode: ASDisplayNode, InstantPageNode {
private var localIsVisible = false
- init(context: AccountContextImpl, webPage: TelegramMediaWebpage, theme: InstantPageTheme, media: InstantPageMedia, interactive: Bool, openMedia: @escaping (InstantPageMedia) -> Void) {
+ init(context: AccountContext, webPage: TelegramMediaWebpage, theme: InstantPageTheme, media: InstantPageMedia, interactive: Bool, openMedia: @escaping (InstantPageMedia) -> Void) {
self.context = context
self.media = media
self.interactive = interactive
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageReferenceController.swift b/submodules/TelegramUI/TelegramUI/InstantPageReferenceController.swift
index 7cf5480fde..2f89939908 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageReferenceController.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageReferenceController.swift
@@ -5,6 +5,7 @@ import AsyncDisplayKit
import Postbox
import TelegramCore
import SwiftSignalKit
+import AccountContext
final class InstantPageReferenceController: ViewController {
private var controllerNode: InstantPageReferenceControllerNode {
@@ -13,7 +14,7 @@ final class InstantPageReferenceController: ViewController {
private var animatedIn = false
- private let context: AccountContextImpl
+ private let context: AccountContext
private let theme: InstantPageTheme
private let webPage: TelegramMediaWebpage
private let anchorText: NSAttributedString
@@ -21,7 +22,7 @@ final class InstantPageReferenceController: ViewController {
private let openUrlIn: (InstantPageUrlItem) -> Void
private let present: (ViewController, Any?) -> Void
- init(context: AccountContextImpl, theme: InstantPageTheme, webPage: TelegramMediaWebpage, anchorText: NSAttributedString, openUrl: @escaping (InstantPageUrlItem) -> Void, openUrlIn: @escaping (InstantPageUrlItem) -> Void, present: @escaping (ViewController, Any?) -> Void) {
+ init(context: AccountContext, theme: InstantPageTheme, webPage: TelegramMediaWebpage, anchorText: NSAttributedString, openUrl: @escaping (InstantPageUrlItem) -> Void, openUrlIn: @escaping (InstantPageUrlItem) -> Void, present: @escaping (ViewController, Any?) -> Void) {
self.context = context
self.theme = theme
self.webPage = webPage
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageReferenceControllerNode.swift b/submodules/TelegramUI/TelegramUI/InstantPageReferenceControllerNode.swift
index 53b3c63dc4..de9f2d38f8 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageReferenceControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageReferenceControllerNode.swift
@@ -6,9 +6,10 @@ import Postbox
import TelegramCore
import SafariServices
import TelegramPresentationData
+import AccountContext
class InstantPageReferenceControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let theme: InstantPageTheme
private var presentationData: PresentationData
private let webPage: TelegramMediaWebpage
@@ -34,7 +35,7 @@ class InstantPageReferenceControllerNode: ViewControllerTracingNode, UIScrollVie
var dismiss: (() -> Void)?
var close: (() -> Void)?
- init(context: AccountContextImpl, theme: InstantPageTheme, webPage: TelegramMediaWebpage, anchorText: NSAttributedString, openUrl: @escaping (InstantPageUrlItem) -> Void, openUrlIn: @escaping (InstantPageUrlItem) -> Void, present: @escaping (ViewController, Any?) -> Void) {
+ init(context: AccountContext, theme: InstantPageTheme, webPage: TelegramMediaWebpage, anchorText: NSAttributedString, openUrl: @escaping (InstantPageUrlItem) -> Void, openUrlIn: @escaping (InstantPageUrlItem) -> Void, present: @escaping (ViewController, Any?) -> Void) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
self.theme = theme
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageShapeItem.swift b/submodules/TelegramUI/TelegramUI/InstantPageShapeItem.swift
index f23715b788..ce1103843d 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageShapeItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageShapeItem.swift
@@ -4,6 +4,7 @@ import Postbox
import TelegramCore
import AsyncDisplayKit
import TelegramPresentationData
+import AccountContext
enum InstantPageShape {
case rect
@@ -59,7 +60,7 @@ final class InstantPageShapeItem: InstantPageItem {
return false
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
return nil
}
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageSlideshowItem.swift b/submodules/TelegramUI/TelegramUI/InstantPageSlideshowItem.swift
index 85de36b564..0f213e172f 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageSlideshowItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageSlideshowItem.swift
@@ -4,6 +4,7 @@ import Postbox
import TelegramCore
import AsyncDisplayKit
import TelegramPresentationData
+import AccountContext
final class InstantPageSlideshowItem: InstantPageItem {
var frame: CGRect
@@ -18,7 +19,7 @@ final class InstantPageSlideshowItem: InstantPageItem {
self.medias = medias
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
return InstantPageSlideshowNode(context: context, theme: theme, webPage: webPage, medias: self.medias, openMedia: openMedia, longPressMedia: longPressMedia)
}
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageSlideshowItemNode.swift b/submodules/TelegramUI/TelegramUI/InstantPageSlideshowItemNode.swift
index 79f511b4fd..2f5b06eb1d 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageSlideshowItemNode.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageSlideshowItemNode.swift
@@ -4,6 +4,7 @@ import TelegramCore
import AsyncDisplayKit
import Display
import TelegramPresentationData
+import AccountContext
private final class InstantPageSlideshowItemNode: ASDisplayNode {
private var _index: Int?
@@ -61,7 +62,7 @@ private final class InstantPageSlideshowItemNode: ASDisplayNode {
}
private final class InstantPageSlideshowPagerNode: ASDisplayNode, UIScrollViewDelegate {
- private let context: AccountContextImpl
+ private let context: AccountContext
private let theme: InstantPageTheme
private let webPage: TelegramMediaWebpage
private let openMedia: (InstantPageMedia) -> Void
@@ -95,7 +96,7 @@ private final class InstantPageSlideshowPagerNode: ASDisplayNode, UIScrollViewDe
}
}
- init(context: AccountContextImpl, theme: InstantPageTheme, webPage: TelegramMediaWebpage, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, pageGap: CGFloat = 0.0) {
+ init(context: AccountContext, theme: InstantPageTheme, webPage: TelegramMediaWebpage, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, pageGap: CGFloat = 0.0) {
self.context = context
self.theme = theme
self.webPage = webPage
@@ -377,7 +378,7 @@ final class InstantPageSlideshowNode: ASDisplayNode, InstantPageNode {
private let pagerNode: InstantPageSlideshowPagerNode
private let pageControlNode: PageControlNode
- init(context: AccountContextImpl, theme: InstantPageTheme, webPage: TelegramMediaWebpage, medias: [InstantPageMedia], openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void) {
+ init(context: AccountContext, theme: InstantPageTheme, webPage: TelegramMediaWebpage, medias: [InstantPageMedia], openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void) {
self.medias = medias
self.pagerNode = InstantPageSlideshowPagerNode(context: context, theme: theme, webPage: webPage, openMedia: openMedia, longPressMedia: longPressMedia)
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageTableItem.swift b/submodules/TelegramUI/TelegramUI/InstantPageTableItem.swift
index 77c4b1e110..91f0642e52 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageTableItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageTableItem.swift
@@ -5,6 +5,7 @@ import TelegramCore
import Postbox
import Display
import TelegramPresentationData
+import AccountContext
private struct TableSide: OptionSet {
var rawValue: Int32 = 0
@@ -197,7 +198,7 @@ final class InstantPageTableItem: InstantPageScrollableItem {
return false
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
var additionalNodes: [InstantPageNode] = []
for cell in self.cells {
for item in cell.additionalItems {
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageTextItem.swift b/submodules/TelegramUI/TelegramUI/InstantPageTextItem.swift
index 9602f03928..6be99e4a96 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageTextItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageTextItem.swift
@@ -6,6 +6,7 @@ import Postbox
import AsyncDisplayKit
import TelegramPresentationData
import TextFormat
+import AccountContext
final class InstantPageUrlItem: Equatable {
let url: String
@@ -330,7 +331,7 @@ final class InstantPageTextItem: InstantPageItem {
return false
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
return nil
}
@@ -379,7 +380,7 @@ final class InstantPageScrollableTextItem: InstantPageScrollableItem {
context.restoreGState()
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (ASDisplayNode & InstantPageNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (ASDisplayNode & InstantPageNode)? {
var additionalNodes: [InstantPageNode] = []
for item in additionalItems {
if item.wantsNode {
diff --git a/submodules/TelegramUI/TelegramUI/InstantPageWebEmbedItem.swift b/submodules/TelegramUI/TelegramUI/InstantPageWebEmbedItem.swift
index c0e51dbcb9..d4eb63c8a2 100644
--- a/submodules/TelegramUI/TelegramUI/InstantPageWebEmbedItem.swift
+++ b/submodules/TelegramUI/TelegramUI/InstantPageWebEmbedItem.swift
@@ -4,6 +4,7 @@ import Postbox
import TelegramCore
import AsyncDisplayKit
import TelegramPresentationData
+import AccountContext
final class InstantPageWebEmbedItem: InstantPageItem {
var frame: CGRect
@@ -22,7 +23,7 @@ final class InstantPageWebEmbedItem: InstantPageItem {
self.enableScrolling = enableScrolling
}
- func node(context: AccountContextImpl, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
+ func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
return InstantPageWebEmbedNode(frame: self.frame, url: self.url, html: self.html, enableScrolling: self.enableScrolling, updateWebEmbedHeight: updateWebEmbedHeight)
}
diff --git a/submodules/TelegramUI/TelegramUI/InviteContactsController.swift b/submodules/TelegramUI/TelegramUI/InviteContactsController.swift
index c8e476c4e9..3c98c29bca 100644
--- a/submodules/TelegramUI/TelegramUI/InviteContactsController.swift
+++ b/submodules/TelegramUI/TelegramUI/InviteContactsController.swift
@@ -7,9 +7,10 @@ import SwiftSignalKit
import TelegramCore
import MessageUI
import TelegramPresentationData
+import AccountContext
public class InviteContactsController: ViewController, MFMessageComposeViewControllerDelegate, UINavigationControllerDelegate {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var contactsNode: InviteContactsControllerNode {
return self.displayNode as! InviteContactsControllerNode
@@ -27,7 +28,7 @@ public class InviteContactsController: ViewController, MFMessageComposeViewContr
private var searchContentNode: NavigationBarSearchContentNode?
- public init(context: AccountContextImpl) {
+ public init(context: AccountContext) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/InviteContactsControllerNode.swift b/submodules/TelegramUI/TelegramUI/InviteContactsControllerNode.swift
index ddce79f55e..1fec2d2e38 100644
--- a/submodules/TelegramUI/TelegramUI/InviteContactsControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/InviteContactsControllerNode.swift
@@ -9,6 +9,7 @@ import TelegramPresentationData
import TelegramUIPreferences
import MergeLists
import ActivityIndicator
+import AccountContext
private enum InviteContactsEntryId: Hashable {
case option(index: Int)
@@ -217,7 +218,7 @@ final class InviteContactsControllerNode: ASDisplayNode {
let listNode: ListView
private var activityIndicator: ActivityIndicator?
- private let context: AccountContextImpl
+ private let context: AccountContext
private var searchDisplayController: SearchDisplayController?
private var validLayout: (ContainerViewLayout, CGFloat, CGFloat)?
@@ -273,7 +274,7 @@ final class InviteContactsControllerNode: ASDisplayNode {
private let currentContactIds = Atomic<[String]>(value: [])
- init(context: AccountContextImpl) {
+ init(context: AccountContext) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/ItemListAvatarAndNameItem.swift b/submodules/TelegramUI/TelegramUI/ItemListAvatarAndNameItem.swift
index 898e94270e..3886ed1adb 100644
--- a/submodules/TelegramUI/TelegramUI/ItemListAvatarAndNameItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ItemListAvatarAndNameItem.swift
@@ -8,6 +8,8 @@ import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import ActivityIndicator
+import AvatarNode
+import TelegramStringFormatting
private let updatingAvatarOverlayImage = generateFilledCircleImage(diameter: 66.0, color: UIColor(white: 0.0, alpha: 0.4), backgroundColor: nil)
diff --git a/submodules/TelegramUI/TelegramUI/ItemListCallListItem.swift b/submodules/TelegramUI/TelegramUI/ItemListCallListItem.swift
index 53306c2f12..71f4ab6724 100644
--- a/submodules/TelegramUI/TelegramUI/ItemListCallListItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ItemListCallListItem.swift
@@ -7,6 +7,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import TelegramStringFormatting
class ItemListCallListItem: ListViewItem, ItemListItem {
let theme: PresentationTheme
diff --git a/submodules/TelegramUI/TelegramUI/ItemListPeerItem.swift b/submodules/TelegramUI/TelegramUI/ItemListPeerItem.swift
index fa9935dd02..029860019b 100644
--- a/submodules/TelegramUI/TelegramUI/ItemListPeerItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ItemListPeerItem.swift
@@ -8,6 +8,8 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AvatarNode
+import TelegramStringFormatting
struct ItemListPeerItemEditing: Equatable {
let editable: Bool
diff --git a/submodules/TelegramUI/TelegramUI/ItemListRecentSessionItem.swift b/submodules/TelegramUI/TelegramUI/ItemListRecentSessionItem.swift
index 1973d79f90..18bf9911a6 100644
--- a/submodules/TelegramUI/TelegramUI/ItemListRecentSessionItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ItemListRecentSessionItem.swift
@@ -7,6 +7,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
+import TelegramStringFormatting
struct ItemListRecentSessionItemEditing: Equatable {
let editable: Bool
diff --git a/submodules/TelegramUI/TelegramUI/ItemListWebsiteItem.swift b/submodules/TelegramUI/TelegramUI/ItemListWebsiteItem.swift
index 2f4c5cfa20..b89384eeb0 100644
--- a/submodules/TelegramUI/TelegramUI/ItemListWebsiteItem.swift
+++ b/submodules/TelegramUI/TelegramUI/ItemListWebsiteItem.swift
@@ -8,6 +8,8 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
+import AvatarNode
+import TelegramStringFormatting
struct ItemListWebsiteItemEditing: Equatable {
let editing: Bool
diff --git a/submodules/TelegramUI/TelegramUI/JoinLinkPreviewController.swift b/submodules/TelegramUI/TelegramUI/JoinLinkPreviewController.swift
index c5177d11a6..3de9facbbe 100644
--- a/submodules/TelegramUI/TelegramUI/JoinLinkPreviewController.swift
+++ b/submodules/TelegramUI/TelegramUI/JoinLinkPreviewController.swift
@@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
public final class JoinLinkPreviewController: ViewController {
private var controllerNode: JoinLinkPreviewControllerNode {
@@ -14,14 +15,14 @@ public final class JoinLinkPreviewController: ViewController {
private var animatedIn = false
- private let context: AccountContextImpl
+ private let context: AccountContext
private let link: String
private let navigateToPeer: (PeerId) -> Void
private var presentationData: PresentationData
private let disposable = MetaDisposable()
- public init(context: AccountContextImpl, link: String, navigateToPeer: @escaping (PeerId) -> Void) {
+ public init(context: AccountContext, link: String, navigateToPeer: @escaping (PeerId) -> Void) {
self.context = context
self.link = link
self.navigateToPeer = navigateToPeer
diff --git a/submodules/TelegramUI/TelegramUI/JoinLinkPreviewControllerNode.swift b/submodules/TelegramUI/TelegramUI/JoinLinkPreviewControllerNode.swift
index fccbfbff3c..5e3e93a66b 100644
--- a/submodules/TelegramUI/TelegramUI/JoinLinkPreviewControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/JoinLinkPreviewControllerNode.swift
@@ -6,6 +6,7 @@ import SwiftSignalKit
import Postbox
import TelegramCore
import TelegramPresentationData
+import AccountContext
struct JoinLinkPreviewData {
let isGroup: Bool
@@ -13,7 +14,7 @@ struct JoinLinkPreviewData {
}
final class JoinLinkPreviewControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var presentationData: PresentationData
private let requestLayout: (ContainedViewLayoutTransition) -> Void
@@ -48,7 +49,7 @@ final class JoinLinkPreviewControllerNode: ViewControllerTracingNode, UIScrollVi
private let disposable = MetaDisposable()
- init(context: AccountContextImpl, requestLayout: @escaping (ContainedViewLayoutTransition) -> Void) {
+ init(context: AccountContext, requestLayout: @escaping (ContainedViewLayoutTransition) -> Void) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/JoinLinkPreviewPeerContentNode.swift b/submodules/TelegramUI/TelegramUI/JoinLinkPreviewPeerContentNode.swift
index cb0fe62eba..0fac128fce 100644
--- a/submodules/TelegramUI/TelegramUI/JoinLinkPreviewPeerContentNode.swift
+++ b/submodules/TelegramUI/TelegramUI/JoinLinkPreviewPeerContentNode.swift
@@ -5,6 +5,8 @@ import Display
import Postbox
import TelegramCore
import TelegramPresentationData
+import AvatarNode
+import AccountContext
private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 26.0)!
@@ -34,7 +36,7 @@ final class JoinLinkPreviewPeerContentNode: ASDisplayNode, ShareContentContainer
private let peerNodes: [SelectablePeerNode]
private let moreNode: MoreNode?
- init(context: AccountContextImpl, image: TelegramMediaImageRepresentation?, title: String, memberCount: Int32, members: [Peer], isGroup: Bool, theme: PresentationTheme, strings: PresentationStrings) {
+ init(context: AccountContext, image: TelegramMediaImageRepresentation?, title: String, memberCount: Int32, members: [Peer], isGroup: Bool, theme: PresentationTheme, strings: PresentationStrings) {
self.avatarNode = AvatarNode(font: avatarFont)
self.titleNode = ASTextNode()
self.countNode = ASTextNode()
diff --git a/submodules/TelegramUI/TelegramUI/LanguageLinkPreviewContentNode.swift b/submodules/TelegramUI/TelegramUI/LanguageLinkPreviewContentNode.swift
index 78f5d8e6f7..9c10f9d082 100644
--- a/submodules/TelegramUI/TelegramUI/LanguageLinkPreviewContentNode.swift
+++ b/submodules/TelegramUI/TelegramUI/LanguageLinkPreviewContentNode.swift
@@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import TextFormat
+import AccountContext
final class LanguageLinkPreviewContentNode: ASDisplayNode, ShareContentContainerNode {
private var contentOffsetUpdated: ((CGFloat, ContainedViewLayoutTransition) -> Void)?
@@ -13,7 +14,7 @@ final class LanguageLinkPreviewContentNode: ASDisplayNode, ShareContentContainer
private let titleNode: ImmediateTextNode
private let textNode: ImmediateTextNode
- init(context: AccountContextImpl, localizationInfo: LocalizationInfo, theme: PresentationTheme, strings: PresentationStrings, openTranslationUrl: @escaping (String) -> Void) {
+ init(context: AccountContext, localizationInfo: LocalizationInfo, theme: PresentationTheme, strings: PresentationStrings, openTranslationUrl: @escaping (String) -> Void) {
self.titleNode = ImmediateTextNode()
self.titleNode.textAlignment = .center
diff --git a/submodules/TelegramUI/TelegramUI/LanguageLinkPreviewController.swift b/submodules/TelegramUI/TelegramUI/LanguageLinkPreviewController.swift
index 0e351b2253..38af1434a4 100644
--- a/submodules/TelegramUI/TelegramUI/LanguageLinkPreviewController.swift
+++ b/submodules/TelegramUI/TelegramUI/LanguageLinkPreviewController.swift
@@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
+import AccountContext
public final class LanguageLinkPreviewController: ViewController {
private var controllerNode: LanguageLinkPreviewControllerNode {
@@ -14,14 +15,14 @@ public final class LanguageLinkPreviewController: ViewController {
private var animatedIn = false
- private let context: AccountContextImpl
+ private let context: AccountContext
private let identifier: String
private var localizationInfo: LocalizationInfo?
private var presentationData: PresentationData
private let disposable = MetaDisposable()
- public init(context: AccountContextImpl, identifier: String) {
+ public init(context: AccountContext, identifier: String) {
self.context = context
self.identifier = identifier
diff --git a/submodules/TelegramUI/TelegramUI/LanguageLinkPreviewControllerNode.swift b/submodules/TelegramUI/TelegramUI/LanguageLinkPreviewControllerNode.swift
index 6b713fcb05..69acbe8383 100644
--- a/submodules/TelegramUI/TelegramUI/LanguageLinkPreviewControllerNode.swift
+++ b/submodules/TelegramUI/TelegramUI/LanguageLinkPreviewControllerNode.swift
@@ -7,9 +7,10 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ActivityIndicator
+import AccountContext
final class LanguageLinkPreviewControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
- private let context: AccountContextImpl
+ private let context: AccountContext
private var presentationData: PresentationData
private let requestLayout: (ContainedViewLayoutTransition) -> Void
@@ -46,7 +47,7 @@ final class LanguageLinkPreviewControllerNode: ViewControllerTracingNode, UIScro
private let disposable = MetaDisposable()
- init(context: AccountContextImpl, requestLayout: @escaping (ContainedViewLayoutTransition) -> Void, openUrl: @escaping (String) -> Void) {
+ init(context: AccountContext, requestLayout: @escaping (ContainedViewLayoutTransition) -> Void, openUrl: @escaping (String) -> Void) {
self.context = context
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
diff --git a/submodules/TelegramUI/TelegramUI/LanguageSuggestionController.swift b/submodules/TelegramUI/TelegramUI/LanguageSuggestionController.swift
index 62dc57cff7..e77eb77318 100644
--- a/submodules/TelegramUI/TelegramUI/LanguageSuggestionController.swift
+++ b/submodules/TelegramUI/TelegramUI/LanguageSuggestionController.swift
@@ -6,6 +6,7 @@ import Display
import TelegramCore
import TelegramPresentationData
import ActivityIndicator
+import AccountContext
struct LanguageSuggestionControllerStrings {
let ChooseLanguage: String
@@ -324,7 +325,7 @@ private final class LanguageSuggestionAlertContentNode: AlertContentNode {
}
}
-func languageSuggestionController(context: AccountContextImpl, suggestedLocalization: SuggestedLocalizationInfo, currentLanguageCode: String, openSelection: @escaping () -> Void) -> AlertController? {
+func languageSuggestionController(context: AccountContext, suggestedLocalization: SuggestedLocalizationInfo, currentLanguageCode: String, openSelection: @escaping () -> Void) -> AlertController? {
guard let localization = suggestedLocalization.availableLocalizations.filter({ $0.languageCode == suggestedLocalization.languageCode }).first else {
return nil
}
diff --git a/submodules/TelegramUI/TelegramUI/LegacyAttachmentMenu.swift b/submodules/TelegramUI/TelegramUI/LegacyAttachmentMenu.swift
index 8414003f7c..f8b4642a63 100644
--- a/submodules/TelegramUI/TelegramUI/LegacyAttachmentMenu.swift
+++ b/submodules/TelegramUI/TelegramUI/LegacyAttachmentMenu.swift
@@ -7,8 +7,9 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import DeviceAccess
+import AccountContext
-func legacyAttachmentMenu(context: AccountContextImpl, peer: Peer, editMediaOptions: MessageMediaEditingOptions?, saveEditedPhotos: Bool, allowGrouping: Bool, theme: PresentationTheme, strings: PresentationStrings, parentController: LegacyController, recentlyUsedInlineBots: [Peer], initialCaption: String, openGallery: @escaping () -> Void, openCamera: @escaping (TGAttachmentCameraView?, TGMenuSheetController?) -> Void, openFileGallery: @escaping () -> Void, openWebSearch: @escaping () -> Void, openMap: @escaping () -> Void, openContacts: @escaping () -> Void, openPoll: @escaping () -> Void, presentSelectionLimitExceeded: @escaping () -> Void, presentCantSendMultipleFiles: @escaping () -> Void, sendMessagesWithSignals: @escaping ([Any]?, Bool) -> Void, selectRecentlyUsedInlineBot: @escaping (Peer) -> Void) -> TGMenuSheetController {
+func legacyAttachmentMenu(context: AccountContext, peer: Peer, editMediaOptions: MessageMediaEditingOptions?, saveEditedPhotos: Bool, allowGrouping: Bool, theme: PresentationTheme, strings: PresentationStrings, parentController: LegacyController, recentlyUsedInlineBots: [Peer], initialCaption: String, openGallery: @escaping () -> Void, openCamera: @escaping (TGAttachmentCameraView?, TGMenuSheetController?) -> Void, openFileGallery: @escaping () -> Void, openWebSearch: @escaping () -> Void, openMap: @escaping () -> Void, openContacts: @escaping () -> Void, openPoll: @escaping () -> Void, presentSelectionLimitExceeded: @escaping () -> Void, presentCantSendMultipleFiles: @escaping () -> Void, sendMessagesWithSignals: @escaping ([Any]?, Bool) -> Void, selectRecentlyUsedInlineBot: @escaping (Peer) -> Void) -> TGMenuSheetController {
let isSecretChat = peer.id.namespace == Namespaces.Peer.SecretChat
let controller = TGMenuSheetController(context: parentController.context, dark: false)!
@@ -171,7 +172,7 @@ func legacyMenuPaletteFromTheme(_ theme: PresentationTheme) -> TGMenuSheetPallet
return TGMenuSheetPallete(dark: theme.overallDarkAppearance, backgroundColor: sheetTheme.opaqueItemBackgroundColor, selectionColor: sheetTheme.opaqueItemHighlightedBackgroundColor, separatorColor: sheetTheme.opaqueItemSeparatorColor, accentColor: sheetTheme.controlAccentColor, destructiveColor: sheetTheme.destructiveActionTextColor, textColor: sheetTheme.primaryTextColor, secondaryTextColor: sheetTheme.secondaryTextColor, spinnerColor: sheetTheme.secondaryTextColor, badgeTextColor: sheetTheme.controlAccentColor, badgeImage: nil, cornersImage: generateStretchableFilledCircleImage(diameter: 11.0, color: nil, strokeColor: nil, strokeWidth: nil, backgroundColor: sheetTheme.opaqueItemBackgroundColor))
}
-func presentLegacyPasteMenu(context: AccountContextImpl, peer: Peer, saveEditedPhotos: Bool, allowGrouping: Bool, theme: PresentationTheme, strings: PresentationStrings, images: [UIImage], sendMessagesWithSignals: @escaping ([Any]?) -> Void, present: (ViewController, Any?) -> Void, initialLayout: ContainerViewLayout? = nil) -> ViewController {
+func presentLegacyPasteMenu(context: AccountContext, peer: Peer, saveEditedPhotos: Bool, allowGrouping: Bool, theme: PresentationTheme, strings: PresentationStrings, images: [UIImage], sendMessagesWithSignals: @escaping ([Any]?) -> Void, present: (ViewController, Any?) -> Void, initialLayout: ContainerViewLayout? = nil) -> ViewController {
let legacyController = LegacyController(presentation: .custom, theme: theme, initialLayout: initialLayout)
legacyController.statusBar.statusBarStyle = .Ignore
legacyController.controllerLoaded = { [weak legacyController] in
diff --git a/submodules/TelegramUI/TelegramUI/LegacyCamera.swift b/submodules/TelegramUI/TelegramUI/LegacyCamera.swift
index af50abc977..8f37802de1 100644
--- a/submodules/TelegramUI/TelegramUI/LegacyCamera.swift
+++ b/submodules/TelegramUI/TelegramUI/LegacyCamera.swift
@@ -5,8 +5,9 @@ import Display
import TelegramCore
import Postbox
import SwiftSignalKit
+import AccountContext
-func presentedLegacyCamera(context: AccountContextImpl, peer: Peer, cameraView: TGAttachmentCameraView?, menuController: TGMenuSheetController?, parentController: ViewController, editingMedia: Bool, saveCapturedPhotos: Bool, mediaGrouping: Bool, initialCaption: String, sendMessagesWithSignals: @escaping ([Any]?) -> Void, recognizedQRCode: @escaping (String) -> Void = { _ in }) {
+func presentedLegacyCamera(context: AccountContext, peer: Peer, cameraView: TGAttachmentCameraView?, menuController: TGMenuSheetController?, parentController: ViewController, editingMedia: Bool, saveCapturedPhotos: Bool, mediaGrouping: Bool, initialCaption: String, sendMessagesWithSignals: @escaping ([Any]?) -> Void, recognizedQRCode: @escaping (String) -> Void = { _ in }) {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let legacyController = LegacyController(presentation: .custom, theme: presentationData.theme)
legacyController.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .portrait, compactSize: .portrait)
@@ -153,7 +154,7 @@ func presentedLegacyCamera(context: AccountContextImpl, peer: Peer, cameraView:
parentController.present(legacyController, in: .window(.root))
}
-func presentedLegacyShortcutCamera(context: AccountContextImpl, saveCapturedMedia: Bool, saveEditedPhotos: Bool, mediaGrouping: Bool, parentController: ViewController) {
+func presentedLegacyShortcutCamera(context: AccountContext, saveCapturedMedia: Bool, saveEditedPhotos: Bool, mediaGrouping: Bool, parentController: ViewController) {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let legacyController = LegacyController(presentation: .custom, theme: presentationData.theme)
legacyController.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .portrait, compactSize: .portrait)
diff --git a/submodules/TelegramUI/TelegramUI/LegacyInstantVideoController.swift b/submodules/TelegramUI/TelegramUI/LegacyInstantVideoController.swift
index 1ae295a704..e99adc036e 100644
--- a/submodules/TelegramUI/TelegramUI/LegacyInstantVideoController.swift
+++ b/submodules/TelegramUI/TelegramUI/LegacyInstantVideoController.swift
@@ -7,6 +7,7 @@ import SwiftSignalKit
import TelegramPresentationData
import MediaResources
import LegacyComponents
+import AccountContext
final class InstantVideoControllerRecordingStatus {
let micLevel: Signal