|
|
|
@ -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;
|
|
|
|
|
if (resultQuote.attachmentsArray == nil) {
|
|
|
|
|
resultQuote.attachmentsArray = [[NSMutableArray alloc] init];
|
|
|
|
|
}
|
|
|
|
|
[resultQuote.attachmentsArray addObject:value];
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)setAttachmentBuilder:
|
|
|
|
|
(OWSSignalServiceProtosAttachmentPointerBuilder *)builderForValue
|
|
|
|
|
{
|
|
|
|
|
return [self setAttachment:[builderForValue build]];
|
|
|
|
|
}
|
|
|
|
|
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)mergeAttachment:(OWSSignalServiceProtosAttachmentPointer *)value
|
|
|
|
|
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)setAttachmentsArray:
|
|
|
|
|
(NSArray<OWSSignalServiceProtosAttachmentPointer *> *)array
|
|
|
|
|
{
|
|
|
|
|
if (resultQuote.hasAttachment
|
|
|
|
|
&& resultQuote.attachment != [OWSSignalServiceProtosAttachmentPointer defaultInstance]) {
|
|
|
|
|
resultQuote.attachment = [[[OWSSignalServiceProtosAttachmentPointer builderWithPrototype:resultQuote.attachment]
|
|
|
|
|
mergeFrom:value] buildPartial];
|
|
|
|
|
} else {
|
|
|
|
|
resultQuote.attachment = value;
|
|
|
|
|
}
|
|
|
|
|
resultQuote.hasAttachment = YES;
|
|
|
|
|
resultQuote.attachmentsArray = [[NSMutableArray alloc] initWithArray:array];
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)clearAttachment
|
|
|
|
|
- (OWSSignalServiceProtosDataMessageQuoteBuilder *)clearAttachments
|
|
|
|
|
{
|
|
|
|
|
resultQuote.hasAttachment = NO;
|
|
|
|
|
resultQuote.attachment = [OWSSignalServiceProtosAttachmentPointer defaultInstance];
|
|
|
|
|
resultQuote.attachmentsArray = nil;
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
@end
|
|
|
|
|