This commit is contained in:
Peter 2019-10-07 17:03:41 +04:00
parent fe5ccfac26
commit 5fed1fbeb1
257 changed files with 9346 additions and 4276 deletions

1
BUCK
View File

@ -43,6 +43,7 @@ resource_dependencies = [
"//submodules/LegacyComponents:LegacyComponentsResources",
"//submodules/TelegramUI:TelegramUIAssets",
"//submodules/TelegramUI:TelegramUIResources",
"//submodules/WalletUI:WalletUIResources",
"//:AppResources",
"//:AppStringResources",
"//:InfoPlistStringResources",

View File

@ -4756,23 +4756,23 @@ Any member of this group will be able to see messages in the channel.";
"ChatSearch.ResultsTooltip" = "Tap to view as a list.";
"Updated.JustNow" = "just now";
"Updated.MinutesAgo_0" = "%@ minutes ago"; //three to ten
"Updated.MinutesAgo_1" = "1 minute ago"; //one
"Updated.MinutesAgo_2" = "2 minutes ago"; //two
"Updated.MinutesAgo_3_10" = "%@ minutes ago"; //three to ten
"Updated.MinutesAgo_many" = "%@ minutes ago"; // more than ten
"Updated.MinutesAgo_any" = "%@ minutes ago"; // more than ten
"Updated.HoursAgo_0" = "%@ hours ago";
"Updated.HoursAgo_1" = "1 hour ago";
"Updated.HoursAgo_2" = "2 hours ago";
"Updated.HoursAgo_3_10" = "%@ hours ago";
"Updated.HoursAgo_any" = "%@ hours ago";
"Updated.HoursAgo_many" = "%@ hours ago";
"Updated.HoursAgo_0" = "%@ hours ago";
"Updated.YesterdayAt" = "yesterday at %@";
"Updated.AtDate" = "%@";
"Updated.TodayAt" = "today at %@";
"Wallet.Updated.JustNow" = "just now";
"Wallet.Updated.MinutesAgo_0" = "%@ minutes ago"; //three to ten
"Wallet.Updated.MinutesAgo_1" = "1 minute ago"; //one
"Wallet.Updated.MinutesAgo_2" = "2 minutes ago"; //two
"Wallet.Updated.MinutesAgo_3_10" = "%@ minutes ago"; //three to ten
"Wallet.Updated.MinutesAgo_many" = "%@ minutes ago"; // more than ten
"Wallet.Updated.MinutesAgo_any" = "%@ minutes ago"; // more than ten
"Wallet.Updated.HoursAgo_0" = "%@ hours ago";
"Wallet.Updated.HoursAgo_1" = "1 hour ago";
"Wallet.Updated.HoursAgo_2" = "2 hours ago";
"Wallet.Updated.HoursAgo_3_10" = "%@ hours ago";
"Wallet.Updated.HoursAgo_any" = "%@ hours ago";
"Wallet.Updated.HoursAgo_many" = "%@ hours ago";
"Wallet.Updated.HoursAgo_0" = "%@ hours ago";
"Wallet.Updated.YesterdayAt" = "yesterday at %@";
"Wallet.Updated.AtDate" = "%@";
"Wallet.Updated.TodayAt" = "today at %@";
"Wallet.Info.WalletCreated" = "Wallet Created";
"Wallet.Info.Address" = "Your wallet address";
@ -4906,3 +4906,60 @@ Any member of this group will be able to see messages in the channel.";
"Conversation.WalletRequiredSetup" = "Set Up";
"Wallet.CreateInvoice.Title" = "Create Invoice";
"Wallet.Navigation.Close" = "Close";
"Wallet.Navigation.Back" = "Back";
"Wallet.Navigation.Done" = "Done";
"Wallet.Navigation.Cancel" = "Cancel";
"Wallet.Alert.OK" = "OK";
"Wallet.Alert.Cancel" = "Cancel";
"Wallet.Month.GenJanuary" = "January";
"Wallet.Month.GenFebruary" = "February";
"Wallet.Month.GenMarch" = "March";
"Wallet.Month.GenApril" = "April";
"Wallet.Month.GenMay" = "May";
"Wallet.Month.GenJune" = "June";
"Wallet.Month.GenJuly" = "July";
"Wallet.Month.GenAugust" = "August";
"Wallet.Month.GenSeptember" = "September";
"Wallet.Month.GenOctober" = "October";
"Wallet.Month.GenNovember" = "November";
"Wallet.Month.GenDecember" = "December";
"Wallet.Month.ShortJanuary" = "Jan";
"Wallet.Month.ShortFebruary" = "Feb";
"Wallet.Month.ShortMarch" = "Mar";
"Wallet.Month.ShortApril" = "Apr";
"Wallet.Month.ShortMay" = "May";
"Wallet.Month.ShortJune" = "Jun";
"Wallet.Month.ShortJuly" = "Jul";
"Wallet.Month.ShortAugust" = "Aug";
"Wallet.Month.ShortSeptember" = "Sep";
"Wallet.Month.ShortOctober" = "Oct";
"Wallet.Month.ShortNovember" = "Nov";
"Wallet.Month.ShortDecember" = "Dec";
"Wallet.Weekday.Today" = "Today";
"Wallet.Weekday.Yesterday" = "Yesterday";
"Wallet.Info.TransactionDateHeader" = "%1$@ %2$@";
"Wallet.Info.TransactionDateHeaderYear" = "%1$@ %2$@, %3$@";
"Wallet.UnknownError" = "An error occurred. Please try again later.";
"Wallet.ContextMenuCopy" = "Copy";
"Wallet.Time.PreciseDate_m1" = "Jan %1$@, %2$@ at %3$@";
"Wallet.Time.PreciseDate_m2" = "Feb %1$@, %2$@ at %3$@";
"Wallet.Time.PreciseDate_m3" = "Mar %1$@, %2$@ at %3$@";
"Wallet.Time.PreciseDate_m4" = "Apr %1$@, %2$@ at %3$@";
"Wallet.Time.PreciseDate_m5" = "May %1$@, %2$@ at %3$@";
"Wallet.Time.PreciseDate_m6" = "Jun %1$@, %2$@ at %3$@";
"Wallet.Time.PreciseDate_m7" = "Jul %1$@, %2$@ at %3$@";
"Wallet.Time.PreciseDate_m8" = "Aug %1$@, %2$@ at %3$@";
"Wallet.Time.PreciseDate_m9" = "Sep %1$@, %2$@ at %3$@";
"Wallet.Time.PreciseDate_m10" = "Oct %1$@, %2$@ at %3$@";
"Wallet.Time.PreciseDate_m11" = "Nov %1$@, %2$@ at %3$@";
"Wallet.Time.PreciseDate_m12" = "Dec %1$@, %2$@ at %3$@";
"Wallet.VoiceOver.Editing.ClearText" = "Clear text";

View File

@ -7,7 +7,6 @@ static_library(
]),
deps = [
"//submodules/Display:Display#shared",
"//submodules/AccountContext:AccountContext",
],
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",

View File

@ -1,14 +1,22 @@
import Foundation
import UIKit
import Display
import AccountContext
import SwiftSignalKit
public func textAlertController(context: AccountContext, title: String?, text: String, actions: [TextAlertAction], actionLayout: TextAlertContentActionLayout = .horizontal, allowInputInset: Bool = true) -> AlertController {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
public final class AlertControllerContext {
public let theme: AlertControllerTheme
public let themeSignal: Signal<AlertControllerTheme, NoError>
let controller = standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: title, text: text, actions: actions, actionLayout: actionLayout, allowInputInset: allowInputInset)
let presentationDataDisposable = context.sharedContext.presentationData.start(next: { [weak controller] presentationData in
controller?.theme = AlertControllerTheme(presentationTheme: presentationData.theme)
public init(theme: AlertControllerTheme, themeSignal: Signal<AlertControllerTheme, NoError>) {
self.theme = theme
self.themeSignal = themeSignal
}
}
public func textAlertController(alertContext: AlertControllerContext, title: String?, text: String, actions: [TextAlertAction], actionLayout: TextAlertContentActionLayout = .horizontal, allowInputInset: Bool = true) -> AlertController {
let controller = standardTextAlertController(theme: alertContext.theme, title: title, text: text, actions: actions, actionLayout: actionLayout, allowInputInset: allowInputInset)
let presentationDataDisposable = alertContext.themeSignal.start(next: { [weak controller] theme in
controller?.theme = theme
})
controller.dismissed = {
presentationDataDisposable.dispose()
@ -17,9 +25,8 @@ public func textAlertController(context: AccountContext, title: String?, text: S
return controller
}
public func richTextAlertController(context: AccountContext, title: NSAttributedString?, text: NSAttributedString, actions: [TextAlertAction], actionLayout: TextAlertContentActionLayout = .horizontal, allowInputInset: Bool = true, dismissAutomatically: Bool = true) -> AlertController {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let theme = AlertControllerTheme(presentationTheme: presentationData.theme)
public func richTextAlertController(alertContext: AlertControllerContext, title: NSAttributedString?, text: NSAttributedString, actions: [TextAlertAction], actionLayout: TextAlertContentActionLayout = .horizontal, allowInputInset: Bool = true, dismissAutomatically: Bool = true) -> AlertController {
let theme = alertContext.theme
var dismissImpl: (() -> Void)?
let controller = AlertController(theme: theme, contentNode: TextAlertContentNode(theme: theme, title: title, text: text, actions: actions.map { action in
@ -34,8 +41,8 @@ public func richTextAlertController(context: AccountContext, title: NSAttributed
controller?.dismissAnimated()
}
let presentationDataDisposable = context.sharedContext.presentationData.start(next: { [weak controller] presentationData in
controller?.theme = AlertControllerTheme(presentationTheme: presentationData.theme)
let presentationDataDisposable = alertContext.themeSignal.start(next: { [weak controller] theme in
controller?.theme = theme
})
controller.dismissed = {
presentationDataDisposable.dispose()

View File

@ -302,13 +302,12 @@ public struct AnimatedStickerStatus: Equatable {
}
public enum AnimatedStickerNodeResource {
case resource(MediaResource)
case resource(Account, MediaResource)
case localFile(String)
}
public final class AnimatedStickerNode: ASDisplayNode {
private let queue: Queue
private var account: Account?
private var fileReference: FileMediaReference?
private let disposable = MetaDisposable()
private let fetchDisposable = MetaDisposable()
@ -386,7 +385,7 @@ public final class AnimatedStickerNode: ASDisplayNode {
self.addSubnode(self.renderer!)
}
public func setup(account: Account, resource: AnimatedStickerNodeResource, fitzModifier: EmojiFitzModifier? = nil, width: Int, height: Int, playbackMode: AnimatedStickerPlaybackMode = .loop, mode: AnimatedStickerMode) {
public func setup(resource: AnimatedStickerNodeResource, fitzModifier: EmojiFitzModifier? = nil, width: Int, height: Int, playbackMode: AnimatedStickerPlaybackMode = .loop, mode: AnimatedStickerMode) {
if width < 2 || height < 2 {
return
}
@ -407,7 +406,7 @@ public final class AnimatedStickerNode: ASDisplayNode {
}
}
switch resource {
case let .resource(resource):
case let .resource(account, resource):
self.disposable.set((account.postbox.mediaBox.resourceData(resource)
|> deliverOnMainQueue).start(next: { data in
f(data)
@ -417,7 +416,7 @@ public final class AnimatedStickerNode: ASDisplayNode {
}
case .cached:
switch resource {
case let .resource(resource):
case let .resource(account, resource):
self.disposable.set((chatMessageAnimationData(postbox: account.postbox, resource: resource, fitzModifier: fitzModifier, width: width, height: height, synchronousLoad: false)
|> deliverOnMainQueue).start(next: { [weak self] data in
if let strongSelf = self, data.complete {

View File

@ -19,6 +19,7 @@ static_library(
"//submodules/Stripe:Stripe",
"//submodules/CountrySelectionUI:CountrySelectionUI",
"//submodules/AppBundle:AppBundle",
"//submodules/PresentationDataUtils:PresentationDataUtils",
],
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",

View File

@ -8,8 +8,10 @@ import SwiftSignalKit
import PassKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import AlertUI
import PresentationDataUtils
import TelegramNotices
import TelegramStringFormatting
import PasswordSetupUI

View File

@ -6,6 +6,7 @@ import SwiftSignalKit
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import PhotoResources
class BotCheckoutHeaderItem: ListViewItem, ItemListItem {

View File

@ -8,6 +8,7 @@ import SwiftSignalKit
import TelegramPresentationData
import AccountContext
import AlertUI
import PresentationDataUtils
import CountrySelectionUI
private final class BotCheckoutInfoAddressItems {

View File

@ -5,6 +5,7 @@ import AsyncDisplayKit
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
class BotCheckoutPriceItem: ListViewItem, ItemListItem {
let theme: PresentationTheme

View File

@ -7,6 +7,7 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import TelegramStringFormatting

View File

@ -18,6 +18,7 @@ static_library(
"//submodules/AvatarNode:AvatarNode",
"//submodules/TelegramStringFormatting:TelegramStringFormatting",
"//submodules/AlertUI:AlertUI",
"//submodules/PresentationDataUtils:PresentationDataUtils",
"//submodules/TelegramNotices:TelegramNotices",
"//submodules/MergeLists:MergeLists",
],

View File

@ -7,6 +7,7 @@ import SwiftSignalKit
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AvatarNode
import TelegramStringFormatting

View File

@ -7,8 +7,10 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import AlertUI
import PresentationDataUtils
import AppBundle
public enum CallListControllerMode {

View File

@ -8,6 +8,7 @@ import SwiftSignalKit
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import AccountContext
import TelegramNotices

View File

@ -17,6 +17,7 @@ static_library(
"//submodules/TelegramBaseController:TelegramBaseController",
"//submodules/OverlayStatusController:OverlayStatusController",
"//submodules/AlertUI:AlertUI",
"//submodules/PresentationDataUtils:PresentationDataUtils",
"//submodules/UndoUI:UndoUI",
"//submodules/TelegramNotices:TelegramNotices",
"//submodules/SearchUI:SearchUI",

View File

@ -9,6 +9,7 @@ import Display
import TelegramUIPreferences
import OverlayStatusController
import AlertUI
import PresentationDataUtils
func archiveContextMenuItems(context: AccountContext, groupId: PeerGroupId, chatListController: ChatListControllerImpl?) -> Signal<[ContextMenuItem], NoError> {
let strings = context.sharedContext.currentPresentationData.with({ $0 }).strings
@ -179,7 +180,7 @@ func chatContextMenuItems(context: AccountContext, peerId: PeerId, source: ChatC
var cancelImpl: (() -> Void)?
let progressSignal = Signal<Never, NoError> { subscriber in
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let controller = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: {
let controller = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: {
cancelImpl?()
}))
chatListController?.present(controller, in: .window(.root))

View File

@ -10,6 +10,7 @@ import TelegramBaseController
import OverlayStatusController
import AccountContext
import AlertUI
import PresentationDataUtils
import UndoUI
import TelegramNotices
import SearchUI
@ -873,7 +874,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController,
if let controller = controller as? UndoOverlayController {
switch controller.content {
case let .archivedChat(archivedChat):
if peerIds.contains(archivedChat.peerId) {
if peerIds.contains(PeerId(archivedChat.peerId)) {
controller.dismiss()
}
default:
@ -1210,7 +1211,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController,
let context = strongSelf.context
let presentationData = strongSelf.presentationData
let progressSignal = Signal<Never, NoError> { subscriber in
let controller = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: nil))
let controller = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: nil))
self?.present(controller, in: .window(.root))
return ActionDisposable { [weak controller] in
Queue.mainQueue().async() {
@ -1302,7 +1303,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController,
})
if value {
strongSelf.present(UndoOverlayController(context: strongSelf.context, content: .hidArchive(title: strongSelf.presentationData.strings.ChatList_UndoArchiveHiddenTitle, text: strongSelf.presentationData.strings.ChatList_UndoArchiveHiddenText, undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { [weak self] shouldCommit in
strongSelf.present(UndoOverlayController(presentationData: strongSelf.context.sharedContext.currentPresentationData.with { $0 }, content: .hidArchive(title: strongSelf.presentationData.strings.ChatList_UndoArchiveHiddenTitle, text: strongSelf.presentationData.strings.ChatList_UndoArchiveHiddenText, undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { [weak self] shouldCommit in
guard let strongSelf = self else {
return
}
@ -1320,7 +1321,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController,
}
}), in: .current)
} else {
strongSelf.present(UndoOverlayController(context: strongSelf.context, content: .revealedArchive(title: strongSelf.presentationData.strings.ChatList_UndoArchiveRevealedTitle, text: strongSelf.presentationData.strings.ChatList_UndoArchiveRevealedText, undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { _ in
strongSelf.present(UndoOverlayController(presentationData: strongSelf.context.sharedContext.currentPresentationData.with { $0 }, content: .revealedArchive(title: strongSelf.presentationData.strings.ChatList_UndoArchiveRevealedTitle, text: strongSelf.presentationData.strings.ChatList_UndoArchiveRevealedText, undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { _ in
}), in: .current)
}
})
@ -1414,7 +1415,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController,
return true
})
strongSelf.present(UndoOverlayController(context: strongSelf.context, content: .removedChat(text: strongSelf.presentationData.strings.Undo_ChatCleared), elevatedLayout: false, animateInAsReplacement: true, action: { shouldCommit in
strongSelf.present(UndoOverlayController(presentationData: strongSelf.context.sharedContext.currentPresentationData.with { $0 }, content: .removedChat(text: strongSelf.presentationData.strings.Undo_ChatCleared), elevatedLayout: false, animateInAsReplacement: true, action: { shouldCommit in
guard let strongSelf = self else {
return
}
@ -1617,7 +1618,8 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController,
title = ""
undo = true
}
strongSelf.present(UndoOverlayController(context: strongSelf.context, content: .archivedChat(peerId: peerIds[0], title: title, text: text, undo: undo), elevatedLayout: false, animateInAsReplacement: true, action: action), in: .current)
let controller = UndoOverlayController(presentationData: strongSelf.context.sharedContext.currentPresentationData.with { $0 }, content: .archivedChat(peerId: peerIds[0].toInt64(), title: title, text: text, undo: undo), elevatedLayout: false, animateInAsReplacement: true, action: action)
strongSelf.present(controller, in: .current)
strongSelf.chatListDisplayNode.playArchiveAnimation()
})
@ -1680,7 +1682,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController,
return true
})
self.present(UndoOverlayController(context: self.context, content: .removedChat(text: statusText), elevatedLayout: false, animateInAsReplacement: true, action: { [weak self] shouldCommit in
self.present(UndoOverlayController(presentationData: self.context.sharedContext.currentPresentationData.with { $0 }, content: .removedChat(text: statusText), elevatedLayout: false, animateInAsReplacement: true, action: { [weak self] shouldCommit in
guard let strongSelf = self else {
return
}

View File

@ -7,6 +7,7 @@ import SwiftSignalKit
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AvatarNode
import TelegramStringFormatting
import AccountContext

View File

@ -14,6 +14,7 @@ static_library(
"//submodules/ItemListUI:ItemListUI",
"//submodules/AccountContext:AccountContext",
"//submodules/AlertUI:AlertUI",
"//submodules/PresentationDataUtils:PresentationDataUtils",
],
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",

View File

@ -6,8 +6,10 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import AlertUI
import PresentationDataUtils
private let maxTextLength = 255
private let maxOptionLength = 100

View File

@ -5,6 +5,7 @@ import AsyncDisplayKit
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
class CreatePollOptionActionItem: ListViewItem, ItemListItem {
let theme: PresentationTheme

View File

@ -5,6 +5,7 @@ import AsyncDisplayKit
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
struct CreatePollOptionItemEditing {
let editable: Bool

View File

@ -23,6 +23,7 @@ static_library(
"//submodules/TelegramPermissionsUI:TelegramPermissionsUI",
"//submodules/TelegramNotices:TelegramNotices",
"//submodules/AlertUI:AlertUI",
"//submodules/PresentationDataUtils:PresentationDataUtils",
"//submodules/ShareController:ShareController",
"//submodules/AppBundle:AppBundle",
"//submodules/OverlayStatusController:OverlayStatusController",

View File

@ -7,6 +7,7 @@ import Postbox
import TelegramCore
import Display
import AlertUI
import PresentationDataUtils
import OverlayStatusController
func contactContextMenuItems(context: AccountContext, peerId: PeerId, contactsController: ContactsController?) -> Signal<[ContextMenuItem], NoError> {
@ -62,7 +63,7 @@ func contactContextMenuItems(context: AccountContext, peerId: PeerId, contactsCo
var cancelImpl: (() -> Void)?
let progressSignal = Signal<Never, NoError> { subscriber in
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let controller = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: {
let controller = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: {
cancelImpl?()
}))
contactsController?.present(controller, in: .window(.root))

View File

@ -5,6 +5,7 @@ import AsyncDisplayKit
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import ContactsPeerItem
import AccountContext

View File

@ -10,6 +10,7 @@ import TelegramUIPreferences
import DeviceAccess
import MergeLists
import ItemListUI
import PresentationDataUtils
import MediaResources
import AccountContext
import TelegramPermissions

View File

@ -10,6 +10,7 @@ import TelegramUIPreferences
import DeviceAccess
import AccountContext
import AlertUI
import PresentationDataUtils
import TelegramPermissions
import TelegramNotices
import ContactsPeerItem

View File

@ -10,6 +10,7 @@ import TelegramPresentationData
import AccountContext
import ShareController
import AlertUI
import PresentationDataUtils
import SearchUI
public class InviteContactsController: ViewController, MFMessageComposeViewControllerDelegate, UINavigationControllerDelegate {

View File

@ -8,6 +8,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import CheckNode
import AvatarNode
import TelegramStringFormatting

View File

@ -5,6 +5,7 @@ import AsyncDisplayKit
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import TextFormat
import AppBundle

View File

@ -7,6 +7,7 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import ActivityIndicator
import AvatarNode
import TelegramStringFormatting

View File

@ -5,6 +5,7 @@ import AsyncDisplayKit
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
public enum ItemListPeerActionItemHeight {
case generic

View File

@ -8,6 +8,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import AvatarNode
import TelegramStringFormatting
import PeerPresenceStatusManager

View File

@ -7,6 +7,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import StickerResources
import AnimationUI
@ -599,7 +600,7 @@ class ItemListStickerPackItemNode: ItemListRevealOptionsItemNode {
animationNode = AnimatedStickerNode()
strongSelf.animationNode = animationNode
strongSelf.addSubnode(animationNode)
animationNode.setup(account: item.account, resource: .resource(resource), width: 80, height: 80, mode: .cached)
animationNode.setup(resource: .resource(item.account, resource), width: 80, height: 80, mode: .cached)
}
animationNode.visibility = strongSelf.visibility != .none && item.playAnimatedStickers
animationNode.isHidden = !item.playAnimatedStickers

View File

@ -9,7 +9,6 @@ static_library(
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared",
"//submodules/AsyncDisplayKit:AsyncDisplayKit#shared",
"//submodules/Display:Display#shared",
"//submodules/AccountContext:AccountContext",
"//submodules/TelegramPresentationData:TelegramPresentationData",
"//submodules/MergeLists:MergeLists",
"//submodules/TextFormat:TextFormat",

View File

@ -2,9 +2,7 @@ import Foundation
import UIKit
import Display
import SwiftSignalKit
import TelegramCore
import TelegramPresentationData
import AccountContext
import ProgressNavigationButtonNode
public enum ItemListNavigationButtonStyle {
@ -217,15 +215,6 @@ open class ItemListController: ViewController, KeyShortcutResponder, Presentable
public var willDisappear: ((Bool) -> Void)?
public var didDisappear: ((Bool) -> Void)?
convenience public init<ItemGenerationArguments>(context: AccountContext, state: Signal<(ItemListControllerState, (ItemListNodeState, ItemGenerationArguments)), NoError>, tabBarItem: Signal<ItemListControllerTabBarItem, NoError>? = nil) {
self.init(sharedContext: context.sharedContext, state: state, tabBarItem: tabBarItem)
}
convenience public init<ItemGenerationArguments>(sharedContext: SharedAccountContext, state: Signal<(ItemListControllerState, (ItemListNodeState, ItemGenerationArguments)), NoError>, tabBarItem: Signal<ItemListControllerTabBarItem, NoError>? = nil) {
let presentationData = sharedContext.currentPresentationData.with { $0 }
self.init(theme: presentationData.theme, strings: presentationData.strings, updatedPresentationData: sharedContext.presentationData |> map { ($0.theme, $0.strings) }, state: state, tabBarItem: tabBarItem)
}
public init<ItemGenerationArguments>(theme: PresentationTheme, strings: PresentationStrings, updatedPresentationData: Signal<(theme: PresentationTheme, strings: PresentationStrings), NoError>, state: Signal<(ItemListControllerState, (ItemListNodeState, ItemGenerationArguments)), NoError>, tabBarItem: Signal<ItemListControllerTabBarItem, NoError>?) {
self.state = state
|> map { controllerState, nodeStateAndArgument -> (ItemListControllerState, (ItemListNodeState, Any)) in

View File

@ -14,6 +14,7 @@ static_library(
"//submodules/TelegramPresentationData:TelegramPresentationData",
"//submodules/AccountContext:AccountContext",
"//submodules/AlertUI:AlertUI",
"//submodules/PresentationDataUtils:PresentationDataUtils",
"//submodules/ShareController:ShareController",
"//submodules/SelectablePeerNode:SelectablePeerNode",
],

View File

@ -8,6 +8,7 @@ import SwiftSignalKit
import TelegramPresentationData
import AccountContext
import AlertUI
import PresentationDataUtils
public final class JoinLinkPreviewController: ViewController {
private var controllerNode: JoinLinkPreviewControllerNode {

View File

@ -16,6 +16,7 @@ static_library(
"//submodules/TextFormat:TextFormat",
"//submodules/ShareController:ShareController",
"//submodules/AlertUI:AlertUI",
"//submodules/PresentationDataUtils:PresentationDataUtils",
],
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",

View File

@ -8,6 +8,7 @@ import SwiftSignalKit
import TelegramPresentationData
import AccountContext
import AlertUI
import PresentationDataUtils
public final class LanguageLinkPreviewController: ViewController {
private var controllerNode: LanguageLinkPreviewControllerNode {

View File

@ -144,7 +144,7 @@ static void MTNetworkAvailabilityContextRelease(const void *info)
((flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0));
BOOL canConnectWithoutUserInteraction = (canConnectionAutomatically &&
(flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0);
BOOL isNetworkReachable = (isReachable && (!needsConnection || canConnectWithoutUserInteraction));
BOOL isNetworkReachable = isReachable;
bool isWWAN = false;
#if TARGET_OS_IPHONE

View File

@ -7,6 +7,7 @@ import TelegramCore
import AVFoundation
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import TelegramStringFormatting
import AppBundle

View File

@ -8,7 +8,6 @@ static_library(
deps = [
"//submodules/Display:Display#shared",
"//submodules/LegacyComponents:LegacyComponents",
"//submodules/TelegramPresentationData:TelegramPresentationData",
],
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",

View File

@ -1,7 +1,6 @@
import Foundation
import UIKit
import Display
import TelegramPresentationData
import LegacyComponents
public enum OverlayStatusControllerType {
@ -80,26 +79,26 @@ private final class OverlayStatusControllerNode: ViewControllerTracingNode {
private let dismissed: () -> Void
private let contentController: OverlayStatusContentController
init(theme: PresentationTheme, strings: PresentationStrings, type: OverlayStatusControllerType, dismissed: @escaping () -> Void) {
init(style: OverlayStatusControllerStyle, type: OverlayStatusControllerType, dismissed: @escaping () -> Void) {
self.dismissed = dismissed
var isUserInteractionEnabled = true
switch type {
case let .loading(cancelled):
let controller = TGProgressWindowController(light: theme.actionSheet.backgroundType == .light)!
let controller = TGProgressWindowController(light: style == .light)!
controller.cancelled = {
cancelled?()
}
self.contentController = .loading(controller)
case .success:
self.contentController = .progress(TGProgressWindowController(light: theme.actionSheet.backgroundType == .light))
self.contentController = .progress(TGProgressWindowController(light: style == .light))
case let .shieldSuccess(text, increasedDelay):
self.contentController = .shieldSuccess(TGProxyWindowController(light: theme.actionSheet.backgroundType == .light, text: text, shield: true, star: false), increasedDelay)
self.contentController = .shieldSuccess(TGProxyWindowController(light: style == .light, text: text, shield: true, star: false), increasedDelay)
case let .genericSuccess(text, increasedDelay):
let controller = TGProxyWindowController(light: theme.actionSheet.backgroundType == .light, text: text, shield: false, star: false)!
let controller = TGProxyWindowController(light: style == .light, text: text, shield: false, star: false)!
self.contentController = .genericSuccess(controller, increasedDelay)
isUserInteractionEnabled = false
case let .starSuccess(text):
self.contentController = .genericSuccess(TGProxyWindowController(light: theme.actionSheet.backgroundType == .light, text: text, shield: false, star: true), false)
self.contentController = .genericSuccess(TGProxyWindowController(light: style == .light, text: text, shield: false, star: true), false)
}
super.init()
@ -129,9 +128,13 @@ private final class OverlayStatusControllerNode: ViewControllerTracingNode {
}
}
public enum OverlayStatusControllerStyle {
case light
case dark
}
public final class OverlayStatusController: ViewController, StandalonePresentableController {
private let theme: PresentationTheme
private let strings: PresentationStrings
private let style: OverlayStatusControllerStyle
private let type: OverlayStatusControllerType
private var animatedDidAppear = false
@ -140,9 +143,8 @@ public final class OverlayStatusController: ViewController, StandalonePresentabl
return self.displayNode as! OverlayStatusControllerNode
}
public init(theme: PresentationTheme, strings: PresentationStrings, type: OverlayStatusControllerType) {
self.theme = theme
self.strings = strings
public init(style: OverlayStatusControllerStyle, type: OverlayStatusControllerType) {
self.style = style
self.type = type
super.init(navigationBarPresentationData: nil)
@ -155,7 +157,7 @@ public final class OverlayStatusController: ViewController, StandalonePresentabl
}
override public func loadDisplayNode() {
self.displayNode = OverlayStatusControllerNode(theme: self.theme, strings: self.strings, type: self.type, dismissed: { [weak self] in
self.displayNode = OverlayStatusControllerNode(style: self.style, type: self.type, dismissed: { [weak self] in
self?.presentingViewController?.dismiss(animated: false, completion: nil)
})

View File

@ -22,6 +22,7 @@ static_library(
"//submodules/DateSelectionUI:DateSelectionUI",
"//submodules/PasswordSetupUI:PasswordSetupUI",
"//submodules/AppBundle:AppBundle",
"//submodules/PresentationDataUtils:PresentationDataUtils",
],
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",

View File

@ -4,6 +4,7 @@ import AsyncDisplayKit
import Display
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
class FormEditableBlockItemNode<Item: FormControllerItem>: ASDisplayNode, FormControllerItemNode, FormBlockItemNodeProto, UIGestureRecognizerDelegate {
private let topSeparatorInset: FormBlockItemInset

View File

@ -9,6 +9,7 @@ import OverlayStatusController
import AccountContext
import LegacyUI
import ImageCompression
import PresentationDataUtils
enum SecureIdAttachmentMenuType {
case generic
@ -64,7 +65,7 @@ func presentLegacySecureIdAttachmentMenu(context: AccountContext, present: @esca
return
}
uploadStarted = true
let statusController = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: nil))
let statusController = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: nil))
let statusDisposable = (Signal<Never, NoError> { subscriber in
present(statusController)
return ActionDisposable {

View File

@ -10,6 +10,7 @@ import TextFormat
import ProgressNavigationButtonNode
import AccountContext
import AlertUI
import PresentationDataUtils
import PasswordSetupUI
public enum SecureIdRequestResult: String {

View File

@ -9,6 +9,7 @@ import TelegramPresentationData
import ProgressNavigationButtonNode
import AccountContext
import AlertUI
import PresentationDataUtils
enum SecureIdDocumentFormScrollToSubject {
case selfie

View File

@ -9,6 +9,7 @@ import CoreTelephony
import TelegramPresentationData
import AccountContext
import AlertUI
import PresentationDataUtils
import CountrySelectionUI
private func cleanPhoneNumber(_ text: String?) -> String {

View File

@ -5,6 +5,7 @@ import Display
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import TelegramStringFormatting
import RadialStatusNode
import PhotoResources

View File

@ -16,6 +16,7 @@ static_library(
"//submodules/ProgressNavigationButtonNode:ProgressNavigationButtonNode",
"//submodules/ActivityIndicator:ActivityIndicator",
"//submodules/AlertUI:AlertUI",
"//submodules/PresentationDataUtils:PresentationDataUtils",
"//submodules/ItemListUI:ItemListUI",
],
frameworks = [

View File

@ -6,8 +6,10 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import AlertUI
import PresentationDataUtils
private final class ResetPasswordControllerArguments {
let updateCodeText: (String) -> Void

View File

@ -9,6 +9,7 @@ import TelegramPresentationData
import ActivityIndicator
import AccountContext
import AlertUI
import PresentationDataUtils
public enum SetupTwoStepVerificationInitialState {
case automatic

View File

@ -15,6 +15,7 @@ static_library(
"//submodules/AccountContext:AccountContext",
"//submodules/ItemListUI:ItemListUI",
"//submodules/AlertUI:AlertUI",
"//submodules/PresentationDataUtils:PresentationDataUtils",
"//submodules/ItemListAvatarAndNameInfoItem:ItemListAvatarAndNameInfoItem",
"//submodules/UndoUI:UndoUI",
"//submodules/TelegramUIPreferences:TelegramUIPreferences",

View File

@ -6,8 +6,10 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import AlertUI
import PresentationDataUtils
import ItemListAvatarAndNameInfoItem
import Emoji

View File

@ -7,9 +7,11 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import AccountContext
import TemporaryCachedPeerDataManager
import AlertUI
import PresentationDataUtils
import UndoUI
import ItemListPeerItem
import ItemListPeerActionItem
@ -525,7 +527,7 @@ public func channelAdminsController(context: AccountContext, peerId: PeerId, loa
guard let peer = peer, let user = user else {
return
}
presentControllerImpl?(UndoOverlayController(context: context, content: .succeed(text: presentationData.strings.Channel_OwnershipTransfer_TransferCompleted(user.displayTitle, peer.displayTitle).0), elevatedLayout: false, action: { _ in }), nil)
presentControllerImpl?(UndoOverlayController(presentationData: context.sharedContext.currentPresentationData.with { $0 }, content: .succeed(text: presentationData.strings.Channel_OwnershipTransfer_TransferCompleted(user.displayTitle, peer.displayTitle).0), elevatedLayout: false, action: { _ in }), nil)
})
}

View File

@ -6,10 +6,12 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import TelegramStringFormatting
import OverlayStatusController
import AccountContext
import AlertUI
import PresentationDataUtils
import ItemListAvatarAndNameInfoItem
private final class ChannelBannedMemberControllerArguments {
@ -673,7 +675,7 @@ public func channelBannedMemberController(context: AccountContext, peerId: PeerI
}, completed: {
if previousRights == nil {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
presentControllerImpl?(OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .genericSuccess(presentationData.strings.GroupPermission_AddSuccess, false)), nil)
presentControllerImpl?(OverlayStatusController(theme: presentationData.theme, type: .genericSuccess(presentationData.strings.GroupPermission_AddSuccess, false)), nil)
}
updated(cleanResolvedRights.flags.isEmpty ? nil : cleanResolvedRights)
dismissImpl?()

View File

@ -7,9 +7,11 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import OverlayStatusController
import AccountContext
import AlertUI
import PresentationDataUtils
import ItemListPeerItem
private final class ChannelBlacklistControllerArguments {
@ -317,7 +319,7 @@ public func channelBlacklistController(context: AccountContext, peerId: PeerId)
}
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let progress = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: nil))
let progress = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: nil))
presentControllerImpl?(progress, nil)
removePeerDisposable.set((context.peerChannelMemberCategoriesContextsManager.updateMemberBannedRights(account: context.account, peerId: peerId, memberId: peer.id, bannedRights: TelegramChatBannedRights(flags: [.banReadMessages], untilDate: Int32.max))
|> deliverOnMainQueue).start(error: { [weak progress] _ in

View File

@ -7,9 +7,11 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import OverlayStatusController
import AccountContext
import AlertUI
import PresentationDataUtils
import ItemListPeerItem
import ItemListPeerActionItem
@ -247,7 +249,7 @@ public func channelDiscussionGroupSetupController(context: AccountContext, peerI
var cancelImpl: (() -> Void)?
let progressSignal = Signal<Never, NoError> { subscriber in
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let controller = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: {
let controller = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: {
cancelImpl?()
}))
presentControllerImpl?(controller, nil)
@ -279,7 +281,7 @@ public func channelDiscussionGroupSetupController(context: AccountContext, peerI
}, completed: {
dismiss()
/*let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let controller = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .success)
let controller = OverlayStatusController(theme: presentationData.theme, type: .success)
presentControllerImpl?(controller, nil)*/
}))
}))
@ -347,7 +349,7 @@ public func channelDiscussionGroupSetupController(context: AccountContext, peerI
var cancelImpl: (() -> Void)?
let progressSignal = Signal<Never, NoError> { subscriber in
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let controller = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: {
let controller = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: {
cancelImpl?()
}))
presentControllerImpl?(controller, nil)
@ -402,7 +404,7 @@ public func channelDiscussionGroupSetupController(context: AccountContext, peerI
var cancelImpl: (() -> Void)?
let progressSignal = Signal<Never, NoError> { subscriber in
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let controller = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: {
let controller = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: {
cancelImpl?()
}))
presentControllerImpl?(controller, nil)
@ -482,7 +484,7 @@ public func channelDiscussionGroupSetupController(context: AccountContext, peerI
var cancelImpl: (() -> Void)?
let progressSignal = Signal<Never, NoError> { subscriber in
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let controller = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: {
let controller = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: {
cancelImpl?()
}))
presentControllerImpl?(controller, nil)
@ -513,7 +515,7 @@ public func channelDiscussionGroupSetupController(context: AccountContext, peerI
}, completed: {
if case .group = peer.info {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let controller = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .success)
let controller = OverlayStatusController(theme: presentationData.theme, type: .success)
presentControllerImpl?(controller, nil)
dismissImpl?()

View File

@ -5,6 +5,7 @@ import AsyncDisplayKit
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import TextFormat
import AppBundle

View File

@ -7,6 +7,7 @@ import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import SearchBarNode

View File

@ -8,12 +8,14 @@ import TelegramCore
import LegacyComponents
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import TextFormat
import OverlayStatusController
import TelegramStringFormatting
import ShareController
import AlertUI
import PresentationDataUtils
import GalleryUI
import LegacyUI
import ItemListAvatarAndNameInfoItem
@ -849,7 +851,7 @@ public func channelInfoController(context: AccountContext, peerId: PeerId) -> Vi
var cancelImpl: (() -> Void)?
let progressSignal = Signal<Never, NoError> { subscriber in
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let controller = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: {
let controller = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: {
cancelImpl?()
}))
presentControllerImpl?(controller, nil)

View File

@ -7,8 +7,10 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import AccountContext
import AlertUI
import PresentationDataUtils
import ItemListPeerItem
private final class ChannelMembersControllerArguments {

View File

@ -10,6 +10,7 @@ import ActivityIndicator
import TextFormat
import AccountContext
import AlertUI
import PresentationDataUtils
import PasswordSetupUI
private final class ChannelOwnershipTransferPasswordFieldNode: ASDisplayNode, UITextFieldDelegate {

View File

@ -7,10 +7,12 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import OverlayStatusController
import AccountContext
import TemporaryCachedPeerDataManager
import AlertUI
import PresentationDataUtils
import ItemListPeerItem
import TelegramPermissionsUI
import ItemListPeerActionItem
@ -701,7 +703,7 @@ public func channelPermissionsController(context: AccountContext, peerId origina
}
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let progress = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: nil))
let progress = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: nil))
presentControllerImpl?(progress, nil)
let signal = convertGroupToSupergroup(account: context.account, peerId: view.peerId)

View File

@ -7,10 +7,12 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import OverlayStatusController
import AccountContext
import ShareController
import AlertUI
import PresentationDataUtils
import TelegramNotices
import ItemListPeerItem
@ -914,7 +916,7 @@ public func channelVisibilityController(context: AccountContext, peerId: PeerId,
if let link = link {
UIPasteboard.general.string = link
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
presentControllerImpl?(OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .genericSuccess(presentationData.strings.Username_LinkCopied, false)), nil)
presentControllerImpl?(OverlayStatusController(theme: presentationData.theme, type: .genericSuccess(presentationData.strings.Username_LinkCopied, false)), nil)
}
})
}, revokePrivateLink: {

View File

@ -8,6 +8,7 @@ import TelegramUIPreferences
import TelegramPresentationData
import LegacyComponents
import ItemListUI
import PresentationDataUtils
class ChatSlowmodeItem: ListViewItem, ItemListItem {
let theme: PresentationTheme

View File

@ -6,8 +6,10 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import AlertUI
import PresentationDataUtils
private final class ConvertToSupergroupArguments {
let convert: () -> Void

View File

@ -7,9 +7,11 @@ import TelegramCore
import MessageUI
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import TelegramStringFormatting
import AccountContext
import AlertUI
import PresentationDataUtils
import PhotoResources
import MediaResources
import ItemListAvatarAndNameInfoItem

View File

@ -10,12 +10,14 @@ import TelegramPresentationData
import SafariServices
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import TextFormat
import AccountContext
import TelegramStringFormatting
import TemporaryCachedPeerDataManager
import ShareController
import AlertUI
import PresentationDataUtils
import MediaResources
import PhotoResources
import GalleryUI

View File

@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import SwiftSignalKit
import ItemListUI
import PresentationDataUtils
import AccountContext
final class ChannelMembersSearchItem: ItemListControllerSearch {

View File

@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import SearchBarNode
private let searchBarFont = Font.regular(17.0)

View File

@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
private final class GroupPreHistorySetupArguments {

View File

@ -7,6 +7,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import ActivityIndicator
import StickerResources
import AppBundle

View File

@ -7,6 +7,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import AccountContext
import StickerPackPreviewUI
import ItemListStickerPackItem

View File

@ -7,6 +7,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import AccountContext
import ItemListPeerItem

View File

@ -7,6 +7,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import TelegramStringFormatting
class ItemListCallListItem: ListViewItem, ItemListItem {

View File

@ -6,6 +6,7 @@ import SwiftSignalKit
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import EncryptionKeyVisualization
class ItemListSecretChatKeyItem: ListViewItem, ItemListItem {

View File

@ -6,9 +6,11 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import ContextUI
import AlertUI
import PresentationDataUtils
public enum PeerReportSubject {
case peer(PeerId)

View File

@ -6,6 +6,7 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import TelegramStringFormatting

View File

@ -8,6 +8,7 @@ import TelegramCore
import LegacyComponents
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import TextFormat
import OverlayStatusController
@ -15,6 +16,7 @@ import TelegramStringFormatting
import AccountContext
import ShareController
import AlertUI
import PresentationDataUtils
import TelegramNotices
import GalleryUI
import ItemListAvatarAndNameInfoItem
@ -785,7 +787,7 @@ public func openAddPersonContactImpl(context: AccountContext, peerId: PeerId, pu
}
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
present(OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .genericSuccess(presentationData.strings.AddContact_StatusSuccess(peer.compactDisplayTitle).0, true)), nil)
present(OverlayStatusController(theme: presentationData.theme, type: .genericSuccess(presentationData.strings.AddContact_StatusSuccess(peer.compactDisplayTitle).0, true)), nil)
}
}), completed: nil, cancelled: nil))
})
@ -1065,7 +1067,7 @@ public func userInfoController(context: AccountContext, peerId: PeerId, mode: Pe
let progressSignal = Signal<Never, NoError> { subscriber in
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let controller = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: nil))
let controller = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: nil))
presentControllerImpl?(controller, nil)
return ActionDisposable { [weak controller] in
Queue.mainQueue().async() {
@ -1348,7 +1350,7 @@ public func userInfoController(context: AccountContext, peerId: PeerId, mode: Pe
let _ = (enqueueMessages(account: context.account, peerId: peerId, messages: [.message(text: "", attributes: [], mediaReference: .standalone(media: contact), replyToMessageId: nil, localGroupingKey: nil)])
|> deliverOnMainQueue).start(next: { [weak controller] _ in
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
controller?.present(OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .success), in: .window(.root))
controller?.present(OverlayStatusController(theme: presentationData.theme, type: .success), in: .window(.root))
})
})
}
@ -1384,7 +1386,7 @@ public func userInfoController(context: AccountContext, peerId: PeerId, mode: Pe
var cancelImpl: (() -> Void)?
let progressSignal = Signal<Never, NoError> { subscriber in
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let controller = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: {
let controller = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: {
cancelImpl?()
}))
presentControllerImpl?(controller, nil)

View File

@ -5,6 +5,7 @@ import AsyncDisplayKit
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
class UserInfoEditingPhoneActionItem: ListViewItem, ItemListItem {
let theme: PresentationTheme

View File

@ -5,6 +5,7 @@ import AsyncDisplayKit
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import SinglePhoneInputNode
import AppBundle

View File

@ -18,6 +18,7 @@ static_library(
"//submodules/OverlayStatusController:OverlayStatusController",
"//submodules/DeviceLocationManager:DeviceLocationManager",
"//submodules/AlertUI:AlertUI",
"//submodules/PresentationDataUtils:PresentationDataUtils",
"//submodules/ItemListPeerItem:ItemListPeerItem",
"//submodules/TelegramPermissionsUI:TelegramPermissionsUI",
"//submodules/ItemListPeerActionItem:ItemListPeerActionItem",

View File

@ -8,10 +8,12 @@ import MapKit
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import OverlayStatusController
import DeviceLocationManager
import AccountContext
import AlertUI
import PresentationDataUtils
import ItemListPeerItem
import TelegramPermissionsUI
import ItemListPeerActionItem
@ -313,7 +315,7 @@ public func peersNearbyController(context: AccountContext) -> ViewController {
var cancelImpl: (() -> Void)?
let progressSignal = Signal<Never, NoError> { subscriber in
let controller = OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .loading(cancelled: {
let controller = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: {
cancelImpl?()
}))
presentControllerImpl?(controller, nil)

View File

@ -5,6 +5,7 @@ import AsyncDisplayKit
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import PeersNearbyIconNode
class PeersNearbyHeaderItem: ListViewItem, ItemListItem {

View File

@ -0,0 +1,20 @@
load("//Config:buck_rule_macros.bzl", "static_library")
static_library(
name = "PresentationDataUtils",
srcs = glob([
"Sources/**/*.swift",
]),
deps = [
"//submodules/Display:Display#shared",
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared",
"//submodules/AccountContext:AccountContext",
"//submodules/TelegramPresentationData:TelegramPresentationData",
"//submodules/AlertUI:AlertUI",
"//submodules/ItemListUI:ItemListUI",
],
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
],
)

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>

View File

@ -0,0 +1,13 @@
import Foundation
import Display
import AlertUI
import AccountContext
import SwiftSignalKit
public func textAlertController(context: AccountContext, title: String?, text: String, actions: [TextAlertAction], actionLayout: TextAlertContentActionLayout = .horizontal, allowInputInset: Bool = true) -> AlertController {
return textAlertController(alertContext: AlertControllerContext(theme: AlertControllerTheme(presentationTheme: context.sharedContext.currentPresentationData.with({ $0 }).theme), themeSignal: context.sharedContext.presentationData |> map { presentationData in AlertControllerTheme(presentationTheme: presentationData.theme) }), title: title, text: text, actions: actions, actionLayout: actionLayout, allowInputInset: allowInputInset)
}
public func richTextAlertController(context: AccountContext, title: NSAttributedString?, text: NSAttributedString, actions: [TextAlertAction], actionLayout: TextAlertContentActionLayout = .horizontal, allowInputInset: Bool = true, dismissAutomatically: Bool = true) -> AlertController {
return richTextAlertController(alertContext: AlertControllerContext(theme: AlertControllerTheme(presentationTheme: context.sharedContext.currentPresentationData.with({ $0 }).theme), themeSignal: context.sharedContext.presentationData |> map { presentationData in AlertControllerTheme(presentationTheme: presentationData.theme) }), title: title, text: text, actions: actions, actionLayout: actionLayout, allowInputInset: allowInputInset, dismissAutomatically: dismissAutomatically)
}

View File

@ -0,0 +1,18 @@
import Foundation
import Display
import AlertUI
import AccountContext
import SwiftSignalKit
import ItemListUI
import PresentationDataUtils
public extension ItemListController {
convenience init<ItemGenerationArguments>(context: AccountContext, state: Signal<(ItemListControllerState, (ItemListNodeState, ItemGenerationArguments)), NoError>, tabBarItem: Signal<ItemListControllerTabBarItem, NoError>? = nil) {
self.init(sharedContext: context.sharedContext, state: state, tabBarItem: tabBarItem)
}
convenience init<ItemGenerationArguments>(sharedContext: SharedAccountContext, state: Signal<(ItemListControllerState, (ItemListNodeState, ItemGenerationArguments)), NoError>, tabBarItem: Signal<ItemListControllerTabBarItem, NoError>? = nil) {
let presentationData = sharedContext.currentPresentationData.with { $0 }
self.init(theme: presentationData.theme, strings: presentationData.strings, updatedPresentationData: sharedContext.presentationData |> map { ($0.theme, $0.strings) }, state: state, tabBarItem: tabBarItem)
}
}

View File

@ -0,0 +1,10 @@
import Foundation
import UIKit
import OverlayStatusController
import TelegramPresentationData
public extension OverlayStatusController {
convenience init(theme: PresentationTheme, type: OverlayStatusControllerType) {
self.init(style: theme.actionSheet.backgroundType == .light ? .light : .dark, type: type)
}
}

View File

@ -135,7 +135,7 @@ final class ReactionNode: ASDisplayNode {
renderSize = CGSize(width: intrinsicSize.width * 2.5, height: intrinsicSize.height * 2.5)
}
}
self.animationNode.setup(account: account, resource: .localFile(path), width: Int(renderSize.width), height: Int(renderSize.height), mode: .direct)
self.animationNode.setup(resource: .localFile(path), width: Int(renderSize.width), height: Int(renderSize.height), mode: .direct)
case .reply:
self.intrinsicOffset = CGPoint(x: 0.0, y: 0.0)
self.imageNode.image = UIImage(named: "Chat/Context Menu/ReactionReply", in: getAppBundle(), compatibleWith: nil)

View File

@ -16,6 +16,7 @@ static_library(
"//submodules/AccountContext:AccountContext",
"//submodules/ActivityIndicator:ActivityIndicator",
"//submodules/AlertUI:AlertUI",
"//submodules/PresentationDataUtils:PresentationDataUtils",
"//submodules/AvatarNode:AvatarNode",
"//submodules/CallListUI:CallListUI",
"//submodules/ChatListSearchItemNode:ChatListSearchItemNode",

View File

@ -6,9 +6,11 @@ import Postbox
import TelegramCore
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import OverlayStatusController
import AccountContext
import AlertUI
import PresentationDataUtils
import AuthorizationUI
private final class ChangePhoneNumberCodeControllerArguments {
@ -272,7 +274,7 @@ func changePhoneNumberCodeController(context: AccountContext, phoneNumber: Strin
return $0.withUpdatedChecking(false)
}
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
presentControllerImpl?(OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .success), nil)
presentControllerImpl?(OverlayStatusController(theme: presentationData.theme, type: .success), nil)
dismissImpl?()
}))
}

View File

@ -8,6 +8,7 @@ import TelegramPresentationData
import ProgressNavigationButtonNode
import AccountContext
import AlertUI
import PresentationDataUtils
import CountrySelectionUI
final class ChangePhoneNumberController: ViewController {

View File

@ -7,6 +7,7 @@ import TelegramPresentationData
import TextFormat
import AccountContext
import AlertUI
import PresentationDataUtils
import AppBundle
private final class ChangePhoneNumberIntroControllerNode: ASDisplayNode {

View File

@ -7,6 +7,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
import ItemListUI
import PresentationDataUtils
import AccountContext
enum AutomaticDownloadConnectionType {

View File

@ -8,6 +8,7 @@ import TelegramUIPreferences
import TelegramPresentationData
import LegacyComponents
import ItemListUI
import PresentationDataUtils
enum AutomaticDownloadDataUsage: Int {
case low

Some files were not shown because too many files have changed in this diff Show More