mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Clean
This commit is contained in:
parent
1893ccac76
commit
1a12487292
3 changed files with 17 additions and 9 deletions
|
@ -31,6 +31,10 @@ public class Message : NSObject, NSCoding { // NSObject/NSCoding conformance is
|
||||||
if let sentTimestamp = coder.decodeObject(forKey: "sentTimestamp") as! UInt64? { self.sentTimestamp = sentTimestamp }
|
if let sentTimestamp = coder.decodeObject(forKey: "sentTimestamp") as! UInt64? { self.sentTimestamp = sentTimestamp }
|
||||||
if let receivedTimestamp = coder.decodeObject(forKey: "receivedTimestamp") as! UInt64? { self.receivedTimestamp = receivedTimestamp }
|
if let receivedTimestamp = coder.decodeObject(forKey: "receivedTimestamp") as! UInt64? { self.receivedTimestamp = receivedTimestamp }
|
||||||
if let recipient = coder.decodeObject(forKey: "recipient") as! String? { self.recipient = recipient }
|
if let recipient = coder.decodeObject(forKey: "recipient") as! String? { self.recipient = recipient }
|
||||||
|
if let sender = coder.decodeObject(forKey: "sender") as! String? { self.sender = sender }
|
||||||
|
if let groupPublicKey = coder.decodeObject(forKey: "groupPublicKey") as! String? { self.groupPublicKey = groupPublicKey }
|
||||||
|
if let openGroupServerMessageID = coder.decodeObject(forKey: "openGroupServerMessageID") as! UInt64? { self.openGroupServerMessageID = openGroupServerMessageID }
|
||||||
|
if let openGroupServerTimestamp = coder.decodeObject(forKey: "openGroupServerTimestamp") as! UInt64? { self.openGroupServerTimestamp = openGroupServerTimestamp }
|
||||||
}
|
}
|
||||||
|
|
||||||
public func encode(with coder: NSCoder) {
|
public func encode(with coder: NSCoder) {
|
||||||
|
@ -39,6 +43,10 @@ public class Message : NSObject, NSCoding { // NSObject/NSCoding conformance is
|
||||||
coder.encode(sentTimestamp, forKey: "sentTimestamp")
|
coder.encode(sentTimestamp, forKey: "sentTimestamp")
|
||||||
coder.encode(receivedTimestamp, forKey: "receivedTimestamp")
|
coder.encode(receivedTimestamp, forKey: "receivedTimestamp")
|
||||||
coder.encode(recipient, forKey: "recipient")
|
coder.encode(recipient, forKey: "recipient")
|
||||||
|
coder.encode(sender, forKey: "sender")
|
||||||
|
coder.encode(groupPublicKey, forKey: "groupPublicKey")
|
||||||
|
coder.encode(openGroupServerMessageID, forKey: "openGroupServerMessageID")
|
||||||
|
coder.encode(openGroupServerTimestamp, forKey: "openGroupServerTimestamp")
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Proto Conversion
|
// MARK: Proto Conversion
|
||||||
|
|
|
@ -196,8 +196,8 @@ NSString *NSStringFromOWSInteractionType(OWSInteractionType value)
|
||||||
// In open groups messages should be sorted by server timestamp. `sortId` represents the order in which messages
|
// In open groups messages should be sorted by server timestamp. `sortId` represents the order in which messages
|
||||||
// were processed. Since in the open group poller we sort messages by their server timestamp, sorting by `sortId` is
|
// were processed. Since in the open group poller we sort messages by their server timestamp, sorting by `sortId` is
|
||||||
// effectively the same as sorting by server timestamp.
|
// effectively the same as sorting by server timestamp.
|
||||||
// sortId == receivedAtTimestamp for open group messages.
|
// sortId == serverTimestamp for open group messages.
|
||||||
// sortId == sendTimestamp for one-to-one and closed group messages.
|
// sortId == timestamp (the sent timestamp) for one-to-one and closed group messages.
|
||||||
sortId1 = self.sortId;
|
sortId1 = self.sortId;
|
||||||
sortId2 = other.sortId;
|
sortId2 = other.sortId;
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ public enum MessageReceiver {
|
||||||
message.recipient = userPublicKey
|
message.recipient = userPublicKey
|
||||||
message.sentTimestamp = envelope.timestamp
|
message.sentTimestamp = envelope.timestamp
|
||||||
message.receivedTimestamp = NSDate.millisecondTimestamp()
|
message.receivedTimestamp = NSDate.millisecondTimestamp()
|
||||||
if (isOpenGroupMessage) {
|
if isOpenGroupMessage {
|
||||||
message.openGroupServerTimestamp = envelope.serverTimestamp
|
message.openGroupServerTimestamp = envelope.serverTimestamp
|
||||||
}
|
}
|
||||||
message.groupPublicKey = groupPublicKey
|
message.groupPublicKey = groupPublicKey
|
||||||
|
|
Loading…
Reference in a new issue