mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 11:23:48 +00:00
Cleanup
This commit is contained in:
parent
cd64a206b6
commit
0505eb574e
@ -5,6 +5,8 @@ import Foundation
|
||||
import Postbox
|
||||
#endif
|
||||
|
||||
public let scheduleWhenOnlineTimestamp: Int32 = 0x7ffffffe
|
||||
|
||||
public class OutgoingScheduleInfoMessageAttribute: MessageAttribute {
|
||||
public let scheduleTime: Int32
|
||||
|
||||
|
@ -195,7 +195,7 @@ public extension Message {
|
||||
func effectivelyFailed(timestamp: Int32) -> Bool {
|
||||
if self.flags.contains(.Failed) {
|
||||
return true
|
||||
} else if self.id.namespace == Namespaces.Message.ScheduledCloud && self.timestamp != 0x7FFFFFFE {
|
||||
} else if self.id.namespace == Namespaces.Message.ScheduledCloud && self.timestamp != scheduleWhenOnlineTimestamp {
|
||||
return timestamp > self.timestamp + 60
|
||||
} else {
|
||||
return false
|
||||
|
@ -4,6 +4,7 @@ import Display
|
||||
import AsyncDisplayKit
|
||||
import TelegramPresentationData
|
||||
import Postbox
|
||||
import SyncCore
|
||||
import AccountContext
|
||||
|
||||
private let timezoneOffset: Int32 = {
|
||||
@ -32,8 +33,8 @@ final class ChatMessageDateHeader: ListViewItemHeader {
|
||||
self.presentationData = presentationData
|
||||
self.context = context
|
||||
self.action = action
|
||||
if timestamp == 0x7FFFFFFE {
|
||||
self.roundedTimestamp = 0x7FFFFFFE
|
||||
if timestamp == scheduleWhenOnlineTimestamp {
|
||||
self.roundedTimestamp = scheduleWhenOnlineTimestamp
|
||||
} else if timestamp == Int32.max {
|
||||
self.roundedTimestamp = timestamp / (granularity) * (granularity)
|
||||
} else {
|
||||
@ -153,7 +154,7 @@ final class ChatMessageDateHeaderNode: ListViewItemHeaderNode {
|
||||
}
|
||||
|
||||
if scheduled {
|
||||
if localTimestamp == 0x7FFFFFFE {
|
||||
if localTimestamp == scheduleWhenOnlineTimestamp {
|
||||
text = presentationData.strings.ScheduledMessages_ScheduledOnline
|
||||
} else if timeinfo.tm_year == timeinfoNow.tm_year && timeinfo.tm_yday == timeinfoNow.tm_yday {
|
||||
text = presentationData.strings.ScheduledMessages_ScheduledToday
|
||||
|
@ -64,7 +64,7 @@ final class ChatScheduleTimeController: ViewController {
|
||||
override public func loadDisplayNode() {
|
||||
self.displayNode = ChatScheduleTimeControllerNode(context: self.context, mode: self.mode, currentTime: self.currentTime, minimalTime: self.minimalTime, dismissByTapOutside: self.dismissByTapOutside)
|
||||
self.controllerNode.completion = { [weak self] time in
|
||||
self?.completion(time != 0x7FFFFFFE ? time + 5 : time)
|
||||
self?.completion(time != scheduleWhenOnlineTimestamp ? time + 5 : time)
|
||||
self?.dismiss()
|
||||
}
|
||||
self.controllerNode.dismiss = { [weak self] in
|
||||
|
@ -245,7 +245,7 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel
|
||||
}
|
||||
|
||||
@objc func onlineButtonPressed() {
|
||||
self.completion?(0x7FFFFFFE)
|
||||
self.completion?(scheduleWhenOnlineTimestamp)
|
||||
}
|
||||
|
||||
@objc func dimTapGesture(_ recognizer: UITapGestureRecognizer) {
|
||||
|
@ -20,7 +20,7 @@ func stringForMessageTimestampStatus(accountPeerId: PeerId, message: Message, da
|
||||
timestamp = message.timestamp
|
||||
}
|
||||
var dateText = stringForMessageTimestamp(timestamp: timestamp, dateTimeFormat: dateTimeFormat)
|
||||
if timestamp == 0x7FFFFFFE {
|
||||
if timestamp == scheduleWhenOnlineTimestamp {
|
||||
dateText = " "
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user