Merge branch 'charlesmchen/udStatusSync'
This commit is contained in:
commit
45119d7efc
@ -234,10 +234,15 @@ message Verified {
|
||||
|
||||
message SyncMessage {
|
||||
message Sent {
|
||||
optional string destination = 1;
|
||||
optional uint64 timestamp = 2;
|
||||
optional DataMessage message = 3;
|
||||
optional uint64 expirationStartTimestamp = 4;
|
||||
message UnidentifiedDeliveryStatus {
|
||||
optional string destination = 1;
|
||||
optional bool unidentified = 2;
|
||||
}
|
||||
optional string destination = 1;
|
||||
optional uint64 timestamp = 2;
|
||||
optional DataMessage message = 3;
|
||||
optional uint64 expirationStartTimestamp = 4;
|
||||
repeated UnidentifiedDeliveryStatus unidentifiedStatus = 5;
|
||||
}
|
||||
|
||||
message Contacts {
|
||||
|
||||
@ -146,7 +146,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
}
|
||||
|
||||
[outgoingMessage saveWithTransaction:transaction];
|
||||
[outgoingMessage updateWithWasSentFromLinkedDeviceWithTransaction:transaction];
|
||||
[outgoingMessage updateWithWasSentFromLinkedDeviceWithUDRecipientIds:transcript.udRecipientIds
|
||||
nonUdRecipientIds:transcript.nonUdRecipientIds
|
||||
transaction:transaction];
|
||||
[[OWSDisappearingMessagesJob sharedJob] becomeConsistentWithConfigurationForMessage:outgoingMessage
|
||||
contactsManager:self.contactsManager
|
||||
transaction:transaction];
|
||||
|
||||
@ -36,6 +36,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic, readonly, nullable) TSQuotedMessage *quotedMessage;
|
||||
@property (nonatomic, readonly, nullable) OWSContact *contact;
|
||||
|
||||
// If either nonUdRecipientIds or udRecipientIds is nil,
|
||||
// this is either a legacy transcript or it reflects a legacy sync message.
|
||||
@property (nonatomic, readonly, nullable) NSArray<NSString *> *nonUdRecipientIds;
|
||||
@property (nonatomic, readonly, nullable) NSArray<NSString *> *udRecipientIds;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@ -46,6 +46,29 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
_quotedMessage = [TSQuotedMessage quotedMessageForDataMessage:_dataMessage thread:_thread transaction:transaction];
|
||||
_contact = [OWSContacts contactForDataMessage:_dataMessage transaction:transaction];
|
||||
|
||||
if (sentProto.unidentifiedStatus.count > 0) {
|
||||
NSMutableArray<NSString *> *nonUdRecipientIds = [NSMutableArray new];
|
||||
NSMutableArray<NSString *> *udRecipientIds = [NSMutableArray new];
|
||||
for (SSKProtoSyncMessageSentUnidentifiedDeliveryStatus *statusProto in sentProto.unidentifiedStatus) {
|
||||
if (!statusProto.hasDestination || statusProto.destination.length < 1) {
|
||||
OWSFailDebug(@"Delivery status proto is missing destination.");
|
||||
continue;
|
||||
}
|
||||
if (!statusProto.hasUnidentified) {
|
||||
OWSFailDebug(@"Delivery status proto is missing value.");
|
||||
continue;
|
||||
}
|
||||
NSString *recipientId = statusProto.destination;
|
||||
if (statusProto.unidentified) {
|
||||
[udRecipientIds addObject:recipientId];
|
||||
} else {
|
||||
[nonUdRecipientIds addObject:recipientId];
|
||||
}
|
||||
}
|
||||
_nonUdRecipientIds = [nonUdRecipientIds copy];
|
||||
_udRecipientIds = [udRecipientIds copy];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
@ -67,6 +67,31 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
[sentBuilder setMessage:dataMessage];
|
||||
[sentBuilder setExpirationStartTimestamp:self.message.timestamp];
|
||||
|
||||
for (NSString *recipientId in self.message.recipientIds) {
|
||||
TSOutgoingMessageRecipientState *_Nullable recipientState =
|
||||
[self.message recipientStateForRecipientId:recipientId];
|
||||
if (!recipientState) {
|
||||
OWSFailDebug(@"missing recipient state for: %@", recipientId);
|
||||
continue;
|
||||
}
|
||||
if (recipientState.state != OWSOutgoingMessageRecipientStateSent) {
|
||||
continue;
|
||||
}
|
||||
|
||||
NSError *error;
|
||||
SSKProtoSyncMessageSentUnidentifiedDeliveryStatusBuilder *statusBuilder =
|
||||
[SSKProtoSyncMessageSentUnidentifiedDeliveryStatus builder];
|
||||
[statusBuilder setDestination:recipientId];
|
||||
[statusBuilder setUnidentified:recipientState.wasSentByUD];
|
||||
SSKProtoSyncMessageSentUnidentifiedDeliveryStatus *_Nullable status =
|
||||
[statusBuilder buildAndReturnError:&error];
|
||||
if (error || !status) {
|
||||
OWSFailDebug(@"Couldn't build UD status proto: %@", error);
|
||||
continue;
|
||||
}
|
||||
[sentBuilder addUnidentifiedStatus:status];
|
||||
}
|
||||
|
||||
NSError *error;
|
||||
SSKProtoSyncMessageSent *_Nullable sentProto = [sentBuilder buildAndReturnError:&error];
|
||||
if (error || !sentProto) {
|
||||
|
||||
@ -206,7 +206,9 @@ typedef NS_ENUM(NSInteger, TSGroupMetaMessage) {
|
||||
deliveryTimestamp:(NSNumber *_Nullable)deliveryTimestamp
|
||||
transaction:(YapDatabaseReadWriteTransaction *)transaction;
|
||||
|
||||
- (void)updateWithWasSentFromLinkedDeviceWithTransaction:(YapDatabaseReadWriteTransaction *)transaction;
|
||||
- (void)updateWithWasSentFromLinkedDeviceWithUDRecipientIds:(nullable NSArray<NSString *> *)udRecipientIds
|
||||
nonUdRecipientIds:(nullable NSArray<NSString *> *)nonUdRecipientIds
|
||||
transaction:(YapDatabaseReadWriteTransaction *)transaction;
|
||||
|
||||
// This method is used to rewrite the recipient list with a single recipient.
|
||||
// It is used to reply to a "group info request", which should only be
|
||||
|
||||
@ -725,21 +725,57 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)updateWithWasSentFromLinkedDeviceWithTransaction:(YapDatabaseReadWriteTransaction *)transaction
|
||||
{
|
||||
- (void)updateWithWasSentFromLinkedDeviceWithUDRecipientIds:(nullable NSArray<NSString *> *)udRecipientIds
|
||||
nonUdRecipientIds:(nullable NSArray<NSString *> *)nonUdRecipientIds
|
||||
transaction:(YapDatabaseReadWriteTransaction *)transaction {
|
||||
OWSAssertDebug(transaction);
|
||||
|
||||
[self applyChangeToSelfAndLatestCopy:transaction
|
||||
changeBlock:^(TSOutgoingMessage *message) {
|
||||
// Mark any "sending" recipients as "sent."
|
||||
for (TSOutgoingMessageRecipientState *recipientState in message.recipientStateMap
|
||||
.allValues) {
|
||||
if (recipientState.state == OWSOutgoingMessageRecipientStateSending) {
|
||||
recipientState.state = OWSOutgoingMessageRecipientStateSent;
|
||||
}
|
||||
}
|
||||
[message setIsFromLinkedDevice:YES];
|
||||
}];
|
||||
[self
|
||||
applyChangeToSelfAndLatestCopy:transaction
|
||||
changeBlock:^(TSOutgoingMessage *message) {
|
||||
if (udRecipientIds.count > 0 || nonUdRecipientIds.count > 0) {
|
||||
// If we have specific recipient info from the transcript,
|
||||
// build a new recipient state map.
|
||||
NSMutableDictionary<NSString *, TSOutgoingMessageRecipientState *> *recipientStateMap
|
||||
= [NSMutableDictionary new];
|
||||
for (NSString *recipientId in udRecipientIds) {
|
||||
if (recipientStateMap[recipientId]) {
|
||||
OWSFailDebug(
|
||||
@"recipient appears more than once in recipient lists: %@", recipientId);
|
||||
continue;
|
||||
}
|
||||
TSOutgoingMessageRecipientState *recipientState =
|
||||
[TSOutgoingMessageRecipientState new];
|
||||
recipientState.state = OWSOutgoingMessageRecipientStateSent;
|
||||
recipientState.wasSentByUD = YES;
|
||||
recipientStateMap[recipientId] = recipientState;
|
||||
}
|
||||
for (NSString *recipientId in nonUdRecipientIds) {
|
||||
if (recipientStateMap[recipientId]) {
|
||||
OWSFailDebug(
|
||||
@"recipient appears more than once in recipient lists: %@", recipientId);
|
||||
continue;
|
||||
}
|
||||
TSOutgoingMessageRecipientState *recipientState =
|
||||
[TSOutgoingMessageRecipientState new];
|
||||
recipientState.state = OWSOutgoingMessageRecipientStateSent;
|
||||
recipientState.wasSentByUD = NO;
|
||||
recipientStateMap[recipientId] = recipientState;
|
||||
}
|
||||
[message setRecipientStateMap:recipientStateMap];
|
||||
} else {
|
||||
// Otherwise assume this is a legacy message before UD was introduced, and mark
|
||||
// any "sending" recipient as "sent". Note that this will apply to non-legacy
|
||||
// messages with no recipients.
|
||||
for (TSOutgoingMessageRecipientState *recipientState in message.recipientStateMap
|
||||
.allValues) {
|
||||
if (recipientState.state == OWSOutgoingMessageRecipientStateSending) {
|
||||
recipientState.state = OWSOutgoingMessageRecipientStateSent;
|
||||
}
|
||||
}
|
||||
}
|
||||
[message setIsFromLinkedDevice:YES];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)updateWithSendingToSingleGroupRecipient:(NSString *)singleGroupRecipient
|
||||
@ -799,6 +835,7 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (nullable SSKProtoDataMessageBuilder *)dataMessageBuilder
|
||||
|
||||
@ -57,7 +57,7 @@ struct FingerprintProtos_LogicalFingerprints {
|
||||
/// Returns true if `version` has been explicitly set.
|
||||
var hasVersion: Bool {return _storage._version != nil}
|
||||
/// Clears the value of `version`. Subsequent reads from it will return its default value.
|
||||
mutating func clearVersion() {_storage._version = nil}
|
||||
mutating func clearVersion() {_uniqueStorage()._version = nil}
|
||||
|
||||
/// @required
|
||||
var localFingerprint: FingerprintProtos_LogicalFingerprint {
|
||||
@ -67,7 +67,7 @@ struct FingerprintProtos_LogicalFingerprints {
|
||||
/// Returns true if `localFingerprint` has been explicitly set.
|
||||
var hasLocalFingerprint: Bool {return _storage._localFingerprint != nil}
|
||||
/// Clears the value of `localFingerprint`. Subsequent reads from it will return its default value.
|
||||
mutating func clearLocalFingerprint() {_storage._localFingerprint = nil}
|
||||
mutating func clearLocalFingerprint() {_uniqueStorage()._localFingerprint = nil}
|
||||
|
||||
/// @required
|
||||
var remoteFingerprint: FingerprintProtos_LogicalFingerprint {
|
||||
@ -77,7 +77,7 @@ struct FingerprintProtos_LogicalFingerprints {
|
||||
/// Returns true if `remoteFingerprint` has been explicitly set.
|
||||
var hasRemoteFingerprint: Bool {return _storage._remoteFingerprint != nil}
|
||||
/// Clears the value of `remoteFingerprint`. Subsequent reads from it will return its default value.
|
||||
mutating func clearRemoteFingerprint() {_storage._remoteFingerprint = nil}
|
||||
mutating func clearRemoteFingerprint() {_uniqueStorage()._remoteFingerprint = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
@ -112,9 +112,9 @@ extension FingerprintProtos_LogicalFingerprint: SwiftProtobuf.Message, SwiftProt
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
func _protobuf_generated_isEqualTo(other: FingerprintProtos_LogicalFingerprint) -> Bool {
|
||||
if self._identityData != other._identityData {return false}
|
||||
if unknownFields != other.unknownFields {return false}
|
||||
static func ==(lhs: FingerprintProtos_LogicalFingerprint, rhs: FingerprintProtos_LogicalFingerprint) -> Bool {
|
||||
if lhs._identityData != rhs._identityData {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
@ -179,19 +179,19 @@ extension FingerprintProtos_LogicalFingerprints: SwiftProtobuf.Message, SwiftPro
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
func _protobuf_generated_isEqualTo(other: FingerprintProtos_LogicalFingerprints) -> Bool {
|
||||
if _storage !== other._storage {
|
||||
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_args: (_StorageClass, _StorageClass)) in
|
||||
static func ==(lhs: FingerprintProtos_LogicalFingerprints, rhs: FingerprintProtos_LogicalFingerprints) -> Bool {
|
||||
if lhs._storage !== rhs._storage {
|
||||
let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
|
||||
let _storage = _args.0
|
||||
let other_storage = _args.1
|
||||
if _storage._version != other_storage._version {return false}
|
||||
if _storage._localFingerprint != other_storage._localFingerprint {return false}
|
||||
if _storage._remoteFingerprint != other_storage._remoteFingerprint {return false}
|
||||
let rhs_storage = _args.1
|
||||
if _storage._version != rhs_storage._version {return false}
|
||||
if _storage._localFingerprint != rhs_storage._localFingerprint {return false}
|
||||
if _storage._remoteFingerprint != rhs_storage._remoteFingerprint {return false}
|
||||
return true
|
||||
}
|
||||
if !storagesAreEqual {return false}
|
||||
}
|
||||
if unknownFields != other.unknownFields {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,10 +179,10 @@ extension ProvisioningProtos_ProvisionEnvelope: SwiftProtobuf.Message, SwiftProt
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
func _protobuf_generated_isEqualTo(other: ProvisioningProtos_ProvisionEnvelope) -> Bool {
|
||||
if self._publicKey != other._publicKey {return false}
|
||||
if self._body != other._body {return false}
|
||||
if unknownFields != other.unknownFields {return false}
|
||||
static func ==(lhs: ProvisioningProtos_ProvisionEnvelope, rhs: ProvisioningProtos_ProvisionEnvelope) -> Bool {
|
||||
if lhs._publicKey != rhs._publicKey {return false}
|
||||
if lhs._body != rhs._body {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
@ -239,15 +239,15 @@ extension ProvisioningProtos_ProvisionMessage: SwiftProtobuf.Message, SwiftProto
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
func _protobuf_generated_isEqualTo(other: ProvisioningProtos_ProvisionMessage) -> Bool {
|
||||
if self._identityKeyPublic != other._identityKeyPublic {return false}
|
||||
if self._identityKeyPrivate != other._identityKeyPrivate {return false}
|
||||
if self._number != other._number {return false}
|
||||
if self._provisioningCode != other._provisioningCode {return false}
|
||||
if self._userAgent != other._userAgent {return false}
|
||||
if self._profileKey != other._profileKey {return false}
|
||||
if self._readReceipts != other._readReceipts {return false}
|
||||
if unknownFields != other.unknownFields {return false}
|
||||
static func ==(lhs: ProvisioningProtos_ProvisionMessage, rhs: ProvisioningProtos_ProvisionMessage) -> Bool {
|
||||
if lhs._identityKeyPublic != rhs._identityKeyPublic {return false}
|
||||
if lhs._identityKeyPrivate != rhs._identityKeyPrivate {return false}
|
||||
if lhs._number != rhs._number {return false}
|
||||
if lhs._provisioningCode != rhs._provisioningCode {return false}
|
||||
if lhs._userAgent != rhs._userAgent {return false}
|
||||
if lhs._profileKey != rhs._profileKey {return false}
|
||||
if lhs._readReceipts != rhs._readReceipts {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@ -3151,6 +3151,114 @@ extension SSKProtoVerified.SSKProtoVerifiedBuilder {
|
||||
|
||||
#endif
|
||||
|
||||
// MARK: - SSKProtoSyncMessageSentUnidentifiedDeliveryStatus
|
||||
|
||||
@objc public class SSKProtoSyncMessageSentUnidentifiedDeliveryStatus: NSObject {
|
||||
|
||||
// MARK: - SSKProtoSyncMessageSentUnidentifiedDeliveryStatusBuilder
|
||||
|
||||
@objc public class func builder() -> SSKProtoSyncMessageSentUnidentifiedDeliveryStatusBuilder {
|
||||
return SSKProtoSyncMessageSentUnidentifiedDeliveryStatusBuilder()
|
||||
}
|
||||
|
||||
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||
@objc public func asBuilder() -> SSKProtoSyncMessageSentUnidentifiedDeliveryStatusBuilder {
|
||||
let builder = SSKProtoSyncMessageSentUnidentifiedDeliveryStatusBuilder()
|
||||
if let _value = destination {
|
||||
builder.setDestination(_value)
|
||||
}
|
||||
if hasUnidentified {
|
||||
builder.setUnidentified(unidentified)
|
||||
}
|
||||
return builder
|
||||
}
|
||||
|
||||
@objc public class SSKProtoSyncMessageSentUnidentifiedDeliveryStatusBuilder: NSObject {
|
||||
|
||||
private var proto = SignalServiceProtos_SyncMessage.Sent.UnidentifiedDeliveryStatus()
|
||||
|
||||
@objc fileprivate override init() {}
|
||||
|
||||
@objc public func setDestination(_ valueParam: String) {
|
||||
proto.destination = valueParam
|
||||
}
|
||||
|
||||
@objc public func setUnidentified(_ valueParam: Bool) {
|
||||
proto.unidentified = valueParam
|
||||
}
|
||||
|
||||
@objc public func build() throws -> SSKProtoSyncMessageSentUnidentifiedDeliveryStatus {
|
||||
return try SSKProtoSyncMessageSentUnidentifiedDeliveryStatus.parseProto(proto)
|
||||
}
|
||||
|
||||
@objc public func buildSerializedData() throws -> Data {
|
||||
return try SSKProtoSyncMessageSentUnidentifiedDeliveryStatus.parseProto(proto).serializedData()
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate let proto: SignalServiceProtos_SyncMessage.Sent.UnidentifiedDeliveryStatus
|
||||
|
||||
@objc public var destination: String? {
|
||||
guard proto.hasDestination else {
|
||||
return nil
|
||||
}
|
||||
return proto.destination
|
||||
}
|
||||
@objc public var hasDestination: Bool {
|
||||
return proto.hasDestination
|
||||
}
|
||||
|
||||
@objc public var unidentified: Bool {
|
||||
return proto.unidentified
|
||||
}
|
||||
@objc public var hasUnidentified: Bool {
|
||||
return proto.hasUnidentified
|
||||
}
|
||||
|
||||
private init(proto: SignalServiceProtos_SyncMessage.Sent.UnidentifiedDeliveryStatus) {
|
||||
self.proto = proto
|
||||
}
|
||||
|
||||
@objc
|
||||
public func serializedData() throws -> Data {
|
||||
return try self.proto.serializedData()
|
||||
}
|
||||
|
||||
@objc public class func parseData(_ serializedData: Data) throws -> SSKProtoSyncMessageSentUnidentifiedDeliveryStatus {
|
||||
let proto = try SignalServiceProtos_SyncMessage.Sent.UnidentifiedDeliveryStatus(serializedData: serializedData)
|
||||
return try parseProto(proto)
|
||||
}
|
||||
|
||||
fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage.Sent.UnidentifiedDeliveryStatus) throws -> SSKProtoSyncMessageSentUnidentifiedDeliveryStatus {
|
||||
// MARK: - Begin Validation Logic for SSKProtoSyncMessageSentUnidentifiedDeliveryStatus -
|
||||
|
||||
// MARK: - End Validation Logic for SSKProtoSyncMessageSentUnidentifiedDeliveryStatus -
|
||||
|
||||
let result = SSKProtoSyncMessageSentUnidentifiedDeliveryStatus(proto: proto)
|
||||
return result
|
||||
}
|
||||
|
||||
@objc public override var debugDescription: String {
|
||||
return "\(proto)"
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
|
||||
extension SSKProtoSyncMessageSentUnidentifiedDeliveryStatus {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
return try! self.serializedData()
|
||||
}
|
||||
}
|
||||
|
||||
extension SSKProtoSyncMessageSentUnidentifiedDeliveryStatus.SSKProtoSyncMessageSentUnidentifiedDeliveryStatusBuilder {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageSentUnidentifiedDeliveryStatus? {
|
||||
return try! self.build()
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MARK: - SSKProtoSyncMessageSent
|
||||
|
||||
@objc public class SSKProtoSyncMessageSent: NSObject {
|
||||
@ -3176,6 +3284,7 @@ extension SSKProtoVerified.SSKProtoVerifiedBuilder {
|
||||
if hasExpirationStartTimestamp {
|
||||
builder.setExpirationStartTimestamp(expirationStartTimestamp)
|
||||
}
|
||||
builder.setUnidentifiedStatus(unidentifiedStatus)
|
||||
return builder
|
||||
}
|
||||
|
||||
@ -3201,6 +3310,16 @@ extension SSKProtoVerified.SSKProtoVerifiedBuilder {
|
||||
proto.expirationStartTimestamp = valueParam
|
||||
}
|
||||
|
||||
@objc public func addUnidentifiedStatus(_ valueParam: SSKProtoSyncMessageSentUnidentifiedDeliveryStatus) {
|
||||
var items = proto.unidentifiedStatus
|
||||
items.append(valueParam.proto)
|
||||
proto.unidentifiedStatus = items
|
||||
}
|
||||
|
||||
@objc public func setUnidentifiedStatus(_ wrappedItems: [SSKProtoSyncMessageSentUnidentifiedDeliveryStatus]) {
|
||||
proto.unidentifiedStatus = wrappedItems.map { $0.proto }
|
||||
}
|
||||
|
||||
@objc public func build() throws -> SSKProtoSyncMessageSent {
|
||||
return try SSKProtoSyncMessageSent.parseProto(proto)
|
||||
}
|
||||
@ -3214,6 +3333,8 @@ extension SSKProtoVerified.SSKProtoVerifiedBuilder {
|
||||
|
||||
@objc public let message: SSKProtoDataMessage?
|
||||
|
||||
@objc public let unidentifiedStatus: [SSKProtoSyncMessageSentUnidentifiedDeliveryStatus]
|
||||
|
||||
@objc public var destination: String? {
|
||||
guard proto.hasDestination else {
|
||||
return nil
|
||||
@ -3239,9 +3360,11 @@ extension SSKProtoVerified.SSKProtoVerifiedBuilder {
|
||||
}
|
||||
|
||||
private init(proto: SignalServiceProtos_SyncMessage.Sent,
|
||||
message: SSKProtoDataMessage?) {
|
||||
message: SSKProtoDataMessage?,
|
||||
unidentifiedStatus: [SSKProtoSyncMessageSentUnidentifiedDeliveryStatus]) {
|
||||
self.proto = proto
|
||||
self.message = message
|
||||
self.unidentifiedStatus = unidentifiedStatus
|
||||
}
|
||||
|
||||
@objc
|
||||
@ -3260,12 +3383,16 @@ extension SSKProtoVerified.SSKProtoVerifiedBuilder {
|
||||
message = try SSKProtoDataMessage.parseProto(proto.message)
|
||||
}
|
||||
|
||||
var unidentifiedStatus: [SSKProtoSyncMessageSentUnidentifiedDeliveryStatus] = []
|
||||
unidentifiedStatus = try proto.unidentifiedStatus.map { try SSKProtoSyncMessageSentUnidentifiedDeliveryStatus.parseProto($0) }
|
||||
|
||||
// MARK: - Begin Validation Logic for SSKProtoSyncMessageSent -
|
||||
|
||||
// MARK: - End Validation Logic for SSKProtoSyncMessageSent -
|
||||
|
||||
let result = SSKProtoSyncMessageSent(proto: proto,
|
||||
message: message)
|
||||
message: message,
|
||||
unidentifiedStatus: unidentifiedStatus)
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
@ -133,9 +133,9 @@ extension IOSProtos_BackupSnapshot: SwiftProtobuf.Message, SwiftProtobuf._Messag
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
func _protobuf_generated_isEqualTo(other: IOSProtos_BackupSnapshot) -> Bool {
|
||||
if self.entity != other.entity {return false}
|
||||
if unknownFields != other.unknownFields {return false}
|
||||
static func ==(lhs: IOSProtos_BackupSnapshot, rhs: IOSProtos_BackupSnapshot) -> Bool {
|
||||
if lhs.entity != rhs.entity {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
@ -167,10 +167,10 @@ extension IOSProtos_BackupSnapshot.BackupEntity: SwiftProtobuf.Message, SwiftPro
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
func _protobuf_generated_isEqualTo(other: IOSProtos_BackupSnapshot.BackupEntity) -> Bool {
|
||||
if self._type != other._type {return false}
|
||||
if self._entityData != other._entityData {return false}
|
||||
if unknownFields != other.unknownFields {return false}
|
||||
static func ==(lhs: IOSProtos_BackupSnapshot.BackupEntity, rhs: IOSProtos_BackupSnapshot.BackupEntity) -> Bool {
|
||||
if lhs._type != rhs._type {return false}
|
||||
if lhs._entityData != rhs._entityData {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -151,7 +151,7 @@ struct WebSocketProtos_WebSocketMessage {
|
||||
/// Returns true if `type` has been explicitly set.
|
||||
var hasType: Bool {return _storage._type != nil}
|
||||
/// Clears the value of `type`. Subsequent reads from it will return its default value.
|
||||
mutating func clearType() {_storage._type = nil}
|
||||
mutating func clearType() {_uniqueStorage()._type = nil}
|
||||
|
||||
var request: WebSocketProtos_WebSocketRequestMessage {
|
||||
get {return _storage._request ?? WebSocketProtos_WebSocketRequestMessage()}
|
||||
@ -160,7 +160,7 @@ struct WebSocketProtos_WebSocketMessage {
|
||||
/// Returns true if `request` has been explicitly set.
|
||||
var hasRequest: Bool {return _storage._request != nil}
|
||||
/// Clears the value of `request`. Subsequent reads from it will return its default value.
|
||||
mutating func clearRequest() {_storage._request = nil}
|
||||
mutating func clearRequest() {_uniqueStorage()._request = nil}
|
||||
|
||||
var response: WebSocketProtos_WebSocketResponseMessage {
|
||||
get {return _storage._response ?? WebSocketProtos_WebSocketResponseMessage()}
|
||||
@ -169,7 +169,7 @@ struct WebSocketProtos_WebSocketMessage {
|
||||
/// Returns true if `response` has been explicitly set.
|
||||
var hasResponse: Bool {return _storage._response != nil}
|
||||
/// Clears the value of `response`. Subsequent reads from it will return its default value.
|
||||
mutating func clearResponse() {_storage._response = nil}
|
||||
mutating func clearResponse() {_uniqueStorage()._response = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
@ -261,13 +261,13 @@ extension WebSocketProtos_WebSocketRequestMessage: SwiftProtobuf.Message, SwiftP
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
func _protobuf_generated_isEqualTo(other: WebSocketProtos_WebSocketRequestMessage) -> Bool {
|
||||
if self._verb != other._verb {return false}
|
||||
if self._path != other._path {return false}
|
||||
if self._body != other._body {return false}
|
||||
if self.headers != other.headers {return false}
|
||||
if self._requestID != other._requestID {return false}
|
||||
if unknownFields != other.unknownFields {return false}
|
||||
static func ==(lhs: WebSocketProtos_WebSocketRequestMessage, rhs: WebSocketProtos_WebSocketRequestMessage) -> Bool {
|
||||
if lhs._verb != rhs._verb {return false}
|
||||
if lhs._path != rhs._path {return false}
|
||||
if lhs._body != rhs._body {return false}
|
||||
if lhs.headers != rhs.headers {return false}
|
||||
if lhs._requestID != rhs._requestID {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
@ -314,13 +314,13 @@ extension WebSocketProtos_WebSocketResponseMessage: SwiftProtobuf.Message, Swift
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
func _protobuf_generated_isEqualTo(other: WebSocketProtos_WebSocketResponseMessage) -> Bool {
|
||||
if self._requestID != other._requestID {return false}
|
||||
if self._status != other._status {return false}
|
||||
if self._message != other._message {return false}
|
||||
if self.headers != other.headers {return false}
|
||||
if self._body != other._body {return false}
|
||||
if unknownFields != other.unknownFields {return false}
|
||||
static func ==(lhs: WebSocketProtos_WebSocketResponseMessage, rhs: WebSocketProtos_WebSocketResponseMessage) -> Bool {
|
||||
if lhs._requestID != rhs._requestID {return false}
|
||||
if lhs._status != rhs._status {return false}
|
||||
if lhs._message != rhs._message {return false}
|
||||
if lhs.headers != rhs.headers {return false}
|
||||
if lhs._body != rhs._body {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
@ -385,19 +385,19 @@ extension WebSocketProtos_WebSocketMessage: SwiftProtobuf.Message, SwiftProtobuf
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
func _protobuf_generated_isEqualTo(other: WebSocketProtos_WebSocketMessage) -> Bool {
|
||||
if _storage !== other._storage {
|
||||
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_args: (_StorageClass, _StorageClass)) in
|
||||
static func ==(lhs: WebSocketProtos_WebSocketMessage, rhs: WebSocketProtos_WebSocketMessage) -> Bool {
|
||||
if lhs._storage !== rhs._storage {
|
||||
let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
|
||||
let _storage = _args.0
|
||||
let other_storage = _args.1
|
||||
if _storage._type != other_storage._type {return false}
|
||||
if _storage._request != other_storage._request {return false}
|
||||
if _storage._response != other_storage._response {return false}
|
||||
let rhs_storage = _args.1
|
||||
if _storage._type != rhs_storage._type {return false}
|
||||
if _storage._request != rhs_storage._request {return false}
|
||||
if _storage._response != rhs_storage._response {return false}
|
||||
return true
|
||||
}
|
||||
if !storagesAreEqual {return false}
|
||||
}
|
||||
if unknownFields != other.unknownFields {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user