Skip to content

Commit

Permalink
Business fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac committed Mar 1, 2024
1 parent addc4dc commit 9ce2c2d
Show file tree
Hide file tree
Showing 10 changed files with 1,127 additions and 8 deletions.
18 changes: 18 additions & 0 deletions submodules/TelegramCore/Sources/State/AccountViewTracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ public final class AccountViewTracker {

var resetPeerHoleManagement: ((PeerId) -> Void)?

private var quickRepliesUpdateDisposable: Disposable?
private var quickRepliesUpdateTimestamp: Double = 0.0

init(account: Account) {
self.account = account
self.accountPeerId = account.peerId
Expand All @@ -373,6 +376,7 @@ public final class AccountViewTracker {
self.updatedViewCountDisposables.dispose()
self.updatedReactionsDisposables.dispose()
self.externallyUpdatedPeerIdDisposable.dispose()
self.quickRepliesUpdateDisposable?.dispose()
}

func reset() {
Expand Down Expand Up @@ -2548,6 +2552,20 @@ public final class AccountViewTracker {
}
}
}

public func keepQuickRepliesApproximatelyUpdated() {
self.queue.async {
guard let account = self.account else {
return
}
let timestamp = CFAbsoluteTimeGetCurrent()
if self.quickRepliesUpdateTimestamp + 16 * 60 * 60 < timestamp {
self.quickRepliesUpdateTimestamp = timestamp
self.quickRepliesUpdateDisposable?.dispose()
self.quickRepliesUpdateDisposable = _internal_keepShortcutMessagesUpdated(account: account).startStrict()
}
}
}
}

public final class ExtractedChatListItemCachedData: Hashable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,7 @@ private func synchronizeChatListFilters(transaction: Transaction, accountPeerId:
state.filters = remoteFilters
state.remoteFilters = state.filters
state.displayTags = remoteTagsEnabled
state.remoteDisplayTags = state.displayTags
return state
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public final class ListActionItemComponent: Component {
contentHeight += component.contentInsets.top

if component.leftIcon != nil {
contentLeftInset += 52.0
contentLeftInset += 46.0
}

let titleSize = self.title.update(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")

swift_library(
name = "ListItemSwipeOptionContainer",
module_name = "ListItemSwipeOptionContainer",
srcs = glob([
"Sources/**/*.swift",
]),
copts = [
"-warnings-as-errors",
],
deps = [
"//submodules/Display",
"//submodules/ComponentFlow",
"//submodules/Components/MultilineTextComponent",
"//submodules/Components/ComponentDisplayAdapters",
],
visibility = [
"//visibility:public",
],
)
Loading

0 comments on commit 9ce2c2d

Please sign in to comment.