From b5fdc05b9129161f611f31549e21bba80cd4dcbd Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 3 Aug 2017 17:49:28 -0400 Subject: [PATCH] Move profile key to data, call, sync and null protos. // FREEBIE --- .../protobuf/OWSSignalServiceProtos.proto | 31 +-- .../src/Messages/OWSSignalServiceProtos.pb.h | 40 +++- .../src/Messages/OWSSignalServiceProtos.pb.m | 196 +++++++++++++----- 3 files changed, 193 insertions(+), 74 deletions(-) diff --git a/SignalServiceKit/protobuf/OWSSignalServiceProtos.proto b/SignalServiceKit/protobuf/OWSSignalServiceProtos.proto index 8a5cac493..888133a5c 100644 --- a/SignalServiceKit/protobuf/OWSSignalServiceProtos.proto +++ b/SignalServiceKit/protobuf/OWSSignalServiceProtos.proto @@ -35,7 +35,6 @@ message Content { optional SyncMessage syncMessage = 2; optional CallMessage callMessage = 3; optional NullMessage nullMessage = 4; - optional bytes profileKey = 5; } message NullMessage { @@ -85,12 +84,12 @@ message CallMessage { optional uint64 id = 1; } - - optional Offer offer = 1; - optional Answer answer = 2; - repeated IceUpdate iceUpdate = 3; - optional Hangup hangup = 4; - optional Busy busy = 5; + optional Offer offer = 1; + optional Answer answer = 2; + repeated IceUpdate iceUpdate = 3; + optional Hangup hangup = 4; + optional Busy busy = 5; + optional bytes profileKey = 6; } message DataMessage { @@ -104,6 +103,7 @@ message DataMessage { optional GroupContext group = 3; optional uint32 flags = 4; optional uint32 expireTimer = 5; + optional bytes profileKey = 6; } message SyncMessage { @@ -143,14 +143,15 @@ message SyncMessage { optional uint64 timestamp = 2; } - optional Sent sent = 1; - optional Contacts contacts = 2; - optional Groups groups = 3; - optional Request request = 4; - repeated Read read = 5; - optional Blocked blocked = 6; - optional Verified verified = 7; - optional bytes padding = 8; + optional Sent sent = 1; + optional Contacts contacts = 2; + optional Groups groups = 3; + optional Request request = 4; + repeated Read read = 5; + optional Blocked blocked = 6; + optional Verified verified = 7; + optional bytes padding = 8; + optional bytes profileKey = 9; } message AttachmentPointer { diff --git a/SignalServiceKit/src/Messages/OWSSignalServiceProtos.pb.h b/SignalServiceKit/src/Messages/OWSSignalServiceProtos.pb.h index 32e1aef3c..54a1c300b 100644 --- a/SignalServiceKit/src/Messages/OWSSignalServiceProtos.pb.h +++ b/SignalServiceKit/src/Messages/OWSSignalServiceProtos.pb.h @@ -275,30 +275,25 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro #define Content_syncMessage @"syncMessage" #define Content_callMessage @"callMessage" #define Content_nullMessage @"nullMessage" -#define Content_profileKey @"profileKey" @interface OWSSignalServiceProtosContent : PBGeneratedMessage { @private BOOL hasDataMessage_:1; BOOL hasSyncMessage_:1; BOOL hasCallMessage_:1; BOOL hasNullMessage_:1; - BOOL hasProfileKey_:1; OWSSignalServiceProtosDataMessage* dataMessage; OWSSignalServiceProtosSyncMessage* syncMessage; OWSSignalServiceProtosCallMessage* callMessage; OWSSignalServiceProtosNullMessage* nullMessage; - NSData* profileKey; } - (BOOL) hasDataMessage; - (BOOL) hasSyncMessage; - (BOOL) hasCallMessage; - (BOOL) hasNullMessage; -- (BOOL) hasProfileKey; @property (readonly, strong) OWSSignalServiceProtosDataMessage* dataMessage; @property (readonly, strong) OWSSignalServiceProtosSyncMessage* syncMessage; @property (readonly, strong) OWSSignalServiceProtosCallMessage* callMessage; @property (readonly, strong) OWSSignalServiceProtosNullMessage* nullMessage; -@property (readonly, strong) NSData* profileKey; + (instancetype) defaultInstance; - (instancetype) defaultInstance; @@ -362,11 +357,6 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro - (OWSSignalServiceProtosContentBuilder*) setNullMessageBuilder:(OWSSignalServiceProtosNullMessageBuilder*) builderForValue; - (OWSSignalServiceProtosContentBuilder*) mergeNullMessage:(OWSSignalServiceProtosNullMessage*) value; - (OWSSignalServiceProtosContentBuilder*) clearNullMessage; - -- (BOOL) hasProfileKey; -- (NSData*) profileKey; -- (OWSSignalServiceProtosContentBuilder*) setProfileKey:(NSData*) value; -- (OWSSignalServiceProtosContentBuilder*) clearProfileKey; @end #define NullMessage_padding @"padding" @@ -504,27 +494,32 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro #define CallMessage_iceUpdate @"iceUpdate" #define CallMessage_hangup @"hangup" #define CallMessage_busy @"busy" +#define CallMessage_profileKey @"profileKey" @interface OWSSignalServiceProtosCallMessage : PBGeneratedMessage { @private BOOL hasOffer_:1; BOOL hasAnswer_:1; BOOL hasHangup_:1; BOOL hasBusy_:1; + BOOL hasProfileKey_:1; OWSSignalServiceProtosCallMessageOffer* offer; OWSSignalServiceProtosCallMessageAnswer* answer; OWSSignalServiceProtosCallMessageHangup* hangup; OWSSignalServiceProtosCallMessageBusy* busy; + NSData* profileKey; NSMutableArray * iceUpdateArray; } - (BOOL) hasOffer; - (BOOL) hasAnswer; - (BOOL) hasHangup; - (BOOL) hasBusy; +- (BOOL) hasProfileKey; @property (readonly, strong) OWSSignalServiceProtosCallMessageOffer* offer; @property (readonly, strong) OWSSignalServiceProtosCallMessageAnswer* answer; @property (readonly, strong) NSArray * iceUpdate; @property (readonly, strong) OWSSignalServiceProtosCallMessageHangup* hangup; @property (readonly, strong) OWSSignalServiceProtosCallMessageBusy* busy; +@property (readonly, strong) NSData* profileKey; - (OWSSignalServiceProtosCallMessageIceUpdate*)iceUpdateAtIndex:(NSUInteger)index; + (instancetype) defaultInstance; @@ -895,6 +890,11 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro - (OWSSignalServiceProtosCallMessageBuilder*) setBusyBuilder:(OWSSignalServiceProtosCallMessageBusyBuilder*) builderForValue; - (OWSSignalServiceProtosCallMessageBuilder*) mergeBusy:(OWSSignalServiceProtosCallMessageBusy*) value; - (OWSSignalServiceProtosCallMessageBuilder*) clearBusy; + +- (BOOL) hasProfileKey; +- (NSData*) profileKey; +- (OWSSignalServiceProtosCallMessageBuilder*) setProfileKey:(NSData*) value; +- (OWSSignalServiceProtosCallMessageBuilder*) clearProfileKey; @end #define DataMessage_body @"body" @@ -902,14 +902,17 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro #define DataMessage_group @"group" #define DataMessage_flags @"flags" #define DataMessage_expireTimer @"expireTimer" +#define DataMessage_profileKey @"profileKey" @interface OWSSignalServiceProtosDataMessage : PBGeneratedMessage { @private BOOL hasBody_:1; BOOL hasGroup_:1; + BOOL hasProfileKey_:1; BOOL hasFlags_:1; BOOL hasExpireTimer_:1; NSString* body; OWSSignalServiceProtosGroupContext* group; + NSData* profileKey; UInt32 flags; UInt32 expireTimer; NSMutableArray * attachmentsArray; @@ -918,11 +921,13 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro - (BOOL) hasGroup; - (BOOL) hasFlags; - (BOOL) hasExpireTimer; +- (BOOL) hasProfileKey; @property (readonly, strong) NSString* body; @property (readonly, strong) NSArray * attachments; @property (readonly, strong) OWSSignalServiceProtosGroupContext* group; @property (readonly) UInt32 flags; @property (readonly) UInt32 expireTimer; +@property (readonly, strong) NSData* profileKey; - (OWSSignalServiceProtosAttachmentPointer*)attachmentsAtIndex:(NSUInteger)index; + (instancetype) defaultInstance; @@ -987,6 +992,11 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro - (UInt32) expireTimer; - (OWSSignalServiceProtosDataMessageBuilder*) setExpireTimer:(UInt32) value; - (OWSSignalServiceProtosDataMessageBuilder*) clearExpireTimer; + +- (BOOL) hasProfileKey; +- (NSData*) profileKey; +- (OWSSignalServiceProtosDataMessageBuilder*) setProfileKey:(NSData*) value; +- (OWSSignalServiceProtosDataMessageBuilder*) clearProfileKey; @end #define SyncMessage_sent @"sent" @@ -997,6 +1007,7 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro #define SyncMessage_blocked @"blocked" #define SyncMessage_verified @"verified" #define SyncMessage_padding @"padding" +#define SyncMessage_profileKey @"profileKey" @interface OWSSignalServiceProtosSyncMessage : PBGeneratedMessage { @private BOOL hasSent_:1; @@ -1006,6 +1017,7 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro BOOL hasBlocked_:1; BOOL hasVerified_:1; BOOL hasPadding_:1; + BOOL hasProfileKey_:1; OWSSignalServiceProtosSyncMessageSent* sent; OWSSignalServiceProtosSyncMessageContacts* contacts; OWSSignalServiceProtosSyncMessageGroups* groups; @@ -1013,6 +1025,7 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro OWSSignalServiceProtosSyncMessageBlocked* blocked; OWSSignalServiceProtosVerified* verified; NSData* padding; + NSData* profileKey; NSMutableArray * readArray; } - (BOOL) hasSent; @@ -1022,6 +1035,7 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro - (BOOL) hasBlocked; - (BOOL) hasVerified; - (BOOL) hasPadding; +- (BOOL) hasProfileKey; @property (readonly, strong) OWSSignalServiceProtosSyncMessageSent* sent; @property (readonly, strong) OWSSignalServiceProtosSyncMessageContacts* contacts; @property (readonly, strong) OWSSignalServiceProtosSyncMessageGroups* groups; @@ -1030,6 +1044,7 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro @property (readonly, strong) OWSSignalServiceProtosSyncMessageBlocked* blocked; @property (readonly, strong) OWSSignalServiceProtosVerified* verified; @property (readonly, strong) NSData* padding; +@property (readonly, strong) NSData* profileKey; - (OWSSignalServiceProtosSyncMessageRead*)readAtIndex:(NSUInteger)index; + (instancetype) defaultInstance; @@ -1475,6 +1490,11 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro - (NSData*) padding; - (OWSSignalServiceProtosSyncMessageBuilder*) setPadding:(NSData*) value; - (OWSSignalServiceProtosSyncMessageBuilder*) clearPadding; + +- (BOOL) hasProfileKey; +- (NSData*) profileKey; +- (OWSSignalServiceProtosSyncMessageBuilder*) setProfileKey:(NSData*) value; +- (OWSSignalServiceProtosSyncMessageBuilder*) clearProfileKey; @end #define AttachmentPointer_id @"id" diff --git a/SignalServiceKit/src/Messages/OWSSignalServiceProtos.pb.m b/SignalServiceKit/src/Messages/OWSSignalServiceProtos.pb.m index e741fba39..55f3e5d54 100644 --- a/SignalServiceKit/src/Messages/OWSSignalServiceProtos.pb.m +++ b/SignalServiceKit/src/Messages/OWSSignalServiceProtos.pb.m @@ -560,7 +560,6 @@ NSString *NSStringFromOWSSignalServiceProtosEnvelopeType(OWSSignalServiceProtosE @property (strong) OWSSignalServiceProtosSyncMessage* syncMessage; @property (strong) OWSSignalServiceProtosCallMessage* callMessage; @property (strong) OWSSignalServiceProtosNullMessage* nullMessage; -@property (strong) NSData* profileKey; @end @implementation OWSSignalServiceProtosContent @@ -593,20 +592,12 @@ NSString *NSStringFromOWSSignalServiceProtosEnvelopeType(OWSSignalServiceProtosE hasNullMessage_ = !!_value_; } @synthesize nullMessage; -- (BOOL) hasProfileKey { - return !!hasProfileKey_; -} -- (void) setHasProfileKey:(BOOL) _value_ { - hasProfileKey_ = !!_value_; -} -@synthesize profileKey; - (instancetype) init { if ((self = [super init])) { self.dataMessage = [OWSSignalServiceProtosDataMessage defaultInstance]; self.syncMessage = [OWSSignalServiceProtosSyncMessage defaultInstance]; self.callMessage = [OWSSignalServiceProtosCallMessage defaultInstance]; self.nullMessage = [OWSSignalServiceProtosNullMessage defaultInstance]; - self.profileKey = [NSData data]; } return self; } @@ -638,9 +629,6 @@ static OWSSignalServiceProtosContent* defaultOWSSignalServiceProtosContentInstan if (self.hasNullMessage) { [output writeMessage:4 value:self.nullMessage]; } - if (self.hasProfileKey) { - [output writeData:5 value:self.profileKey]; - } [self.unknownFields writeToCodedOutputStream:output]; } - (SInt32) serializedSize { @@ -662,9 +650,6 @@ static OWSSignalServiceProtosContent* defaultOWSSignalServiceProtosContentInstan if (self.hasNullMessage) { size_ += computeMessageSize(4, self.nullMessage); } - if (self.hasProfileKey) { - size_ += computeDataSize(5, self.profileKey); - } size_ += self.unknownFields.serializedSize; memoizedSerializedSize = size_; return size_; @@ -724,9 +709,6 @@ static OWSSignalServiceProtosContent* defaultOWSSignalServiceProtosContentInstan withIndent:[NSString stringWithFormat:@"%@ ", indent]]; [output appendFormat:@"%@}\n", indent]; } - if (self.hasProfileKey) { - [output appendFormat:@"%@%@: %@\n", indent, @"profileKey", self.profileKey]; - } [self.unknownFields writeDescriptionTo:output withIndent:indent]; } - (void) storeInDictionary:(NSMutableDictionary *)dictionary { @@ -750,9 +732,6 @@ static OWSSignalServiceProtosContent* defaultOWSSignalServiceProtosContentInstan [self.nullMessage storeInDictionary:messageDictionary]; [dictionary setObject:[NSDictionary dictionaryWithDictionary:messageDictionary] forKey:@"nullMessage"]; } - if (self.hasProfileKey) { - [dictionary setObject: self.profileKey forKey: @"profileKey"]; - } [self.unknownFields storeInDictionary:dictionary]; } - (BOOL) isEqual:(id)other { @@ -772,8 +751,6 @@ static OWSSignalServiceProtosContent* defaultOWSSignalServiceProtosContentInstan (!self.hasCallMessage || [self.callMessage isEqual:otherMessage.callMessage]) && self.hasNullMessage == otherMessage.hasNullMessage && (!self.hasNullMessage || [self.nullMessage isEqual:otherMessage.nullMessage]) && - self.hasProfileKey == otherMessage.hasProfileKey && - (!self.hasProfileKey || [self.profileKey isEqual:otherMessage.profileKey]) && (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); } - (NSUInteger) hash { @@ -790,9 +767,6 @@ static OWSSignalServiceProtosContent* defaultOWSSignalServiceProtosContentInstan if (self.hasNullMessage) { hashCode = hashCode * 31 + [self.nullMessage hash]; } - if (self.hasProfileKey) { - hashCode = hashCode * 31 + [self.profileKey hash]; - } hashCode = hashCode * 31 + [self.unknownFields hash]; return hashCode; } @@ -848,9 +822,6 @@ static OWSSignalServiceProtosContent* defaultOWSSignalServiceProtosContentInstan if (other.hasNullMessage) { [self mergeNullMessage:other.nullMessage]; } - if (other.hasProfileKey) { - [self setProfileKey:other.profileKey]; - } [self mergeUnknownFields:other.unknownFields]; return self; } @@ -908,10 +879,6 @@ static OWSSignalServiceProtosContent* defaultOWSSignalServiceProtosContentInstan [self setNullMessage:[subBuilder buildPartial]]; break; } - case 42: { - [self setProfileKey:[input readData]]; - break; - } } } } @@ -1035,22 +1002,6 @@ static OWSSignalServiceProtosContent* defaultOWSSignalServiceProtosContentInstan resultContent.nullMessage = [OWSSignalServiceProtosNullMessage defaultInstance]; return self; } -- (BOOL) hasProfileKey { - return resultContent.hasProfileKey; -} -- (NSData*) profileKey { - return resultContent.profileKey; -} -- (OWSSignalServiceProtosContentBuilder*) setProfileKey:(NSData*) value { - resultContent.hasProfileKey = YES; - resultContent.profileKey = value; - return self; -} -- (OWSSignalServiceProtosContentBuilder*) clearProfileKey { - resultContent.hasProfileKey = NO; - resultContent.profileKey = [NSData data]; - return self; -} @end @interface OWSSignalServiceProtosNullMessage () @@ -1646,6 +1597,7 @@ NSString *NSStringFromOWSSignalServiceProtosVerifiedState(OWSSignalServiceProtos @property (strong) NSMutableArray * iceUpdateArray; @property (strong) OWSSignalServiceProtosCallMessageHangup* hangup; @property (strong) OWSSignalServiceProtosCallMessageBusy* busy; +@property (strong) NSData* profileKey; @end @implementation OWSSignalServiceProtosCallMessage @@ -1680,12 +1632,20 @@ NSString *NSStringFromOWSSignalServiceProtosVerifiedState(OWSSignalServiceProtos hasBusy_ = !!_value_; } @synthesize busy; +- (BOOL) hasProfileKey { + return !!hasProfileKey_; +} +- (void) setHasProfileKey:(BOOL) _value_ { + hasProfileKey_ = !!_value_; +} +@synthesize profileKey; - (instancetype) init { if ((self = [super init])) { self.offer = [OWSSignalServiceProtosCallMessageOffer defaultInstance]; self.answer = [OWSSignalServiceProtosCallMessageAnswer defaultInstance]; self.hangup = [OWSSignalServiceProtosCallMessageHangup defaultInstance]; self.busy = [OWSSignalServiceProtosCallMessageBusy defaultInstance]; + self.profileKey = [NSData data]; } return self; } @@ -1726,6 +1686,9 @@ static OWSSignalServiceProtosCallMessage* defaultOWSSignalServiceProtosCallMessa if (self.hasBusy) { [output writeMessage:5 value:self.busy]; } + if (self.hasProfileKey) { + [output writeData:6 value:self.profileKey]; + } [self.unknownFields writeToCodedOutputStream:output]; } - (SInt32) serializedSize { @@ -1750,6 +1713,9 @@ static OWSSignalServiceProtosCallMessage* defaultOWSSignalServiceProtosCallMessa if (self.hasBusy) { size_ += computeMessageSize(5, self.busy); } + if (self.hasProfileKey) { + size_ += computeDataSize(6, self.profileKey); + } size_ += self.unknownFields.serializedSize; memoizedSerializedSize = size_; return size_; @@ -1815,6 +1781,9 @@ static OWSSignalServiceProtosCallMessage* defaultOWSSignalServiceProtosCallMessa withIndent:[NSString stringWithFormat:@"%@ ", indent]]; [output appendFormat:@"%@}\n", indent]; } + if (self.hasProfileKey) { + [output appendFormat:@"%@%@: %@\n", indent, @"profileKey", self.profileKey]; + } [self.unknownFields writeDescriptionTo:output withIndent:indent]; } - (void) storeInDictionary:(NSMutableDictionary *)dictionary { @@ -1843,6 +1812,9 @@ static OWSSignalServiceProtosCallMessage* defaultOWSSignalServiceProtosCallMessa [self.busy storeInDictionary:messageDictionary]; [dictionary setObject:[NSDictionary dictionaryWithDictionary:messageDictionary] forKey:@"busy"]; } + if (self.hasProfileKey) { + [dictionary setObject: self.profileKey forKey: @"profileKey"]; + } [self.unknownFields storeInDictionary:dictionary]; } - (BOOL) isEqual:(id)other { @@ -1863,6 +1835,8 @@ static OWSSignalServiceProtosCallMessage* defaultOWSSignalServiceProtosCallMessa (!self.hasHangup || [self.hangup isEqual:otherMessage.hangup]) && self.hasBusy == otherMessage.hasBusy && (!self.hasBusy || [self.busy isEqual:otherMessage.busy]) && + self.hasProfileKey == otherMessage.hasProfileKey && + (!self.hasProfileKey || [self.profileKey isEqual:otherMessage.profileKey]) && (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); } - (NSUInteger) hash { @@ -1882,6 +1856,9 @@ static OWSSignalServiceProtosCallMessage* defaultOWSSignalServiceProtosCallMessa if (self.hasBusy) { hashCode = hashCode * 31 + [self.busy hash]; } + if (self.hasProfileKey) { + hashCode = hashCode * 31 + [self.profileKey hash]; + } hashCode = hashCode * 31 + [self.unknownFields hash]; return hashCode; } @@ -3219,6 +3196,9 @@ static OWSSignalServiceProtosCallMessageHangup* defaultOWSSignalServiceProtosCal if (other.hasBusy) { [self mergeBusy:other.busy]; } + if (other.hasProfileKey) { + [self setProfileKey:other.profileKey]; + } [self mergeUnknownFields:other.unknownFields]; return self; } @@ -3282,6 +3262,10 @@ static OWSSignalServiceProtosCallMessageHangup* defaultOWSSignalServiceProtosCal [self setBusy:[subBuilder buildPartial]]; break; } + case 50: { + [self setProfileKey:[input readData]]; + break; + } } } } @@ -3426,6 +3410,22 @@ static OWSSignalServiceProtosCallMessageHangup* defaultOWSSignalServiceProtosCal resultCallMessage.busy = [OWSSignalServiceProtosCallMessageBusy defaultInstance]; return self; } +- (BOOL) hasProfileKey { + return resultCallMessage.hasProfileKey; +} +- (NSData*) profileKey { + return resultCallMessage.profileKey; +} +- (OWSSignalServiceProtosCallMessageBuilder*) setProfileKey:(NSData*) value { + resultCallMessage.hasProfileKey = YES; + resultCallMessage.profileKey = value; + return self; +} +- (OWSSignalServiceProtosCallMessageBuilder*) clearProfileKey { + resultCallMessage.hasProfileKey = NO; + resultCallMessage.profileKey = [NSData data]; + return self; +} @end @interface OWSSignalServiceProtosDataMessage () @@ -3434,6 +3434,7 @@ static OWSSignalServiceProtosCallMessageHangup* defaultOWSSignalServiceProtosCal @property (strong) OWSSignalServiceProtosGroupContext* group; @property UInt32 flags; @property UInt32 expireTimer; +@property (strong) NSData* profileKey; @end @implementation OWSSignalServiceProtosDataMessage @@ -3468,12 +3469,20 @@ static OWSSignalServiceProtosCallMessageHangup* defaultOWSSignalServiceProtosCal hasExpireTimer_ = !!_value_; } @synthesize expireTimer; +- (BOOL) hasProfileKey { + return !!hasProfileKey_; +} +- (void) setHasProfileKey:(BOOL) _value_ { + hasProfileKey_ = !!_value_; +} +@synthesize profileKey; - (instancetype) init { if ((self = [super init])) { self.body = @""; self.group = [OWSSignalServiceProtosGroupContext defaultInstance]; self.flags = 0; self.expireTimer = 0; + self.profileKey = [NSData data]; } return self; } @@ -3514,6 +3523,9 @@ static OWSSignalServiceProtosDataMessage* defaultOWSSignalServiceProtosDataMessa if (self.hasExpireTimer) { [output writeUInt32:5 value:self.expireTimer]; } + if (self.hasProfileKey) { + [output writeData:6 value:self.profileKey]; + } [self.unknownFields writeToCodedOutputStream:output]; } - (SInt32) serializedSize { @@ -3538,6 +3550,9 @@ static OWSSignalServiceProtosDataMessage* defaultOWSSignalServiceProtosDataMessa if (self.hasExpireTimer) { size_ += computeUInt32Size(5, self.expireTimer); } + if (self.hasProfileKey) { + size_ += computeDataSize(6, self.profileKey); + } size_ += self.unknownFields.serializedSize; memoizedSerializedSize = size_; return size_; @@ -3594,6 +3609,9 @@ static OWSSignalServiceProtosDataMessage* defaultOWSSignalServiceProtosDataMessa if (self.hasExpireTimer) { [output appendFormat:@"%@%@: %@\n", indent, @"expireTimer", [NSNumber numberWithInteger:self.expireTimer]]; } + if (self.hasProfileKey) { + [output appendFormat:@"%@%@: %@\n", indent, @"profileKey", self.profileKey]; + } [self.unknownFields writeDescriptionTo:output withIndent:indent]; } - (void) storeInDictionary:(NSMutableDictionary *)dictionary { @@ -3616,6 +3634,9 @@ static OWSSignalServiceProtosDataMessage* defaultOWSSignalServiceProtosDataMessa if (self.hasExpireTimer) { [dictionary setObject: [NSNumber numberWithInteger:self.expireTimer] forKey: @"expireTimer"]; } + if (self.hasProfileKey) { + [dictionary setObject: self.profileKey forKey: @"profileKey"]; + } [self.unknownFields storeInDictionary:dictionary]; } - (BOOL) isEqual:(id)other { @@ -3636,6 +3657,8 @@ static OWSSignalServiceProtosDataMessage* defaultOWSSignalServiceProtosDataMessa (!self.hasFlags || self.flags == otherMessage.flags) && self.hasExpireTimer == otherMessage.hasExpireTimer && (!self.hasExpireTimer || self.expireTimer == otherMessage.expireTimer) && + self.hasProfileKey == otherMessage.hasProfileKey && + (!self.hasProfileKey || [self.profileKey isEqual:otherMessage.profileKey]) && (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); } - (NSUInteger) hash { @@ -3655,6 +3678,9 @@ static OWSSignalServiceProtosDataMessage* defaultOWSSignalServiceProtosDataMessa if (self.hasExpireTimer) { hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.expireTimer] hash]; } + if (self.hasProfileKey) { + hashCode = hashCode * 31 + [self.profileKey hash]; + } hashCode = hashCode * 31 + [self.unknownFields hash]; return hashCode; } @@ -3737,6 +3763,9 @@ NSString *NSStringFromOWSSignalServiceProtosDataMessageFlags(OWSSignalServicePro if (other.hasExpireTimer) { [self setExpireTimer:other.expireTimer]; } + if (other.hasProfileKey) { + [self setProfileKey:other.profileKey]; + } [self mergeUnknownFields:other.unknownFields]; return self; } @@ -3785,6 +3814,10 @@ NSString *NSStringFromOWSSignalServiceProtosDataMessageFlags(OWSSignalServicePro [self setExpireTimer:[input readUInt32]]; break; } + case 50: { + [self setProfileKey:[input readData]]; + break; + } } } } @@ -3887,6 +3920,22 @@ NSString *NSStringFromOWSSignalServiceProtosDataMessageFlags(OWSSignalServicePro resultDataMessage.expireTimer = 0; return self; } +- (BOOL) hasProfileKey { + return resultDataMessage.hasProfileKey; +} +- (NSData*) profileKey { + return resultDataMessage.profileKey; +} +- (OWSSignalServiceProtosDataMessageBuilder*) setProfileKey:(NSData*) value { + resultDataMessage.hasProfileKey = YES; + resultDataMessage.profileKey = value; + return self; +} +- (OWSSignalServiceProtosDataMessageBuilder*) clearProfileKey { + resultDataMessage.hasProfileKey = NO; + resultDataMessage.profileKey = [NSData data]; + return self; +} @end @interface OWSSignalServiceProtosSyncMessage () @@ -3898,6 +3947,7 @@ NSString *NSStringFromOWSSignalServiceProtosDataMessageFlags(OWSSignalServicePro @property (strong) OWSSignalServiceProtosSyncMessageBlocked* blocked; @property (strong) OWSSignalServiceProtosVerified* verified; @property (strong) NSData* padding; +@property (strong) NSData* profileKey; @end @implementation OWSSignalServiceProtosSyncMessage @@ -3953,6 +4003,13 @@ NSString *NSStringFromOWSSignalServiceProtosDataMessageFlags(OWSSignalServicePro hasPadding_ = !!_value_; } @synthesize padding; +- (BOOL) hasProfileKey { + return !!hasProfileKey_; +} +- (void) setHasProfileKey:(BOOL) _value_ { + hasProfileKey_ = !!_value_; +} +@synthesize profileKey; - (instancetype) init { if ((self = [super init])) { self.sent = [OWSSignalServiceProtosSyncMessageSent defaultInstance]; @@ -3962,6 +4019,7 @@ NSString *NSStringFromOWSSignalServiceProtosDataMessageFlags(OWSSignalServicePro self.blocked = [OWSSignalServiceProtosSyncMessageBlocked defaultInstance]; self.verified = [OWSSignalServiceProtosVerified defaultInstance]; self.padding = [NSData data]; + self.profileKey = [NSData data]; } return self; } @@ -4011,6 +4069,9 @@ static OWSSignalServiceProtosSyncMessage* defaultOWSSignalServiceProtosSyncMessa if (self.hasPadding) { [output writeData:8 value:self.padding]; } + if (self.hasProfileKey) { + [output writeData:9 value:self.profileKey]; + } [self.unknownFields writeToCodedOutputStream:output]; } - (SInt32) serializedSize { @@ -4044,6 +4105,9 @@ static OWSSignalServiceProtosSyncMessage* defaultOWSSignalServiceProtosSyncMessa if (self.hasPadding) { size_ += computeDataSize(8, self.padding); } + if (self.hasProfileKey) { + size_ += computeDataSize(9, self.profileKey); + } size_ += self.unknownFields.serializedSize; memoizedSerializedSize = size_; return size_; @@ -4124,6 +4188,9 @@ static OWSSignalServiceProtosSyncMessage* defaultOWSSignalServiceProtosSyncMessa if (self.hasPadding) { [output appendFormat:@"%@%@: %@\n", indent, @"padding", self.padding]; } + if (self.hasProfileKey) { + [output appendFormat:@"%@%@: %@\n", indent, @"profileKey", self.profileKey]; + } [self.unknownFields writeDescriptionTo:output withIndent:indent]; } - (void) storeInDictionary:(NSMutableDictionary *)dictionary { @@ -4165,6 +4232,9 @@ static OWSSignalServiceProtosSyncMessage* defaultOWSSignalServiceProtosSyncMessa if (self.hasPadding) { [dictionary setObject: self.padding forKey: @"padding"]; } + if (self.hasProfileKey) { + [dictionary setObject: self.profileKey forKey: @"profileKey"]; + } [self.unknownFields storeInDictionary:dictionary]; } - (BOOL) isEqual:(id)other { @@ -4191,6 +4261,8 @@ static OWSSignalServiceProtosSyncMessage* defaultOWSSignalServiceProtosSyncMessa (!self.hasVerified || [self.verified isEqual:otherMessage.verified]) && self.hasPadding == otherMessage.hasPadding && (!self.hasPadding || [self.padding isEqual:otherMessage.padding]) && + self.hasProfileKey == otherMessage.hasProfileKey && + (!self.hasProfileKey || [self.profileKey isEqual:otherMessage.profileKey]) && (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); } - (NSUInteger) hash { @@ -4219,6 +4291,9 @@ static OWSSignalServiceProtosSyncMessage* defaultOWSSignalServiceProtosSyncMessa if (self.hasPadding) { hashCode = hashCode * 31 + [self.padding hash]; } + if (self.hasProfileKey) { + hashCode = hashCode * 31 + [self.profileKey hash]; + } hashCode = hashCode * 31 + [self.unknownFields hash]; return hashCode; } @@ -5891,6 +5966,9 @@ static OWSSignalServiceProtosSyncMessageRead* defaultOWSSignalServiceProtosSyncM if (other.hasPadding) { [self setPadding:other.padding]; } + if (other.hasProfileKey) { + [self setProfileKey:other.profileKey]; + } [self mergeUnknownFields:other.unknownFields]; return self; } @@ -5976,6 +6054,10 @@ static OWSSignalServiceProtosSyncMessageRead* defaultOWSSignalServiceProtosSyncM [self setPadding:[input readData]]; break; } + case 74: { + [self setProfileKey:[input readData]]; + break; + } } } } @@ -6196,6 +6278,22 @@ static OWSSignalServiceProtosSyncMessageRead* defaultOWSSignalServiceProtosSyncM resultSyncMessage.padding = [NSData data]; return self; } +- (BOOL) hasProfileKey { + return resultSyncMessage.hasProfileKey; +} +- (NSData*) profileKey { + return resultSyncMessage.profileKey; +} +- (OWSSignalServiceProtosSyncMessageBuilder*) setProfileKey:(NSData*) value { + resultSyncMessage.hasProfileKey = YES; + resultSyncMessage.profileKey = value; + return self; +} +- (OWSSignalServiceProtosSyncMessageBuilder*) clearProfileKey { + resultSyncMessage.hasProfileKey = NO; + resultSyncMessage.profileKey = [NSData data]; + return self; +} @end @interface OWSSignalServiceProtosAttachmentPointer ()