Merge branch 'mkirk/sync-protos'
This commit is contained in:
commit
00327986d0
|
@ -2,8 +2,8 @@
|
|||
|
||||
PROTOC=protoc \
|
||||
--plugin=/usr/local/bin/protoc-gen-objc \
|
||||
--proto_path="${HOME}/src/WhisperSystems/protobuf-objc/src/compiler/" \
|
||||
--proto_path="${HOME}/src/WhisperSystems/protobuf-objc/src/compiler/google/protobuf/" \
|
||||
--proto_path="${HOME}/src/signal/protobuf-objc/src/compiler/" \
|
||||
--proto_path="${HOME}/src/signal/protobuf-objc/src/compiler/google/protobuf/" \
|
||||
--proto_path='./'
|
||||
|
||||
all: signal_service_proto provisioning_protos fingerprint_protos
|
||||
|
|
|
@ -87,12 +87,11 @@ message DataMessage {
|
|||
PROFILE_KEY_UPDATE = 4;
|
||||
}
|
||||
|
||||
message Quote
|
||||
{
|
||||
optional uint64 id = 1;
|
||||
optional string author = 2;
|
||||
optional string text = 3;
|
||||
optional AttachmentPointer attachment = 4;
|
||||
message Quote {
|
||||
optional uint64 id = 1;
|
||||
optional string author = 2;
|
||||
optional string text = 3;
|
||||
repeated AttachmentPointer attachments = 4;
|
||||
}
|
||||
|
||||
optional string body = 1;
|
||||
|
@ -102,7 +101,7 @@ message DataMessage {
|
|||
optional uint32 expireTimer = 5;
|
||||
optional bytes profileKey = 6;
|
||||
optional uint64 timestamp = 7;
|
||||
optional Quote quote = 8;
|
||||
optional Quote quote = 8;
|
||||
}
|
||||
|
||||
message NullMessage {
|
||||
|
|
|
@ -473,7 +473,7 @@ NSString *const kTSOutgoingMessageSentRecipientAll = @"kTSOutgoingMessageSentRec
|
|||
[attachmentBuilder setFileName:self.quotedMessage.sourceFilename];
|
||||
}
|
||||
[attachmentBuilder setContentType:self.quotedMessage.contentType];
|
||||
[quoteBuilder setAttachmentBuilder:attachmentBuilder];
|
||||
[quoteBuilder.attachments addObject:[attachmentBuilder build]];
|
||||
|
||||
hasQuotedAttachment = YES;
|
||||
}
|
||||
|
|
|
@ -1097,8 +1097,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
NSData *_Nullable thumbnailData = nil;
|
||||
NSString *_Nullable contentType = nil;
|
||||
|
||||
if ([quoteProto hasAttachment]) {
|
||||
OWSSignalServiceProtosAttachmentPointer *attachmentProto = [quoteProto attachment];
|
||||
if (quoteProto.attachments.count > 0) {
|
||||
OWSSignalServiceProtosAttachmentPointer *attachmentProto = quoteProto.attachments.firstObject;
|
||||
if ([attachmentProto hasContentType] && attachmentProto.contentType.length > 0) {
|
||||
contentType = attachmentProto.contentType;
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
//
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
|
||||
#import <ProtocolBuffers/ProtocolBuffers.h>
|
||||
|
||||
|
@ -105,6 +103,7 @@
|
|||
@class PBUninterpretedOptionNamePart;
|
||||
@class PBUninterpretedOptionNamePartBuilder;
|
||||
|
||||
|
||||
typedef NS_ENUM(SInt32, OWSSignalServiceProtosEnvelopeType) {
|
||||
OWSSignalServiceProtosEnvelopeTypeUnknown = 0,
|
||||
OWSSignalServiceProtosEnvelopeTypeCiphertext = 1,
|
||||
|
@ -860,26 +859,25 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro
|
|||
#define Quote_id @"id"
|
||||
#define Quote_author @"author"
|
||||
#define Quote_text @"text"
|
||||
#define Quote_attachment @"attachment"
|
||||
#define Quote_attachments @"attachments"
|
||||
@interface OWSSignalServiceProtosDataMessageQuote : PBGeneratedMessage <GeneratedMessageProtocol> {
|
||||
@private
|
||||
BOOL hasId_ : 1;
|
||||
BOOL hasAuthor_ : 1;
|
||||
BOOL hasText_ : 1;
|
||||
BOOL hasAttachment_ : 1;
|
||||
UInt64 id;
|
||||
NSString *author;
|
||||
NSString *text;
|
||||
OWSSignalServiceProtosAttachmentPointer *attachment;
|
||||
NSMutableArray *attachmentsArray;
|
||||
}
|
||||
- (BOOL)hasId;
|
||||
- (BOOL)hasAuthor;
|
||||
- (BOOL)hasText;
|
||||
- (BOOL)hasAttachment;
|
||||
@property (readonly) UInt64 id;
|
||||
@property (readonly, strong) NSString *author;
|
||||
@property (readonly, strong) NSString *text;
|
||||
@property (readonly, strong) OWSSignalServiceProtosAttachmentPointer *attachment;
|
||||
@property (readonly, strong) NSArray<OWSSignalServiceProtosAttachmentPointer *> *attachments;
|
||||
- (OWSSignalServiceProtosAttachmentPointer *)attachmentsAtIndex:(NSUInteger)index;
|
||||
|
||||
+ (instancetype)defaultInstance;
|
||||
- (instancetype)defaultInstance;
|
||||
|
@ -936,13 +934,12 @@ NSString *NSStringFromOWSSignalServiceProtosGroupContextType(OWSSignalServicePro
|
|||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)setText:(NSString *)value;
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)clearText;
|
||||
|
||||
- (BOOL)hasAttachment;
|
||||
- (OWSSignalServiceProtosAttachmentPointer *)attachment;
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)setAttachment:(OWSSignalServiceProtosAttachmentPointer *)value;
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)setAttachmentBuilder:
|
||||
(OWSSignalServiceProtosAttachmentPointerBuilder *)builderForValue;
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)mergeAttachment:(OWSSignalServiceProtosAttachmentPointer *)value;
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)clearAttachment;
|
||||
- (NSMutableArray<OWSSignalServiceProtosAttachmentPointer *> *)attachments;
|
||||
- (OWSSignalServiceProtosAttachmentPointer *)attachmentsAtIndex:(NSUInteger)index;
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)addAttachments:(OWSSignalServiceProtosAttachmentPointer *)value;
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)setAttachmentsArray:
|
||||
(NSArray<OWSSignalServiceProtosAttachmentPointer *> *)array;
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)clearAttachments;
|
||||
@end
|
||||
|
||||
@interface OWSSignalServiceProtosDataMessageBuilder : PBGeneratedMessageBuilder {
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
//
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
|
||||
#import "OWSSignalServiceProtos.pb.h"
|
||||
|
||||
// @@protoc_insertion_point(imports)
|
||||
|
||||
@implementation OWSSignalServiceProtosOwssignalServiceProtosRoot
|
||||
|
@ -3255,7 +3252,7 @@ NSString *NSStringFromOWSSignalServiceProtosDataMessageFlags(OWSSignalServicePro
|
|||
@property UInt64 id;
|
||||
@property (strong) NSString *author;
|
||||
@property (strong) NSString *text;
|
||||
@property (strong) OWSSignalServiceProtosAttachmentPointer *attachment;
|
||||
@property (strong) NSMutableArray<OWSSignalServiceProtosAttachmentPointer *> *attachmentsArray;
|
||||
@end
|
||||
|
||||
@implementation OWSSignalServiceProtosDataMessageQuote
|
||||
|
@ -3287,22 +3284,14 @@ NSString *NSStringFromOWSSignalServiceProtosDataMessageFlags(OWSSignalServicePro
|
|||
hasText_ = !!_value_;
|
||||
}
|
||||
@synthesize text;
|
||||
- (BOOL)hasAttachment
|
||||
{
|
||||
return !!hasAttachment_;
|
||||
}
|
||||
- (void)setHasAttachment:(BOOL)_value_
|
||||
{
|
||||
hasAttachment_ = !!_value_;
|
||||
}
|
||||
@synthesize attachment;
|
||||
@synthesize attachmentsArray;
|
||||
@dynamic attachments;
|
||||
- (instancetype)init
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
self.id = 0L;
|
||||
self.author = @"";
|
||||
self.text = @"";
|
||||
self.attachment = [OWSSignalServiceProtosAttachmentPointer defaultInstance];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -3321,6 +3310,14 @@ static OWSSignalServiceProtosDataMessageQuote *defaultOWSSignalServiceProtosData
|
|||
{
|
||||
return defaultOWSSignalServiceProtosDataMessageQuoteInstance;
|
||||
}
|
||||
- (NSArray<OWSSignalServiceProtosAttachmentPointer *> *)attachments
|
||||
{
|
||||
return attachmentsArray;
|
||||
}
|
||||
- (OWSSignalServiceProtosAttachmentPointer *)attachmentsAtIndex:(NSUInteger)index
|
||||
{
|
||||
return [attachmentsArray objectAtIndex:index];
|
||||
}
|
||||
- (BOOL)isInitialized
|
||||
{
|
||||
return YES;
|
||||
|
@ -3336,9 +3333,10 @@ static OWSSignalServiceProtosDataMessageQuote *defaultOWSSignalServiceProtosData
|
|||
if (self.hasText) {
|
||||
[output writeString:3 value:self.text];
|
||||
}
|
||||
if (self.hasAttachment) {
|
||||
[output writeMessage:4 value:self.attachment];
|
||||
}
|
||||
[self.attachmentsArray
|
||||
enumerateObjectsUsingBlock:^(OWSSignalServiceProtosAttachmentPointer *element, NSUInteger idx, BOOL *stop) {
|
||||
[output writeMessage:4 value:element];
|
||||
}];
|
||||
[self.unknownFields writeToCodedOutputStream:output];
|
||||
}
|
||||
- (SInt32)serializedSize
|
||||
|
@ -3358,9 +3356,10 @@ static OWSSignalServiceProtosDataMessageQuote *defaultOWSSignalServiceProtosData
|
|||
if (self.hasText) {
|
||||
size_ += computeStringSize(3, self.text);
|
||||
}
|
||||
if (self.hasAttachment) {
|
||||
size_ += computeMessageSize(4, self.attachment);
|
||||
}
|
||||
[self.attachmentsArray
|
||||
enumerateObjectsUsingBlock:^(OWSSignalServiceProtosAttachmentPointer *element, NSUInteger idx, BOOL *stop) {
|
||||
size_ += computeMessageSize(4, element);
|
||||
}];
|
||||
size_ += self.unknownFields.serializedSize;
|
||||
memoizedSerializedSize = size_;
|
||||
return size_;
|
||||
|
@ -3429,11 +3428,12 @@ static OWSSignalServiceProtosDataMessageQuote *defaultOWSSignalServiceProtosData
|
|||
if (self.hasText) {
|
||||
[output appendFormat:@"%@%@: %@\n", indent, @"text", self.text];
|
||||
}
|
||||
if (self.hasAttachment) {
|
||||
[output appendFormat:@"%@%@ {\n", indent, @"attachment"];
|
||||
[self.attachment writeDescriptionTo:output withIndent:[NSString stringWithFormat:@"%@ ", indent]];
|
||||
[output appendFormat:@"%@}\n", indent];
|
||||
}
|
||||
[self.attachmentsArray
|
||||
enumerateObjectsUsingBlock:^(OWSSignalServiceProtosAttachmentPointer *element, NSUInteger idx, BOOL *stop) {
|
||||
[output appendFormat:@"%@%@ {\n", indent, @"attachments"];
|
||||
[element writeDescriptionTo:output withIndent:[NSString stringWithFormat:@"%@ ", indent]];
|
||||
[output appendFormat:@"%@}\n", indent];
|
||||
}];
|
||||
[self.unknownFields writeDescriptionTo:output withIndent:indent];
|
||||
}
|
||||
- (void)storeInDictionary:(NSMutableDictionary *)dictionary
|
||||
|
@ -3447,10 +3447,10 @@ static OWSSignalServiceProtosDataMessageQuote *defaultOWSSignalServiceProtosData
|
|||
if (self.hasText) {
|
||||
[dictionary setObject:self.text forKey:@"text"];
|
||||
}
|
||||
if (self.hasAttachment) {
|
||||
NSMutableDictionary *messageDictionary = [NSMutableDictionary dictionary];
|
||||
[self.attachment storeInDictionary:messageDictionary];
|
||||
[dictionary setObject:[NSDictionary dictionaryWithDictionary:messageDictionary] forKey:@"attachment"];
|
||||
for (OWSSignalServiceProtosAttachmentPointer *element in self.attachmentsArray) {
|
||||
NSMutableDictionary *elementDictionary = [NSMutableDictionary dictionary];
|
||||
[element storeInDictionary:elementDictionary];
|
||||
[dictionary setObject:[NSDictionary dictionaryWithDictionary:elementDictionary] forKey:@"attachments"];
|
||||
}
|
||||
[self.unknownFields storeInDictionary:dictionary];
|
||||
}
|
||||
|
@ -3465,9 +3465,8 @@ static OWSSignalServiceProtosDataMessageQuote *defaultOWSSignalServiceProtosData
|
|||
OWSSignalServiceProtosDataMessageQuote *otherMessage = other;
|
||||
return self.hasId == otherMessage.hasId && (!self.hasId || self.id == otherMessage.id)
|
||||
&& self.hasAuthor == otherMessage.hasAuthor && (!self.hasAuthor || [self.author isEqual:otherMessage.author])
|
||||
&& self.hasText == otherMessage.hasText && (!self.hasText || [self.text isEqual:otherMessage.text])
|
||||
&& self.hasAttachment == otherMessage.hasAttachment
|
||||
&& (!self.hasAttachment || [self.attachment isEqual:otherMessage.attachment])
|
||||
&& self.hasText == otherMessage.hasText && (!self.hasText || [self.text isEqual:otherMessage.text]) &&
|
||||
[self.attachmentsArray isEqualToArray:otherMessage.attachmentsArray]
|
||||
&& (self.unknownFields == otherMessage.unknownFields
|
||||
|| (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields]));
|
||||
}
|
||||
|
@ -3483,9 +3482,10 @@ static OWSSignalServiceProtosDataMessageQuote *defaultOWSSignalServiceProtosData
|
|||
if (self.hasText) {
|
||||
hashCode = hashCode * 31 + [self.text hash];
|
||||
}
|
||||
if (self.hasAttachment) {
|
||||
hashCode = hashCode * 31 + [self.attachment hash];
|
||||
}
|
||||
[self.attachmentsArray
|
||||
enumerateObjectsUsingBlock:^(OWSSignalServiceProtosAttachmentPointer *element, NSUInteger idx, BOOL *stop) {
|
||||
hashCode = hashCode * 31 + [element hash];
|
||||
}];
|
||||
hashCode = hashCode * 31 + [self.unknownFields hash];
|
||||
return hashCode;
|
||||
}
|
||||
|
@ -3546,8 +3546,12 @@ static OWSSignalServiceProtosDataMessageQuote *defaultOWSSignalServiceProtosData
|
|||
if (other.hasText) {
|
||||
[self setText:other.text];
|
||||
}
|
||||
if (other.hasAttachment) {
|
||||
[self mergeAttachment:other.attachment];
|
||||
if (other.attachmentsArray.count > 0) {
|
||||
if (resultQuote.attachmentsArray == nil) {
|
||||
resultQuote.attachmentsArray = [[NSMutableArray alloc] initWithArray:other.attachmentsArray];
|
||||
} else {
|
||||
[resultQuote.attachmentsArray addObjectsFromArray:other.attachmentsArray];
|
||||
}
|
||||
}
|
||||
[self mergeUnknownFields:other.unknownFields];
|
||||
return self;
|
||||
|
@ -3591,11 +3595,8 @@ static OWSSignalServiceProtosDataMessageQuote *defaultOWSSignalServiceProtosData
|
|||
case 34: {
|
||||
OWSSignalServiceProtosAttachmentPointerBuilder *subBuilder =
|
||||
[OWSSignalServiceProtosAttachmentPointer builder];
|
||||
if (self.hasAttachment) {
|
||||
[subBuilder mergeFrom:self.attachment];
|
||||
}
|
||||
[input readMessage:subBuilder extensionRegistry:extensionRegistry];
|
||||
[self setAttachment:[subBuilder buildPartial]];
|
||||
[self addAttachments:[subBuilder buildPartial]];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3661,41 +3662,31 @@ static OWSSignalServiceProtosDataMessageQuote *defaultOWSSignalServiceProtosData
|
|||
resultQuote.text = @"";
|
||||
return self;
|
||||
}
|
||||
- (BOOL)hasAttachment
|
||||
- (NSMutableArray<OWSSignalServiceProtosAttachmentPointer *> *)attachments
|
||||
{
|
||||
return resultQuote.hasAttachment;
|
||||
return resultQuote.attachmentsArray;
|
||||
}
|
||||
- (OWSSignalServiceProtosAttachmentPointer *)attachment
|
||||
- (OWSSignalServiceProtosAttachmentPointer *)attachmentsAtIndex:(NSUInteger)index
|
||||
{
|
||||
return resultQuote.attachment;
|
||||
return [resultQuote attachmentsAtIndex:index];
|
||||
}
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)setAttachment:(OWSSignalServiceProtosAttachmentPointer *)value
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)addAttachments:(OWSSignalServiceProtosAttachmentPointer *)value
|
||||
{
|
||||
resultQuote.hasAttachment = YES;
|
||||
resultQuote.attachment = value;
|
||||
return self;
|
||||
}
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)setAttachmentBuilder:
|
||||
(OWSSignalServiceProtosAttachmentPointerBuilder *)builderForValue
|
||||
{
|
||||
return [self setAttachment:[builderForValue build]];
|
||||
}
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)mergeAttachment:(OWSSignalServiceProtosAttachmentPointer *)value
|
||||
{
|
||||
if (resultQuote.hasAttachment
|
||||
&& resultQuote.attachment != [OWSSignalServiceProtosAttachmentPointer defaultInstance]) {
|
||||
resultQuote.attachment = [[[OWSSignalServiceProtosAttachmentPointer builderWithPrototype:resultQuote.attachment]
|
||||
mergeFrom:value] buildPartial];
|
||||
} else {
|
||||
resultQuote.attachment = value;
|
||||
if (resultQuote.attachmentsArray == nil) {
|
||||
resultQuote.attachmentsArray = [[NSMutableArray alloc] init];
|
||||
}
|
||||
resultQuote.hasAttachment = YES;
|
||||
[resultQuote.attachmentsArray addObject:value];
|
||||
return self;
|
||||
}
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)clearAttachment
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)setAttachmentsArray:
|
||||
(NSArray<OWSSignalServiceProtosAttachmentPointer *> *)array
|
||||
{
|
||||
resultQuote.hasAttachment = NO;
|
||||
resultQuote.attachment = [OWSSignalServiceProtosAttachmentPointer defaultInstance];
|
||||
resultQuote.attachmentsArray = [[NSMutableArray alloc] initWithArray:array];
|
||||
return self;
|
||||
}
|
||||
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)clearAttachments
|
||||
{
|
||||
resultQuote.attachmentsArray = nil;
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue