Skip to content

Commit

Permalink
1.9.8 (447)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed Feb 18, 2025
1 parent 33962ca commit a7364e9
Show file tree
Hide file tree
Showing 14 changed files with 1,279 additions and 34 deletions.
6 changes: 3 additions & 3 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Nicegram/NGLogging/Sources/FirebaseAnalyticsSender.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ public class FirebaseAnalyticsSender {

extension FirebaseAnalyticsSender: AnalyticsSender {
public func trackEvent(_ name: String, params: [String: Any]) {
Analytics.logEvent(name, parameters: params)
Analytics.logEvent(
// Event names can be up to 40 characters long
// https://firebase.google.com/docs/reference/swift/firebaseanalytics/api/reference/Classes/Analytics#logevent_:parameters:
String(name.prefix(40)),
parameters: params
)
}
}
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
"kind" : "remoteSourceControl",
"location" : "[email protected]:mobyrix/nicegram-assistant-ios.git",
"state" : {
"branch" : "develop",
"revision" : "221350611fd0d4e4c2c0e2e46c96604e9ca7b99c"
"branch" : "feat/NCG-7303_spy_on_friends",
"revision" : "bc342168e96b2bba4b4e9c816a067e62432da7c5"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageDescription
let package = Package(
name: "nicegram-package",
dependencies: [
.package(url: "[email protected]:mobyrix/nicegram-assistant-ios.git", branch: "develop"),
.package(url: "[email protected]:mobyrix/nicegram-assistant-ios.git", branch: "feat/NCG-7303_spy_on_friends"),
.package(url: "[email protected]:mobyrix/nicegram-wallet-ios.git", branch: "develop")
]
)
3 changes: 3 additions & 0 deletions Telegram/Telegram-iOS/en.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,6 @@
/*Stars Purchase*/
"StarsPurchase.GetOnFragment" = "Get on Fragment";
"StarsPurchase.GetOnTelegram" = "Get on Telegram";

/*Spy On Friends*/
"SpyOnFriends.Title" = "Activities";
12 changes: 6 additions & 6 deletions submodules/ChatListUI/Sources/ChatListController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -819,13 +819,14 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
_ = (self.ready.get() |> deliverOnMainQueue)
.start { [weak self] flag in
guard let self else { return }
ngLog("===NCG-7102=== switchToFilter ready: flag=\(flag)")

if flag,
NGSettings.rememberFolderOnExit,
NGData.isPremium() {
let lastFolder = NGSettings.lastFolder
if lastFolder != -1 {
self.selectTab(id: .filter(lastFolder), preselected: true)
self.chatListDisplayNode.mainContainerNode.resetPendingItemNode()
self.selectTab(id: .filter(lastFolder))
}
}
}
Expand Down Expand Up @@ -4052,8 +4053,8 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
}
}))
}
// MARK: Nicegram NCG-7102 bottom folders fix, preselected
private func selectTab(id: ChatListFilterTabEntryId, preselected: Bool = false) {

private func selectTab(id: ChatListFilterTabEntryId) {
if self.parent == nil {
if let navigationController = self.context.sharedContext.mainWindow?.viewController as? NavigationController {
for controller in navigationController.viewControllers {
Expand Down Expand Up @@ -4098,8 +4099,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
if strongSelf.chatListDisplayNode.inlineStackContainerNode != nil {
strongSelf.setInlineChatList(location: nil)
}
// MARK: Nicegram NCG-7102 bottom folders fix, preselected
strongSelf.chatListDisplayNode.mainContainerNode.switchToFilter(id: updatedFilter.flatMap { .filter($0.id) } ?? .all, preselected: preselected)
strongSelf.chatListDisplayNode.mainContainerNode.switchToFilter(id: updatedFilter.flatMap { .filter($0.id) } ?? .all)
}
})
}
Expand Down
22 changes: 9 additions & 13 deletions submodules/ChatListUI/Sources/ChatListControllerNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -809,9 +809,9 @@ public final class ChatListContainerNode: ASDisplayNode, ASGestureRecognizerDele
}
}

public func switchToFilter(id: ChatListFilterTabEntryId, animated: Bool = true, preselected: Bool = false, completion: (() -> Void)? = nil) {
public func switchToFilter(id: ChatListFilterTabEntryId, animated: Bool = true, completion: (() -> Void)? = nil) {
// MARK: Nicegram NCG-7102 bottom folders fix
ngLog("===NCG-7102=== switchToFilter enter: id = \(id), selectedId = \(selectedId), itemNodes = \(itemNodes.keys), pendingItemNode = \(pendingItemNode?.0)")
ngLog("===NCG-7102=== switchToFilter: id = \(id), itemNodes = \(itemNodes), pendingItemNode = \(pendingItemNode)")
//
self.onFilterSwitch?()
if id != self.selectedId, let index = self.availableFilters.firstIndex(where: { $0.id == id }) {
Expand All @@ -834,12 +834,6 @@ public final class ChatListContainerNode: ASDisplayNode, ASGestureRecognizerDele
itemNode.emptyNode?.restartAnimation()
completion?()
} else if self.pendingItemNode == nil {
// MARK: Nicegram NCG-7102 bottom folders fix
var autoSetReady = !animated
if preselected {
autoSetReady = true
}
//
let itemNode = ChatListContainerItemNode(context: self.context, controller: self.controller, location: self.location, filter: self.availableFilters[index].filter, chatListMode: self.chatListMode, previewing: self.previewing, isInlineMode: self.isInlineMode, controlsHistoryPreload: self.controlsHistoryPreload, presentationData: self.presentationData, animationCache: self.animationCache, animationRenderer: self.animationRenderer, becameEmpty: { [weak self] filter in
self?.filterBecameEmpty(filter)
}, emptyAction: { [weak self] filter in
Expand All @@ -848,14 +842,11 @@ public final class ChatListContainerNode: ASDisplayNode, ASGestureRecognizerDele
self?.secondaryEmptyAction()
}, openArchiveSettings: { [weak self] in
self?.openArchiveSettings()
// MARK: Nicegram NCG-7102 bottom folders fix, autoSetReady
}, autoSetReady: autoSetReady, isMainTab: index == 0)
}, autoSetReady: !animated, isMainTab: index == 0)
self.pendingItemNode?.2.dispose()
let disposable = MetaDisposable()
self.pendingItemNode = (id, itemNode, disposable)
// MARK: Nicegram NCG-7102 bottom folders fix
ngLog("===NCG-7102=== switchToFilter setup pendingItemNode = \(pendingItemNode?.0)")
//

if !animated {
self.selectedId = id
self.applyItemNodeAsCurrent(id: id, itemNode: itemNode)
Expand Down Expand Up @@ -1065,6 +1056,11 @@ public final class ChatListContainerNode: ASDisplayNode, ASGestureRecognizerDele
}
}
}
// MARK: Nicegram NCG-7102 bottom folders fix
public func resetPendingItemNode() {
self.pendingItemNode = nil
}
//
}

final class ChatListControllerNode: ASDisplayNode, ASGestureRecognizerDelegate {
Expand Down
Loading

0 comments on commit a7364e9

Please sign in to comment.