Skip to content

Commit 67ed6f9

Browse files
author
Isaac
committed
Stars ref
(cherry picked from commit 7d3ab98)
1 parent 8b6389e commit 67ed6f9

File tree

6 files changed

+517
-233
lines changed

6 files changed

+517
-233
lines changed

submodules/AccountContext/Sources/AccountContext.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,10 +896,10 @@ public enum JoinAffiliateProgramScreenMode {
896896

897897
public final class Active {
898898
public let targetPeer: EnginePeer
899-
public let bot: TelegramConnectedStarRefBotList.Item
900-
public let copyLink: (TelegramConnectedStarRefBotList.Item) -> Void
899+
public let bot: EngineConnectedStarRefBotsContext.Item
900+
public let copyLink: (EngineConnectedStarRefBotsContext.Item) -> Void
901901

902-
public init(targetPeer: EnginePeer, bot: TelegramConnectedStarRefBotList.Item, copyLink: @escaping (TelegramConnectedStarRefBotList.Item) -> Void) {
902+
public init(targetPeer: EnginePeer, bot: EngineConnectedStarRefBotsContext.Item, copyLink: @escaping (EngineConnectedStarRefBotsContext.Item) -> Void) {
903903
self.targetPeer = targetPeer
904904
self.bot = bot
905905
self.copyLink = copyLink

submodules/TelegramCore/Sources/State/AccountStateManager.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,11 @@ public final class AccountStateManager {
333333
return self.sentScheduledMessageIdsPipe.signal()
334334
}
335335

336+
fileprivate let starRefBotConnectionEventsPipe = ValuePipe<StarRefBotConnectionEvent>()
337+
public var starRefBotConnectionEvents: Signal<StarRefBotConnectionEvent, NoError> {
338+
return self.starRefBotConnectionEventsPipe.signal()
339+
}
340+
336341
private var updatedWebpageContexts: [MediaId: UpdatedWebpageSubscriberContext] = [:]
337342
private var updatedPeersNearbyContext = UpdatedPeersNearbySubscriberContext()
338343
private var updatedRevenueBalancesContext = UpdatedRevenueBalancesSubscriberContext()
@@ -1804,6 +1809,10 @@ public final class AccountStateManager {
18041809
self.removePossiblyDeliveredMessagesUniqueIds.merge(uniqueIds, uniquingKeysWith: { _, rhs in rhs })
18051810
}
18061811
}
1812+
1813+
func addStarRefBotConnectionEvent(event: StarRefBotConnectionEvent) {
1814+
self.starRefBotConnectionEventsPipe.putNext(event)
1815+
}
18071816
}
18081817

18091818
private let impl: QueueLocalObject<Impl>
@@ -2183,6 +2192,18 @@ public final class AccountStateManager {
21832192
public func synchronouslyIsMessageDeletedRemotely(ids: [EngineMessage.Id]) -> [EngineMessage.Id] {
21842193
return self.messagesRemovedContext.synchronouslyIsMessageDeletedRemotely(ids: ids)
21852194
}
2195+
2196+
func starRefBotConnectionEvents() -> Signal<StarRefBotConnectionEvent, NoError> {
2197+
return self.impl.signalWith { impl, subscriber in
2198+
return impl.starRefBotConnectionEventsPipe.signal().start(next: subscriber.putNext)
2199+
}
2200+
}
2201+
2202+
func addStarRefBotConnectionEvent(event: StarRefBotConnectionEvent) {
2203+
self.impl.with { impl in
2204+
impl.addStarRefBotConnectionEvent(event: event)
2205+
}
2206+
}
21862207
}
21872208

21882209
func resolveNotificationSettings(list: [TelegramPeerNotificationSettings], defaultSettings: MessageNotificationSettings) -> (sound: PeerMessageSound, notify: Bool, displayContents: Bool) {

0 commit comments

Comments
 (0)