no message

This commit is contained in:
Peter
2016-11-02 03:14:12 +03:00
parent 6bde6d964c
commit 4d308bcb69
14 changed files with 225 additions and 114 deletions

View File

@@ -77,12 +77,16 @@ public struct MessageId: Hashable, Comparable, CustomStringConvertible {
}
public func ==(lhs: MessageId, rhs: MessageId) -> Bool {
return lhs.id == rhs.id && lhs.namespace == rhs.namespace
return lhs.id == rhs.id && lhs.namespace == rhs.namespace && lhs.peerId == rhs.peerId
}
public func <(lhs: MessageId, rhs: MessageId) -> Bool {
if lhs.namespace == rhs.namespace {
return lhs.id < rhs.id
if lhs.id == rhs.id {
return lhs.peerId < rhs.peerId
} else {
return lhs.id < rhs.id
}
} else {
return lhs.namespace < rhs.namespace
}