mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Remove lightly used receivedTimestamp
This commit is contained in:
parent
d49b83685f
commit
33978592d3
4 changed files with 2 additions and 4 deletions
|
|
@ -14,7 +14,7 @@ import SwiftUI
|
|||
|
||||
extension MessageEntity {
|
||||
var timestamp: Date {
|
||||
let time = messageTimestamp <= 0 ? receivedTimestamp : messageTimestamp
|
||||
let time = messageTimestamp
|
||||
return Date(timeIntervalSince1970: TimeInterval(time))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -795,7 +795,6 @@ func textMessageAppPacket(
|
|||
let newMessage = MessageEntity(context: context)
|
||||
newMessage.messageId = Int64(packet.id)
|
||||
newMessage.messageTimestamp = Int32(bitPattern: packet.rxTime)
|
||||
newMessage.receivedTimestamp = Int32(Date().timeIntervalSince1970)
|
||||
newMessage.receivedACK = false
|
||||
newMessage.snr = packet.rxSnr
|
||||
newMessage.rssi = packet.rxRssi
|
||||
|
|
|
|||
|
|
@ -159,7 +159,6 @@
|
|||
<attribute name="read" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
||||
<attribute name="realACK" optional="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
||||
<attribute name="receivedACK" attributeType="Boolean" usesScalarValueType="YES"/>
|
||||
<attribute name="receivedTimestamp" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="replyID" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="rssi" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="snr" optional="YES" attributeType="Float" defaultValueString="0.0" usesScalarValueType="YES"/>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public func getStoreAndForwardMessageIds(seconds: Int, context: NSManagedObjectC
|
|||
let fetchMessagesRequest = MessageEntity.fetchRequest()
|
||||
let timeRange = Calendar.current.date(byAdding: .minute, value: time, to: Date())
|
||||
let milleseconds = Int32(timeRange?.timeIntervalSince1970 ?? 0)
|
||||
fetchMessagesRequest.predicate = NSPredicate(format: "receivedTimestamp >= %d", milleseconds)
|
||||
fetchMessagesRequest.predicate = NSPredicate(format: "messageTimestamp >= %d", milleseconds)
|
||||
|
||||
do {
|
||||
let fetchedMessages = try context.fetch(fetchMessagesRequest)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue