|
|
@ -1079,8 +1079,7 @@ static OWSSignalServiceProtosContent* defaultOWSSignalServiceProtosContentInstan
|
|
|
|
|
|
|
|
|
|
|
|
@interface OWSSignalServiceProtosReceiptMessage ()
|
|
|
|
@interface OWSSignalServiceProtosReceiptMessage ()
|
|
|
|
@property OWSSignalServiceProtosReceiptMessageType type;
|
|
|
|
@property OWSSignalServiceProtosReceiptMessageType type;
|
|
|
|
@property (strong) PBAppendableArray * timestampsArray;
|
|
|
|
@property (strong) PBAppendableArray * timestampArray;
|
|
|
|
@property UInt64 when;
|
|
|
|
|
|
|
|
@end
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
@implementation OWSSignalServiceProtosReceiptMessage
|
|
|
|
@implementation OWSSignalServiceProtosReceiptMessage
|
|
|
@ -1092,19 +1091,11 @@ static OWSSignalServiceProtosContent* defaultOWSSignalServiceProtosContentInstan
|
|
|
|
hasType_ = !!_value_;
|
|
|
|
hasType_ = !!_value_;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@synthesize type;
|
|
|
|
@synthesize type;
|
|
|
|
@synthesize timestampsArray;
|
|
|
|
@synthesize timestampArray;
|
|
|
|
@dynamic timestamps;
|
|
|
|
@dynamic timestamp;
|
|
|
|
- (BOOL) hasWhen {
|
|
|
|
|
|
|
|
return !!hasWhen_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setHasWhen:(BOOL) _value_ {
|
|
|
|
|
|
|
|
hasWhen_ = !!_value_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@synthesize when;
|
|
|
|
|
|
|
|
- (instancetype) init {
|
|
|
|
- (instancetype) init {
|
|
|
|
if ((self = [super init])) {
|
|
|
|
if ((self = [super init])) {
|
|
|
|
self.type = OWSSignalServiceProtosReceiptMessageTypeDelivery;
|
|
|
|
self.type = OWSSignalServiceProtosReceiptMessageTypeDelivery;
|
|
|
|
self.when = 0L;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1120,11 +1111,11 @@ static OWSSignalServiceProtosReceiptMessage* defaultOWSSignalServiceProtosReceip
|
|
|
|
- (instancetype) defaultInstance {
|
|
|
|
- (instancetype) defaultInstance {
|
|
|
|
return defaultOWSSignalServiceProtosReceiptMessageInstance;
|
|
|
|
return defaultOWSSignalServiceProtosReceiptMessageInstance;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- (PBArray *)timestamps {
|
|
|
|
- (PBArray *)timestamp {
|
|
|
|
return timestampsArray;
|
|
|
|
return timestampArray;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- (UInt64)timestampsAtIndex:(NSUInteger)index {
|
|
|
|
- (UInt64)timestampAtIndex:(NSUInteger)index {
|
|
|
|
return [timestampsArray uint64AtIndex:index];
|
|
|
|
return [timestampArray uint64AtIndex:index];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- (BOOL) isInitialized {
|
|
|
|
- (BOOL) isInitialized {
|
|
|
|
return YES;
|
|
|
|
return YES;
|
|
|
@ -1133,16 +1124,13 @@ static OWSSignalServiceProtosReceiptMessage* defaultOWSSignalServiceProtosReceip
|
|
|
|
if (self.hasType) {
|
|
|
|
if (self.hasType) {
|
|
|
|
[output writeEnum:1 value:self.type];
|
|
|
|
[output writeEnum:1 value:self.type];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const NSUInteger timestampsArrayCount = self.timestampsArray.count;
|
|
|
|
const NSUInteger timestampArrayCount = self.timestampArray.count;
|
|
|
|
if (timestampsArrayCount > 0) {
|
|
|
|
if (timestampArrayCount > 0) {
|
|
|
|
const UInt64 *values = (const UInt64 *)self.timestampsArray.data;
|
|
|
|
const UInt64 *values = (const UInt64 *)self.timestampArray.data;
|
|
|
|
for (NSUInteger i = 0; i < timestampsArrayCount; ++i) {
|
|
|
|
for (NSUInteger i = 0; i < timestampArrayCount; ++i) {
|
|
|
|
[output writeUInt64:2 value:values[i]];
|
|
|
|
[output writeUInt64:2 value:values[i]];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (self.hasWhen) {
|
|
|
|
|
|
|
|
[output writeUInt64:3 value:self.when];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
[self.unknownFields writeToCodedOutputStream:output];
|
|
|
|
[self.unknownFields writeToCodedOutputStream:output];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- (SInt32) serializedSize {
|
|
|
|
- (SInt32) serializedSize {
|
|
|
@ -1157,17 +1145,14 @@ static OWSSignalServiceProtosReceiptMessage* defaultOWSSignalServiceProtosReceip
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
__block SInt32 dataSize = 0;
|
|
|
|
__block SInt32 dataSize = 0;
|
|
|
|
const NSUInteger count = self.timestampsArray.count;
|
|
|
|
const NSUInteger count = self.timestampArray.count;
|
|
|
|
const UInt64 *values = (const UInt64 *)self.timestampsArray.data;
|
|
|
|
const UInt64 *values = (const UInt64 *)self.timestampArray.data;
|
|
|
|
for (NSUInteger i = 0; i < count; ++i) {
|
|
|
|
for (NSUInteger i = 0; i < count; ++i) {
|
|
|
|
dataSize += computeUInt64SizeNoTag(values[i]);
|
|
|
|
dataSize += computeUInt64SizeNoTag(values[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
size_ += dataSize;
|
|
|
|
size_ += dataSize;
|
|
|
|
size_ += (SInt32)(1 * count);
|
|
|
|
size_ += (SInt32)(1 * count);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (self.hasWhen) {
|
|
|
|
|
|
|
|
size_ += computeUInt64Size(3, self.when);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
size_ += self.unknownFields.serializedSize;
|
|
|
|
size_ += self.unknownFields.serializedSize;
|
|
|
|
memoizedSerializedSize = size_;
|
|
|
|
memoizedSerializedSize = size_;
|
|
|
|
return size_;
|
|
|
|
return size_;
|
|
|
@ -1206,27 +1191,21 @@ static OWSSignalServiceProtosReceiptMessage* defaultOWSSignalServiceProtosReceip
|
|
|
|
if (self.hasType) {
|
|
|
|
if (self.hasType) {
|
|
|
|
[output appendFormat:@"%@%@: %@\n", indent, @"type", NSStringFromOWSSignalServiceProtosReceiptMessageType(self.type)];
|
|
|
|
[output appendFormat:@"%@%@: %@\n", indent, @"type", NSStringFromOWSSignalServiceProtosReceiptMessageType(self.type)];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
[self.timestampsArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
|
|
|
[self.timestampArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
|
|
|
[output appendFormat:@"%@%@: %@\n", indent, @"timestamps", obj];
|
|
|
|
[output appendFormat:@"%@%@: %@\n", indent, @"timestamp", obj];
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
if (self.hasWhen) {
|
|
|
|
|
|
|
|
[output appendFormat:@"%@%@: %@\n", indent, @"when", [NSNumber numberWithLongLong:self.when]];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
[self.unknownFields writeDescriptionTo:output withIndent:indent];
|
|
|
|
[self.unknownFields writeDescriptionTo:output withIndent:indent];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- (void) storeInDictionary:(NSMutableDictionary *)dictionary {
|
|
|
|
- (void) storeInDictionary:(NSMutableDictionary *)dictionary {
|
|
|
|
if (self.hasType) {
|
|
|
|
if (self.hasType) {
|
|
|
|
[dictionary setObject: @(self.type) forKey: @"type"];
|
|
|
|
[dictionary setObject: @(self.type) forKey: @"type"];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
NSMutableArray * timestampsArrayArray = [NSMutableArray new];
|
|
|
|
NSMutableArray * timestampArrayArray = [NSMutableArray new];
|
|
|
|
NSUInteger timestampsArrayCount=self.timestampsArray.count;
|
|
|
|
NSUInteger timestampArrayCount=self.timestampArray.count;
|
|
|
|
for(int i=0;i<timestampsArrayCount;i++){
|
|
|
|
for(int i=0;i<timestampArrayCount;i++){
|
|
|
|
[timestampsArrayArray addObject: @([self.timestampsArray uint64AtIndex:i])];
|
|
|
|
[timestampArrayArray addObject: @([self.timestampArray uint64AtIndex:i])];
|
|
|
|
}
|
|
|
|
|
|
|
|
[dictionary setObject: timestampsArrayArray forKey: @"timestamps"];
|
|
|
|
|
|
|
|
if (self.hasWhen) {
|
|
|
|
|
|
|
|
[dictionary setObject: [NSNumber numberWithLongLong:self.when] forKey: @"when"];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[dictionary setObject: timestampArrayArray forKey: @"timestamp"];
|
|
|
|
[self.unknownFields storeInDictionary:dictionary];
|
|
|
|
[self.unknownFields storeInDictionary:dictionary];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- (BOOL) isEqual:(id)other {
|
|
|
|
- (BOOL) isEqual:(id)other {
|
|
|
@ -1240,9 +1219,7 @@ static OWSSignalServiceProtosReceiptMessage* defaultOWSSignalServiceProtosReceip
|
|
|
|
return
|
|
|
|
return
|
|
|
|
self.hasType == otherMessage.hasType &&
|
|
|
|
self.hasType == otherMessage.hasType &&
|
|
|
|
(!self.hasType || self.type == otherMessage.type) &&
|
|
|
|
(!self.hasType || self.type == otherMessage.type) &&
|
|
|
|
[self.timestampsArray isEqualToArray:otherMessage.timestampsArray] &&
|
|
|
|
[self.timestampArray isEqualToArray:otherMessage.timestampArray] &&
|
|
|
|
self.hasWhen == otherMessage.hasWhen &&
|
|
|
|
|
|
|
|
(!self.hasWhen || self.when == otherMessage.when) &&
|
|
|
|
|
|
|
|
(self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields]));
|
|
|
|
(self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- (NSUInteger) hash {
|
|
|
|
- (NSUInteger) hash {
|
|
|
@ -1250,12 +1227,9 @@ static OWSSignalServiceProtosReceiptMessage* defaultOWSSignalServiceProtosReceip
|
|
|
|
if (self.hasType) {
|
|
|
|
if (self.hasType) {
|
|
|
|
hashCode = hashCode * 31 + self.type;
|
|
|
|
hashCode = hashCode * 31 + self.type;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
[self.timestampsArray enumerateObjectsUsingBlock:^(NSNumber *obj, NSUInteger idx, BOOL *stop) {
|
|
|
|
[self.timestampArray enumerateObjectsUsingBlock:^(NSNumber *obj, NSUInteger idx, BOOL *stop) {
|
|
|
|
hashCode = hashCode * 31 + [obj longValue];
|
|
|
|
hashCode = hashCode * 31 + [obj longValue];
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
if (self.hasWhen) {
|
|
|
|
|
|
|
|
hashCode = hashCode * 31 + [[NSNumber numberWithLongLong:self.when] hash];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
hashCode = hashCode * 31 + [self.unknownFields hash];
|
|
|
|
hashCode = hashCode * 31 + [self.unknownFields hash];
|
|
|
|
return hashCode;
|
|
|
|
return hashCode;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1322,16 +1296,13 @@ NSString *NSStringFromOWSSignalServiceProtosReceiptMessageType(OWSSignalServiceP
|
|
|
|
if (other.hasType) {
|
|
|
|
if (other.hasType) {
|
|
|
|
[self setType:other.type];
|
|
|
|
[self setType:other.type];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (other.timestampsArray.count > 0) {
|
|
|
|
if (other.timestampArray.count > 0) {
|
|
|
|
if (resultReceiptMessage.timestampsArray == nil) {
|
|
|
|
if (resultReceiptMessage.timestampArray == nil) {
|
|
|
|
resultReceiptMessage.timestampsArray = [other.timestampsArray copy];
|
|
|
|
resultReceiptMessage.timestampArray = [other.timestampArray copy];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
[resultReceiptMessage.timestampsArray appendArray:other.timestampsArray];
|
|
|
|
[resultReceiptMessage.timestampArray appendArray:other.timestampArray];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (other.hasWhen) {
|
|
|
|
|
|
|
|
[self setWhen:other.when];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
[self mergeUnknownFields:other.unknownFields];
|
|
|
|
[self mergeUnknownFields:other.unknownFields];
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1363,11 +1334,7 @@ NSString *NSStringFromOWSSignalServiceProtosReceiptMessageType(OWSSignalServiceP
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 16: {
|
|
|
|
case 16: {
|
|
|
|
[self addTimestamps:[input readUInt64]];
|
|
|
|
[self addTimestamp:[input readUInt64]];
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case 24: {
|
|
|
|
|
|
|
|
[self setWhen:[input readUInt64]];
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1389,45 +1356,29 @@ NSString *NSStringFromOWSSignalServiceProtosReceiptMessageType(OWSSignalServiceP
|
|
|
|
resultReceiptMessage.type = OWSSignalServiceProtosReceiptMessageTypeDelivery;
|
|
|
|
resultReceiptMessage.type = OWSSignalServiceProtosReceiptMessageTypeDelivery;
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- (PBAppendableArray *)timestamps {
|
|
|
|
- (PBAppendableArray *)timestamp {
|
|
|
|
return resultReceiptMessage.timestampsArray;
|
|
|
|
return resultReceiptMessage.timestampArray;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (UInt64)timestampsAtIndex:(NSUInteger)index {
|
|
|
|
|
|
|
|
return [resultReceiptMessage timestampsAtIndex:index];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
- (OWSSignalServiceProtosReceiptMessageBuilder *)addTimestamps:(UInt64)value {
|
|
|
|
|
|
|
|
if (resultReceiptMessage.timestampsArray == nil) {
|
|
|
|
|
|
|
|
resultReceiptMessage.timestampsArray = [PBAppendableArray arrayWithValueType:PBArrayValueTypeUInt64];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
[resultReceiptMessage.timestampsArray addUint64:value];
|
|
|
|
- (UInt64)timestampAtIndex:(NSUInteger)index {
|
|
|
|
return self;
|
|
|
|
return [resultReceiptMessage timestampAtIndex:index];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- (OWSSignalServiceProtosReceiptMessageBuilder *)setTimestampsArray:(NSArray *)array {
|
|
|
|
- (OWSSignalServiceProtosReceiptMessageBuilder *)addTimestamp:(UInt64)value {
|
|
|
|
resultReceiptMessage.timestampsArray = [PBAppendableArray arrayWithArray:array valueType:PBArrayValueTypeUInt64];
|
|
|
|
if (resultReceiptMessage.timestampArray == nil) {
|
|
|
|
return self;
|
|
|
|
resultReceiptMessage.timestampArray = [PBAppendableArray arrayWithValueType:PBArrayValueTypeUInt64];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- (OWSSignalServiceProtosReceiptMessageBuilder *)setTimestampsValues:(const UInt64 *)values count:(NSUInteger)count {
|
|
|
|
[resultReceiptMessage.timestampArray addUint64:value];
|
|
|
|
resultReceiptMessage.timestampsArray = [PBAppendableArray arrayWithValues:values count:count valueType:PBArrayValueTypeUInt64];
|
|
|
|
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- (OWSSignalServiceProtosReceiptMessageBuilder *)clearTimestamps {
|
|
|
|
- (OWSSignalServiceProtosReceiptMessageBuilder *)setTimestampArray:(NSArray *)array {
|
|
|
|
resultReceiptMessage.timestampsArray = nil;
|
|
|
|
resultReceiptMessage.timestampArray = [PBAppendableArray arrayWithArray:array valueType:PBArrayValueTypeUInt64];
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- (BOOL) hasWhen {
|
|
|
|
- (OWSSignalServiceProtosReceiptMessageBuilder *)setTimestampValues:(const UInt64 *)values count:(NSUInteger)count {
|
|
|
|
return resultReceiptMessage.hasWhen;
|
|
|
|
resultReceiptMessage.timestampArray = [PBAppendableArray arrayWithValues:values count:count valueType:PBArrayValueTypeUInt64];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (UInt64) when {
|
|
|
|
|
|
|
|
return resultReceiptMessage.when;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
- (OWSSignalServiceProtosReceiptMessageBuilder*) setWhen:(UInt64) value {
|
|
|
|
|
|
|
|
resultReceiptMessage.hasWhen = YES;
|
|
|
|
|
|
|
|
resultReceiptMessage.when = value;
|
|
|
|
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- (OWSSignalServiceProtosReceiptMessageBuilder*) clearWhen {
|
|
|
|
- (OWSSignalServiceProtosReceiptMessageBuilder *)clearTimestamp {
|
|
|
|
resultReceiptMessage.hasWhen = NO;
|
|
|
|
resultReceiptMessage.timestampArray = nil;
|
|
|
|
resultReceiptMessage.when = 0L;
|
|
|
|
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
@end
|
|
|
|