make it work for multi device

pull/484/head
Ryan Zhao 4 years ago
parent 94c1879263
commit b827b9e1ba

@ -5,6 +5,8 @@ public final class UnsendRequest: ControlMessage {
public var timestamp: UInt64? public var timestamp: UInt64?
public var author: String? public var author: String?
public override var isSelfSendValid: Bool { true }
// MARK: Validation // MARK: Validation
public override var isValid: Bool { public override var isValid: Bool {
guard super.isValid else { return false } guard super.isValid else { return false }

@ -134,8 +134,9 @@ public final class MessageSender : NSObject {
// a configuration message // a configuration message
// a sync message // a sync message
// a closed group control message of type `new` // a closed group control message of type `new`
// an unsend request
let isNewClosedGroupControlMessage = given(message as? ClosedGroupControlMessage) { if case .new = $0.kind { return true } else { return false } } ?? false let isNewClosedGroupControlMessage = given(message as? ClosedGroupControlMessage) { if case .new = $0.kind { return true } else { return false } } ?? false
guard !isSelfSend || message is ConfigurationMessage || isSyncMessage || isNewClosedGroupControlMessage else { guard !isSelfSend || message is ConfigurationMessage || isSyncMessage || isNewClosedGroupControlMessage || message is UnsendRequest else {
storage.write(with: { transaction in storage.write(with: { transaction in
MessageSender.handleSuccessfulMessageSend(message, to: destination, using: transaction) MessageSender.handleSuccessfulMessageSend(message, to: destination, using: transaction)
seal.fulfill(()) seal.fulfill(())

Loading…
Cancel
Save