mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
fix reactions push
This commit is contained in:
@@ -105,8 +105,8 @@ public final class AccountStateManager {
|
||||
return self.notificationMessagesPipe.signal()
|
||||
}
|
||||
|
||||
private let reactionNotificationsPipe = ValuePipe<[(reactionAuthor: Peer, message: Message)]>()
|
||||
public var reactionNotifications: Signal<[(reactionAuthor: Peer, message: Message)], NoError> {
|
||||
private let reactionNotificationsPipe = ValuePipe<[(reactionAuthor: Peer, reaction: String, message: Message, timestamp: Int32)]>()
|
||||
public var reactionNotifications: Signal<[(reactionAuthor: Peer, reaction: String, message: Message, timestamp: Int32)], NoError> {
|
||||
return self.reactionNotificationsPipe.signal()
|
||||
}
|
||||
|
||||
@@ -746,16 +746,15 @@ public final class AccountStateManager {
|
||||
|
||||
let timestamp = Int32(Date().timeIntervalSince1970)
|
||||
let minReactionTimestamp = timestamp - 20
|
||||
let reactionEvents = events.addedReactionEvents.compactMap { event -> (reactionAuthor: Peer, message: Message)? in
|
||||
let reactionEvents = events.addedReactionEvents.compactMap { event -> (reactionAuthor: Peer, reaction: String, message: Message, timestamp: Int32)? in
|
||||
if event.timestamp >= minReactionTimestamp {
|
||||
return (event.reactionAuthor, event.message)
|
||||
return (event.reactionAuthor, event.reaction, event.message, event.timestamp)
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
if !reactionEvents.isEmpty {
|
||||
self.reactionNotificationsPipe.putNext(reactionEvents)
|
||||
}
|
||||
self.reactionNotificationsPipe.putNext(reactionEvents)
|
||||
|
||||
|
||||
if !events.displayAlerts.isEmpty {
|
||||
self.displayAlertsPipe.putNext(events.displayAlerts)
|
||||
|
||||
Reference in New Issue
Block a user