Fix send when online visibility

This commit is contained in:
Ilya Laktyushin
2023-03-10 18:31:04 +04:00
parent 66619d2e17
commit e61f8f5e1d
3 changed files with 15 additions and 6 deletions

View File

@@ -246,8 +246,11 @@ func presentLegacyMediaPickerGallery(context: AccountContext, peer: EnginePeer?,
return false
}
var sendWhenOnlineAvailable = false
if let presence = peerView.peerPresences[peer.id] as? TelegramUserPresence, case .present = presence.status {
sendWhenOnlineAvailable = true
if let presence = peerView.peerPresences[peer.id] as? TelegramUserPresence, case let .present(until) = presence.status {
let currentTime = Int32(CFAbsoluteTimeGetCurrent() + kCFAbsoluteTimeIntervalSince1970)
if currentTime > until {
sendWhenOnlineAvailable = true
}
}
if peer.id.namespace == Namespaces.Peer.CloudUser && peer.id.id._internalGetInt64Value() == 777000 {
sendWhenOnlineAvailable = false