From b03f5b4773ee0b1f7f2aa6a697ef48161a9abcdd Mon Sep 17 00:00:00 2001 From: Denis Shilovich Date: Wed, 30 Oct 2024 09:51:51 +0000 Subject: [PATCH] 1.8.7 (354) --- MODULE.bazel.lock | 4 +- Nicegram/NGData/Sources/NGSettings.swift | 9 --- .../feed.imageset/Contents.json | 12 --- .../Images.xcassets/feed.imageset/feed.pdf | Bin 1614 -> 0 bytes .../Sources/NicegramSettingsController.swift | 46 +++-------- Package.resolved | 2 +- .../en.lproj/NiceLocalizable.strings | 4 - crowdin.yml | 2 + .../Sources/AccountContext.swift | 4 - .../ChatListUI/Sources/ChatContextMenus.swift | 38 --------- .../Sources/DebugController.swift | 24 +++++- .../TelegramCore/Sources/Utils/Log.swift | 30 ++++++- .../TelegramUI/Sources/AccountContext.swift | 9 --- .../Sources/ApplicationContext.swift | 2 +- .../Chat/ChatControllerLoadDisplayNode.swift | 2 +- .../TelegramUI/Sources/ChatController.swift | 15 +--- .../Sources/ChatControllerNode.swift | 21 +---- .../Sources/Nicegram/FeedController.swift | 73 ------------------ .../Sources/TelegramRootController.swift | 21 +---- submodules/TgVoipWebrtc/tgcalls | 2 +- 20 files changed, 76 insertions(+), 244 deletions(-) delete mode 100644 Nicegram/NGResources/Images.xcassets/feed.imageset/Contents.json delete mode 100644 Nicegram/NGResources/Images.xcassets/feed.imageset/feed.pdf delete mode 100644 submodules/TelegramUI/Sources/Nicegram/FeedController.swift diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 5434b7c96a0..0d98f1e6e70 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -635,7 +635,7 @@ "bzlTransitiveDigest": "8/YWyYftd8THfVoADvrOmQLl45wUGfP2MVjLM5FFn50=", "usagesDigest": "voXBMcSNlo2fnK6JIvInIrncYhBKKG8nBeKvToaUA0Y=", "recordedFileInputs": { - "@@//Package.resolved": "6930dfe335cba8d80aa5728aa218d4aad89c8b8688eb8e4884cf93bfd03ce4c1", + "@@//Package.resolved": "6dd0cb4827ef0c9ff99686ccfd442cbc0261597cd8f7bb03fda649c28bf125ad", "@@//Package.swift": "fb3cb1d48066e64f8bf17fe1a49f689b7a6bf4bfc07aa90b9b80a02188501951" }, "recordedDirentsInputs": {}, @@ -1121,7 +1121,7 @@ "ruleClassName": "swift_package", "attributes": { "bazel_package_name": "swiftpkg_nicegram_assistant_ios", - "commit": "66d6fe9535b718018566630c5407c383ad20651d", + "commit": "b1d4897f36e71c8faef3a06278d503c42f737e98", "remote": "git@bitbucket.org:mobyrix/nicegram-assistant-ios.git", "version": "", "init_submodules": false, diff --git a/Nicegram/NGData/Sources/NGSettings.swift b/Nicegram/NGData/Sources/NGSettings.swift index 3524e98fa4b..bcf8a25565c 100644 --- a/Nicegram/NGData/Sources/NGSettings.swift +++ b/Nicegram/NGData/Sources/NGSettings.swift @@ -1,5 +1,4 @@ import FeatPremium -import Postbox import Foundation import NGAppCache @@ -109,14 +108,6 @@ public struct NGSettings { @NGStorage(key: "recordAllCalls", defaultValue: false) public static var recordAllCalls: Bool - - @NGStorage(key: "showFeedTab", defaultValue: false) - public static var showFeedTab: Bool - - @NGStorage(key: "feedPeerId", defaultValue: NGSettings.zeroFeedPeerId) - public static var feedPeerId: PeerId - - public static let zeroFeedPeerId: PeerId = .init(namespace: PeerId.Namespace._internalFromInt32Value(0), id: PeerId.Id._internalFromInt64Value(0)) } public struct NGWebSettings { diff --git a/Nicegram/NGResources/Images.xcassets/feed.imageset/Contents.json b/Nicegram/NGResources/Images.xcassets/feed.imageset/Contents.json deleted file mode 100644 index d25acefcab4..00000000000 --- a/Nicegram/NGResources/Images.xcassets/feed.imageset/Contents.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "images" : [ - { - "filename" : "feed.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Nicegram/NGResources/Images.xcassets/feed.imageset/feed.pdf b/Nicegram/NGResources/Images.xcassets/feed.imageset/feed.pdf deleted file mode 100644 index b95392e84f093e64a93b087c12f80fc7a20e7556..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1614 zcmY!laBvK;I`dFTEr~!5FAK2q*+Jp}3?dH8Gc~f^qBAz3XJmd0Ky0cCBP~5&OE{ zjB|q3NoAfKivw}Yjg2<-c3CD<*3CZ9x;*mTcA-j-xfknxynVdCK3@L+pTE;TU*F%y z|N8dVuRop(JU?FiOZ~@9rQg0W`fJnb)6`v6j(x7O-gDY>iCEb>h3R3Bet!LR==_@} zmPdDsMKQgW<2WA~6C!r*deTKtt(BaWKTbK{om2eEt13Iv$Wd?U^{O}xe#5Gl8zh`o zIZpTP(sfeVHbrU4(plbhvy?9N>I#}q`+3Fskm3nVuOro*zMcy%FHrd%@p48jkD}UC zRow;M43i>6V^&RynzuxJ*2|^KG|ul^^Va2g_G!o6aslE@OTRizVi)pKT2wB|B;~sK zwdvA%4#BfSW@#<`6_~Q6z}b)SXjj#Bp{d)v(hU@zP0X9(n3!{Qh!Ib*XpH6S!Zwgq0$;VJK6X?`?@8p&ILVl)3yI> zyLh&RyGUj`w|J7nc3$R*1?Lu@d+eN`kk&3~_+mrRM6OwWEK_Al95(MvJnCqv{PpIS zMT>%1pKthXws?_LwDe0kbEeq=5l>gjN}la4N+<>CJ0-aH*VB*lgQnI7pJSNVd{L`(!|k^Ysb>`LzuBk|!tS>I!pno{ z>kb!QZrM=DU{L(9EGX@8?@WGkxA>|rRwv$@B$Z8^?z(kHOM~C%|Jg2Y^Y&PK?|-K# z+uzq>z0lar`BF^(rQ3a*7HjcO;+@vMcek77o5TC2E?zzF;jBJMm7=rqU!_uY&-)nY zh3)&a#>j2mV*7=L@76cW-8WG-cI|zW=`p%I5BKuidd&KwY9*gz1Y^ncy`mQ{IjOz8 zS9M(5srzX5j8pHFvY&aMwUQ~C_2#U}wYy1Xt*z@0Z_)i>wWgglefbJQ6ZKDVXVT5Y z@A3Jx@Bf+b@OIMCpYN`ANX)J03Y=8I_*2uivNy)PRO-!}QWGEBAc^dCr#N(W3tleR zcz(u{bxU=Hlb^nNpuRf&iIvavjp8}0%+q9}zV*If=Pa?B)_c9`pZ6Zd^j)mE<{dSw zirk|nt6ZOzqb^aZ8(IGFTAFEZf>hobNAV-=hkABAHt(2NBVXPj8j&IXsc%!j<~21N zZc60jC>m|!tvo1xdDFXseRZ1>jD^>qu*rWdY2v%lNXqGnR$fVd^~JTat2Y@=c0M%nK_8K-n5n zI#`;R!OI2{xG1p9(09zs%P%Qbh>nGp2qBdPsS5f5iRrK+!Z$S~Gtnu(LLpkgK+gaS z5DX)8m=J;mGbt#wIKQ+gIki{;R7!!07f^}goS#>cng_HIR7Al90}_jXVhW~EA*6x~ zBm^(u^u04vfKF8a`5;IEW{-1zDNwH=hWm>l1sW_c%uq}Md9WC6A;@76k2@!pBp}^2U0nAd!g9{l0-3bD4AwvT*Od$)P!%$Tj znOdR?85;xR5~`}CC^0i9wTKH8d!8=9;Ls?}&rQ`-(8x^DganFyP=0=i0?5PQ0M-xA btV#vC9$dO77L|a#V`yw?#HFh0>hA^sB>-*& diff --git a/Nicegram/NGUI/Sources/NicegramSettingsController.swift b/Nicegram/NGUI/Sources/NicegramSettingsController.swift index dfdc2953a2f..184c5994088 100644 --- a/Nicegram/NGUI/Sources/NicegramSettingsController.swift +++ b/Nicegram/NGUI/Sources/NicegramSettingsController.swift @@ -92,7 +92,6 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry { case showCallsTab(String, Bool) case showNicegramTab case showTabNames(String, Bool) - case showFeedTab(String, Bool) case pinnedChatsHeader case pinnedChat(Int32, PinnedChat) @@ -128,7 +127,7 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry { var section: ItemListSectionId { switch self { - case .TabsHeader, .showContactsTab, .showCallsTab, .showNicegramTab, .showTabNames, .showFeedTab: + case .TabsHeader, .showContactsTab, .showCallsTab, .showNicegramTab, .showTabNames: return NicegramSettingsControllerSection.Tabs.rawValue case .FoldersHeader, .foldersAtBottom, .foldersAtBottomNotice: return NicegramSettingsControllerSection.Folders.rawValue @@ -174,9 +173,6 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry { case .showTabNames: return 1600 - case .showFeedTab: - return 1650 - case .FoldersHeader: return 1700 @@ -272,13 +268,6 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry { } else { return false } - - case let .showFeedTab(lhsText, lhsVar0Bool): - if case let .showFeedTab(rhsText, rhsVar0Bool) = rhs, lhsText == rhsText, lhsVar0Bool == rhsVar0Bool { - return true - } else { - return false - } case let .FoldersHeader(lhsText): if case let .FoldersHeader(rhsText) = rhs, lhsText == rhsText { @@ -468,13 +457,6 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry { arguments.presentController(controller, nil) }) - case let .showFeedTab(text, value): - return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enabled: true, sectionId: section, style: .blocks, updated: { value in - ngLog("[showFeedTab] invoked with \(value)", LOGTAG) - NGSettings.showFeedTab = value - arguments.updateTabs() - }) - case let .FoldersHeader(text): return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: section) @@ -650,10 +632,6 @@ private func nicegramSettingsControllerEntries(presentationData: PresentationDat l("NiceFeatures.Tabs.ShowNames"), NGSettings.showTabNames )) - entries.append(.showFeedTab( - l("Show Feed Tab"), - NGSettings.showFeedTab - )) entries.append(.FoldersHeader(l("NiceFeatures.Folders.Header"))) entries.append(.foldersAtBottom( @@ -839,23 +817,19 @@ public func nicegramSettingsController(context: AccountContext, accountsContexts controller?.view.window?.rootViewController } updateTabsImpl = { - updateTabs(with: context) - } - return controller -} - -public func updateTabs(with context: AccountContext) { - _ = updateCallListSettingsInteractively(accountManager: context.sharedContext.accountManager) { settings in - var settings = settings - settings.showTab = !settings.showTab - return settings - }.start(completed: { _ = updateCallListSettingsInteractively(accountManager: context.sharedContext.accountManager) { settings in var settings = settings settings.showTab = !settings.showTab return settings }.start(completed: { - ngLog("Tabs refreshed", LOGTAG) + _ = updateCallListSettingsInteractively(accountManager: context.sharedContext.accountManager) { settings in + var settings = settings + settings.showTab = !settings.showTab + return settings + }.start(completed: { + ngLog("Tabs refreshed", LOGTAG) + }) }) - }) + } + return controller } diff --git a/Package.resolved b/Package.resolved index 76fc88ea04c..1be2a815190 100644 --- a/Package.resolved +++ b/Package.resolved @@ -114,7 +114,7 @@ "location" : "git@bitbucket.org:mobyrix/nicegram-assistant-ios.git", "state" : { "branch" : "develop", - "revision" : "66d6fe9535b718018566630c5407c383ad20651d" + "revision" : "b1d4897f36e71c8faef3a06278d503c42f737e98" } }, { diff --git a/Telegram/Telegram-iOS/en.lproj/NiceLocalizable.strings b/Telegram/Telegram-iOS/en.lproj/NiceLocalizable.strings index 98e9ae4bd10..f400bc43295 100644 --- a/Telegram/Telegram-iOS/en.lproj/NiceLocalizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/NiceLocalizable.strings @@ -214,7 +214,3 @@ "NicegramCallRecord.StopAlertButtonCancel" = "Cancel"; "NicegramCallRecord.SavedMessage" = "Recorded Call saved to **Saved Messages**."; -/*Feed*/ -"NicegramFeed.Title" = "Feed"; -"NicegramFeed.Add" = "Add to Feed"; -"NicegramFeed.Remove" = "Remove from Feed"; diff --git a/crowdin.yml b/crowdin.yml index 7570bf2f71a..7df359a2a21 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,3 +1,5 @@ +"project_id": "378913" +"api_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJ3UUVxdmhVM3ZMT2EyWGljbVV5VCIsImp0aSI6IjY0MDRiZTFlOGIyOTVhNzg2ZGEyYmI0MmZmYjAwN2MyYmQ3MmM4MGI0YzJhZGEzNTk4MzBmMjEzZjQ4ZGFhNDkxYTcyNjgwYjJiYzFkOTUyIiwiaWF0IjoxNzIyODYzNDcxLjcwNDc3NywibmJmIjoxNzIyODYzNDcxLjcwNDc3OSwiZXhwIjoxNzU0Mzk5NDcxLjYyOTI5Mywic3ViIjoiMTUyNDUwMTYiLCJzY29wZXMiOlsicHJvamVjdCJdLCJkb21haW4iOm51bGwsImFzc29jaWF0aW9ucyI6WyIqIl0sInNlc3Npb24iOjB9.dLOqTsIngzAsXnrh2PRnzAtZVtosy0dnIPWViL9kVYnxGCGL3LJMPZ_cji-G9aHPhgmxERmBNeMp4Pynw7Y7NbtpT0QmgL9Gn6Ljjd5TTGwwS1UX81m-l69J6wTd1sRufs8X9vIAkxp-3boW7N0BkasBm9gRr_fBlnOFX_yV6mYj-gB5bRxI2CmakUcRVVZFk7hNfRT1LZnn60ghSllSoXM4dGF647Ey_Qm8kgerVqy1cshKc1X8jBKVLTXPTPnIpTESp4pFFbmDUlcnvvLa76FbW-5qBDXjPIEl6ASCqR8pIRV8Bh3n6-oaean7WBb_ZwPkrwxVczGlRd2io8xhVpQq33P6ebSnHp8hZFGS7kYyBZqBRfgzYTBSnNUCTWd-SQJzVeGiqzO-Qodi30X4AA7_nDYNun_soY3ma5sJsdaq2muMKXP2uWV9epLHp-VSTcIWEki0ozZqHKkUVlfzoWhtBKfQbLa5G48LQB9PVgOj3CQ4qgY8FPPdPk29-R_ytnQkXFTHXpudH0Ga_hrM7xtqYNmCttAVYZMGRoFZqH8GZs5KjSG2c0F9-x0554qi0fLgczJDOW15zjwZXRyUtqTD4SGaKQPvtYQn6AxBVRsUlLVUpPH7OLo8Kn7gMu3bx6fJhIURC6kA_Ap9YEgcnMRTuY_pTXSJi3VCJqP2iSw" "base_path": "." "base_url": "https://api.crowdin.com" "preserve_hierarchy": true diff --git a/submodules/AccountContext/Sources/AccountContext.swift b/submodules/AccountContext/Sources/AccountContext.swift index e61f813ef98..606a86e3598 100644 --- a/submodules/AccountContext/Sources/AccountContext.swift +++ b/submodules/AccountContext/Sources/AccountContext.swift @@ -1164,10 +1164,6 @@ public protocol AccountContext: AnyObject { func scheduleGroupCall(peerId: PeerId, parentController: ViewController) func joinGroupCall(peerId: PeerId, invite: String?, requestJoinAsPeerId: ((@escaping (PeerId?) -> Void) -> Void)?, activeCall: EngineGroupCallDescription) func requestCall(peerId: PeerId, isVideo: Bool, completion: @escaping () -> Void) -// MARK: Nicegram NCG-6373 Feed tab - var updateFeed: Signal { get } - func needUpdateFeed() -// } public struct AntiSpamBotConfiguration { diff --git a/submodules/ChatListUI/Sources/ChatContextMenus.swift b/submodules/ChatListUI/Sources/ChatContextMenus.swift index 723048ec962..92a2941beb2 100644 --- a/submodules/ChatListUI/Sources/ChatContextMenus.swift +++ b/submodules/ChatListUI/Sources/ChatContextMenus.swift @@ -2,10 +2,6 @@ import FeatHiddenChats import NGStrings // -// MARK: Nicegram NCG-6373 Feed tab -import NGData -import NGUI -// import Foundation import UIKit import SwiftSignalKit @@ -120,41 +116,7 @@ func chatContextMenuItems(context: AccountContext, peerId: PeerId, promoInfo: Ch } var items: [ContextMenuItem] = [] -// MARK: Nicegram NCG-6373 Feed tab - if case .chatList = source { - let isFeedPeerEqualPeer = NGSettings.feedPeerId == peerId - let text = isFeedPeerEqualPeer ? l("NicegramFeed.Remove") : l("NicegramFeed.Add") - let color: ContextMenuActionItemTextColor = isFeedPeerEqualPeer ? .destructive : .primary - items.append( - .action(ContextMenuActionItem( - text: text, - textColor: color, - icon: { theme in - let color = isFeedPeerEqualPeer ? theme.contextMenu.destructiveColor : theme.contextMenu.primaryColor - return generateTintedImage(image: UIImage(bundleImageName: "feed"), color: color) - }, - action: { _, f in - if isFeedPeerEqualPeer { - NGSettings.feedPeerId = NGSettings.zeroFeedPeerId - updateTabs(with: context) - } else { - let needUpdateTabs = - !NGSettings.showFeedTab || - NGSettings.feedPeerId == NGSettings.zeroFeedPeerId - NGSettings.feedPeerId = peerId - if needUpdateTabs { - NGSettings.showFeedTab = true - updateTabs(with: context) - } - } - context.needUpdateFeed() - f(.default) - } - )) - ) - } -// if case let .search(search) = source { switch search { case .recentPeers: diff --git a/submodules/DebugSettingsUI/Sources/DebugController.swift b/submodules/DebugSettingsUI/Sources/DebugController.swift index 4f86b53c075..a32e0ccb42c 100644 --- a/submodules/DebugSettingsUI/Sources/DebugController.swift +++ b/submodules/DebugSettingsUI/Sources/DebugController.swift @@ -739,8 +739,24 @@ private enum DebugControllerEntry: ItemListNodeEntry { }) case .sendNGLogs: return ItemListDisclosureItem(presentationData: presentationData, title: "Send Nicegram Logs", label: "", sectionId: self.section, style: .blocks, action: { - let _ = (Logger(rootPath: arguments.sharedContext.basePath, basePath: arguments.sharedContext.basePath + "/ngLogs").collectLogs() - |> deliverOnMainQueue).start(next: { logs in + let ngLogs = Logger( + rootPath: arguments.sharedContext.basePath, + basePath: arguments.sharedContext.basePath + "/ngLogs" + ).collectLogs() + + let accountPathName: String? = if let context = arguments.context { + accountRecordIdPathName(context.account.id) + } else { + nil + } + let callRecorderLogs = Logger.shared.collectLogs( + with: arguments.sharedContext.basePath, + accountPathName: accountPathName + ) + + let _ = (combineLatest(ngLogs, callRecorderLogs) |> deliverOnMainQueue) + .start(next: { logs in + let allLogs = logs.0 + logs.1 guard let context = arguments.context else { return } @@ -750,8 +766,8 @@ private enum DebugControllerEntry: ItemListNodeEntry { if let strongController = controller { strongController.dismiss() - - let messages = logs.map { (name, path) -> EnqueueMessage in + + let messages = allLogs.map { (name, path) -> EnqueueMessage in let id = Int64.random(in: Int64.min ... Int64.max) let file = TelegramMediaFile(fileId: MediaId(namespace: Namespaces.Media.LocalFile, id: id), partialReference: nil, resource: LocalFileReferenceMediaResource(localFilePath: path, randomId: id), previewRepresentations: [], videoThumbnails: [], immediateThumbnailData: nil, mimeType: "application/text", size: nil, attributes: [.FileName(fileName: name)], alternativeRepresentations: []) return .message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: file), threadId: nil, replyToMessageId: nil, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: []) diff --git a/submodules/TelegramCore/Sources/Utils/Log.swift b/submodules/TelegramCore/Sources/Utils/Log.swift index 4278b78c028..8936eb663cb 100644 --- a/submodules/TelegramCore/Sources/Utils/Log.swift +++ b/submodules/TelegramCore/Sources/Utils/Log.swift @@ -212,7 +212,35 @@ public final class Logger { return EmptyDisposable } } - +// MARK: Nicegram NCG-5828 call recording + public func collectLogs( + with basePath: String, + accountPathName: String? + ) -> Signal<[(String, String)], NoError> { + guard let accountPathName else { return .never() } + + return Signal { subscriber in + self.queue.async { + let logsPath: String = basePath + "/\(accountPathName)/calls" + var result: [(Date, String, String)] = [] + if let files = try? FileManager.default.contentsOfDirectory(at: URL(fileURLWithPath: logsPath), includingPropertiesForKeys: [URLResourceKey.creationDateKey], options: []) { + for url in files { + if url.lastPathComponent.hasSuffix(".log") { + if let creationDate = (try? url.resourceValues(forKeys: Set([.creationDateKey])))?.creationDate { + result.append((creationDate, url.lastPathComponent, url.path)) + } + } + } + } + result.sort(by: { $0.0 < $1.0 }) + subscriber.putNext(result.map { ($0.1, $0.2) }) + subscriber.putCompletion() + } + + return EmptyDisposable + } + } +// public func collectShortLog() -> Signal<[(Double, String)], NoError> { return Signal { subscriber in self.queue.async { diff --git a/submodules/TelegramUI/Sources/AccountContext.swift b/submodules/TelegramUI/Sources/AccountContext.swift index 5fda0189812..2b14a058837 100644 --- a/submodules/TelegramUI/Sources/AccountContext.swift +++ b/submodules/TelegramUI/Sources/AccountContext.swift @@ -267,16 +267,7 @@ public final class AccountContextImpl: AccountContext { public private(set) var isPremium: Bool public let imageCache: AnyObject? -// MARK: Nicegram NCG-6373 Feed tab - private let _updateFeed = Promise() - public var updateFeed: Signal { - _updateFeed.get() - } - public func needUpdateFeed() { - _updateFeed.set(.single(())) - } -// public init(sharedContext: SharedAccountContextImpl, account: Account, limitsConfiguration: LimitsConfiguration, contentSettings: ContentSettings, appConfiguration: AppConfiguration, availableReplyColors: EngineAvailableColorOptions, availableProfileColors: EngineAvailableColorOptions, temp: Bool = false) { self.sharedContextImpl = sharedContext diff --git a/submodules/TelegramUI/Sources/ApplicationContext.swift b/submodules/TelegramUI/Sources/ApplicationContext.swift index a60dc3a38ac..89264f0f67e 100644 --- a/submodules/TelegramUI/Sources/ApplicationContext.swift +++ b/submodules/TelegramUI/Sources/ApplicationContext.swift @@ -154,7 +154,7 @@ final class AuthorizedApplicationContext { private var showCallsTab: Bool private var showCallsTabDisposable: Disposable? private var enablePostboxTransactionsDiposable: Disposable? - + init(sharedApplicationContext: SharedApplicationContext, mainWindow: Window1, watchManagerArguments: Signal, context: AccountContextImpl, accountManager: AccountManager, showCallsTab: Bool, reinitializedNotificationSettings: @escaping () -> Void) { self.sharedApplicationContext = sharedApplicationContext diff --git a/submodules/TelegramUI/Sources/Chat/ChatControllerLoadDisplayNode.swift b/submodules/TelegramUI/Sources/Chat/ChatControllerLoadDisplayNode.swift index 548dd9d32b8..0f8afec3759 100644 --- a/submodules/TelegramUI/Sources/Chat/ChatControllerLoadDisplayNode.swift +++ b/submodules/TelegramUI/Sources/Chat/ChatControllerLoadDisplayNode.swift @@ -126,7 +126,7 @@ import AdsInfoScreen extension ChatControllerImpl { func loadDisplayNodeImpl() { - self.displayNode = ChatControllerNode(context: self.context, chatLocation: self.chatLocation, chatLocationContextHolder: self.chatLocationContextHolder, subject: self.subject, controllerInteraction: self.controllerInteraction!, chatPresentationInterfaceState: self.presentationInterfaceState, automaticMediaDownloadSettings: self.automaticMediaDownloadSettings, navigationBar: self.navigationBar, statusBar: self.statusBar, backgroundNode: self.chatBackgroundNode, controller: self, isFeed: self.isFeed) + self.displayNode = ChatControllerNode(context: self.context, chatLocation: self.chatLocation, chatLocationContextHolder: self.chatLocationContextHolder, subject: self.subject, controllerInteraction: self.controllerInteraction!, chatPresentationInterfaceState: self.presentationInterfaceState, automaticMediaDownloadSettings: self.automaticMediaDownloadSettings, navigationBar: self.navigationBar, statusBar: self.statusBar, backgroundNode: self.chatBackgroundNode, controller: self) if let currentItem = self.tempVoicePlaylistCurrentItem { self.chatDisplayNode.historyNode.voicePlaylistItemChanged(nil, currentItem) diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index c5711cb4718..0e270f95a0f 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -651,10 +651,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G self.chatDisplayNode.showListEmptyResults = self.showListEmptyResults } } -// MARK: Nicegram NCG-6373 Feed tab - let isFeed: Bool -// -// MARK: Nicegram NCG-6373 Feed tab, isFeed + public init( context: AccountContext, chatLocation: ChatLocation, @@ -669,12 +666,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G chatListFilter: Int32? = nil, chatNavigationStack: [ChatNavigationStackItem] = [], customChatNavigationStack: [EnginePeer.Id]? = nil, - params: ChatControllerParams? = nil, - isFeed: Bool = false + params: ChatControllerParams? = nil ) { -// MARK: Nicegram NCG-6373 Feed tab - self.isFeed = isFeed -// let _ = ChatControllerCount.modify { value in return value + 1 } @@ -5876,8 +5869,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G return interfaceState } }) - // MARK: Nicegram NCG-6373 Feed tab, !isFeed - if case .standard(.default) = mode, let channel = renderedPeer?.chatMainPeer as? TelegramChannel, case .broadcast = channel.info, !isFeed { + + if case .standard(.default) = mode, let channel = renderedPeer?.chatMainPeer as? TelegramChannel, case .broadcast = channel.info { var isRegularChat = false if let subject = subject { if case .message = subject { diff --git a/submodules/TelegramUI/Sources/ChatControllerNode.swift b/submodules/TelegramUI/Sources/ChatControllerNode.swift index 6f3d1b75394..5c1e2bba75e 100644 --- a/submodules/TelegramUI/Sources/ChatControllerNode.swift +++ b/submodules/TelegramUI/Sources/ChatControllerNode.swift @@ -444,13 +444,8 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate { private var displayVideoUnmuteTipDisposable: Disposable? private var onLayoutCompletions: [(ContainedViewLayoutTransition) -> Void] = [] -// MARK: Nicegram NCG-6373 Feed tab - private let isFeed: Bool - // MARK: Nicegram NCG-6373 Feed tab, isFeed - init(context: AccountContext, chatLocation: ChatLocation, chatLocationContextHolder: Atomic, subject: ChatControllerSubject?, controllerInteraction: ChatControllerInteraction, chatPresentationInterfaceState: ChatPresentationInterfaceState, automaticMediaDownloadSettings: MediaAutoDownloadSettings, navigationBar: NavigationBar?, statusBar: StatusBar?, backgroundNode: WallpaperBackgroundNode, controller: ChatControllerImpl?, isFeed: Bool) { -// MARK: Nicegram NCG-6373 Feed tab - self.isFeed = isFeed -// + + init(context: AccountContext, chatLocation: ChatLocation, chatLocationContextHolder: Atomic, subject: ChatControllerSubject?, controllerInteraction: ChatControllerInteraction, chatPresentationInterfaceState: ChatPresentationInterfaceState, automaticMediaDownloadSettings: MediaAutoDownloadSettings, navigationBar: NavigationBar?, statusBar: StatusBar?, backgroundNode: WallpaperBackgroundNode, controller: ChatControllerImpl?) { self.context = context self.chatLocation = chatLocation self.controllerInteraction = controllerInteraction @@ -893,11 +888,7 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate { } self.wrappingNode.contentNode.addSubnode(self.inputContextPanelContainer) -// MARK: Nicegram NCG-6373 Feed tab - if !isFeed { - self.wrappingNode.contentNode.addSubnode(self.inputPanelContainerNode) - } -// + self.wrappingNode.contentNode.addSubnode(self.inputPanelContainerNode) self.wrappingNode.contentNode.addSubnode(self.inputContextOverTextPanelContainer) self.inputPanelContainerNode.addSubnode(self.inputPanelClippingNode) @@ -2069,11 +2060,7 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate { inputPanelsHeight = 0.0 } } -// MARK: Nicegram NCG-6373 Feed tab - if isFeed { - inputPanelsHeight = 0.0 - } -// + let inputBackgroundInset: CGFloat if cleanInsets.bottom < insets.bottom { if case .regular = layout.metrics.widthClass, insets.bottom < 88.0 { diff --git a/submodules/TelegramUI/Sources/Nicegram/FeedController.swift b/submodules/TelegramUI/Sources/Nicegram/FeedController.swift deleted file mode 100644 index de65f4c1c1d..00000000000 --- a/submodules/TelegramUI/Sources/Nicegram/FeedController.swift +++ /dev/null @@ -1,73 +0,0 @@ -import UIKit -import Display -import AccountContext -import SwiftSignalKit -import NGData -import NGStrings - -final class FeedController: ViewController { - private let context: AccountContext - - private var feedController: ChatController? - private var updateFeedDiposable: Disposable? - - init(context: AccountContext) { - self.context = context - super.init(navigationBarPresentationData: nil) - - let image = UIImage(bundleImageName: "feed")? - .sd_resizedImage(with: .init(width: 30, height: 30), scaleMode: .aspectFit)? - .withRenderingMode(.alwaysTemplate) - tabBarItem = UITabBarItem( - title: l("NicegramFeed.Title"), - image: image, - tag: 1 - ) - - _ = context.sharedContext.presentationData.start { [weak self] presentationData in - self?.statusBar.statusBarStyle = presentationData.theme.rootController.statusBarStyle.style - } - - self.updateFeedDiposable = (context.updateFeed |> deliverOnMainQueue).start(next: { [weak self] _ in - guard let self else { return } - - self.setupFeed(with: context) - }) - - if NGSettings.feedPeerId != NGSettings.zeroFeedPeerId { - setupFeed(with: context) - } - } - - required public init(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - deinit { - updateFeedDiposable?.dispose() - updateFeedDiposable = nil - } - - override func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) { - super.containerLayoutUpdated(layout, transition: transition) - - feedController?.view.frame = view.bounds - feedController?.containerLayoutUpdated(layout, transition: transition) - } - - private func setupFeed(with context: AccountContext) { - feedController?.removeFromParent() - feedController?.view.removeFromSuperview() - - let feedController = ChatControllerImpl( - context: context, - chatLocation: .peer(id: NGSettings.feedPeerId), - isFeed: true - ) - - addChild(feedController) - view.addSubview(feedController.view) - - self.feedController = feedController - } -} diff --git a/submodules/TelegramUI/Sources/TelegramRootController.swift b/submodules/TelegramUI/Sources/TelegramRootController.swift index 29e48268da7..2b2520a909f 100644 --- a/submodules/TelegramUI/Sources/TelegramRootController.swift +++ b/submodules/TelegramUI/Sources/TelegramRootController.swift @@ -11,7 +11,6 @@ import NGGrumUI // // MARK: Nicegram imports import NGData -import NGStrings // import Foundation import UIKit @@ -90,9 +89,7 @@ public final class TelegramRootController: NavigationController, TelegramRootCon // MARK: Nicegram Assistant public var assistantController: ViewController? // -// MARK: Nicegram NCG-6373 Feed tab - private var feedController: FeedController? -// + private let context: AccountContext public var rootTabController: TabBarController? @@ -263,16 +260,6 @@ public final class TelegramRootController: NavigationController, TelegramRootCon if showCallsTab { controllers.append(callListController) } -// MARK: Nicegram NCG-6373 Feed tab - let feedController = FeedController( - context: self.context - ) - if NGSettings.showFeedTab && - NGSettings.feedPeerId != NGSettings.zeroFeedPeerId { - controllers.append(feedController) - } - self.feedController = feedController -// controllers.append(chatListController) // MARK: Nicegram Assistant @@ -381,12 +368,6 @@ public final class TelegramRootController: NavigationController, TelegramRootCon if showCallsTab { controllers.append(self.callListController!) } -// MARK: Nicegram NCG-6373 Feed tab - if NGSettings.showFeedTab && - NGSettings.feedPeerId != NGSettings.zeroFeedPeerId { - controllers.append(self.feedController!) - } -// controllers.append(self.chatListController!) // MARK: Nicegram Assistant diff --git a/submodules/TgVoipWebrtc/tgcalls b/submodules/TgVoipWebrtc/tgcalls index a631c2b749b..4a09bab5454 160000 --- a/submodules/TgVoipWebrtc/tgcalls +++ b/submodules/TgVoipWebrtc/tgcalls @@ -1 +1 @@ -Subproject commit a631c2b749b6e70379726bce75e418a1ee7d2640 +Subproject commit 4a09bab545486e603a5da50eae214766f9eb6430