Decrypt incoming UD messages.
This commit is contained in:
parent
bfbd418cb1
commit
0c0d2a702e
|
@ -686,6 +686,39 @@ public func serializedData() throws -> Data {
|
||||||
writer.add('return %s(%s)' % (self.swift_builder_name, ', '.join(required_init_args), ))
|
writer.add('return %s(%s)' % (self.swift_builder_name, ', '.join(required_init_args), ))
|
||||||
writer.newline()
|
writer.newline()
|
||||||
|
|
||||||
|
# asBuilder()
|
||||||
|
writer.add('// asBuilder() constructs a builder that reflects the proto\'s contents.')
|
||||||
|
with writer.braced('@objc public func asBuilder() -> %s' % (
|
||||||
|
self.swift_builder_name,
|
||||||
|
)) as writer:
|
||||||
|
writer.add('let builder = %s(%s)' % (self.swift_builder_name, ', '.join(required_init_args), ))
|
||||||
|
|
||||||
|
for field in self.fields():
|
||||||
|
if field.is_required:
|
||||||
|
continue
|
||||||
|
|
||||||
|
accessor_name = field.name_swift
|
||||||
|
accessor_name = 'set' + accessor_name[0].upper() + accessor_name[1:]
|
||||||
|
|
||||||
|
can_be_optional = (not self.is_field_primitive(field)) and (not self.is_field_an_enum(field))
|
||||||
|
if field.rules == 'repeated':
|
||||||
|
writer.add('builder.%s(%s)' % ( accessor_name, field.name_swift, ))
|
||||||
|
elif can_be_optional:
|
||||||
|
writer.add('if let _value = %s {' % field.name_swift )
|
||||||
|
writer.push_indent()
|
||||||
|
writer.add('builder.%s(_value)' % ( accessor_name, ))
|
||||||
|
writer.pop_indent()
|
||||||
|
writer.add('}')
|
||||||
|
else:
|
||||||
|
writer.add('if %s {' % field.has_accessor_name() )
|
||||||
|
writer.push_indent()
|
||||||
|
writer.add('builder.%s(%s)' % ( accessor_name, field.name_swift, ))
|
||||||
|
writer.pop_indent()
|
||||||
|
writer.add('}')
|
||||||
|
|
||||||
|
writer.add('return builder')
|
||||||
|
writer.newline()
|
||||||
|
|
||||||
writer.add('@objc public class %s: NSObject {' % self.swift_builder_name)
|
writer.add('@objc public class %s: NSObject {' % self.swift_builder_name)
|
||||||
writer.newline()
|
writer.newline()
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
@class SSKProtoEnvelope;
|
@class SSKProtoEnvelope;
|
||||||
@class YapDatabaseReadWriteTransaction;
|
@class YapDatabaseReadWriteTransaction;
|
||||||
|
|
||||||
typedef void (^DecryptSuccessBlock)(NSData *_Nullable plaintextData, YapDatabaseReadWriteTransaction *transaction);
|
// Decryption result includes the envelope since the envelope
|
||||||
|
// may be altered by the decryption process.
|
||||||
|
typedef void (^DecryptSuccessBlock)(
|
||||||
|
NSData *envelopeData, NSData *_Nullable plaintextData, YapDatabaseReadWriteTransaction *transaction);
|
||||||
typedef void (^DecryptFailureBlock)(void);
|
typedef void (^DecryptFailureBlock)(void);
|
||||||
|
|
||||||
@interface OWSMessageDecrypter : OWSMessageHandler
|
@interface OWSMessageDecrypter : OWSMessageHandler
|
||||||
|
@ -24,6 +27,7 @@ typedef void (^DecryptFailureBlock)(void);
|
||||||
// Exactly one of successBlock & failureBlock will be called,
|
// Exactly one of successBlock & failureBlock will be called,
|
||||||
// once.
|
// once.
|
||||||
- (void)decryptEnvelope:(SSKProtoEnvelope *)envelope
|
- (void)decryptEnvelope:(SSKProtoEnvelope *)envelope
|
||||||
|
envelopeData:(NSData *)envelopeData
|
||||||
successBlock:(DecryptSuccessBlock)successBlock
|
successBlock:(DecryptSuccessBlock)successBlock
|
||||||
failureBlock:(DecryptFailureBlock)failureBlock;
|
failureBlock:(DecryptFailureBlock)failureBlock;
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#import "TSPreKeyManager.h"
|
#import "TSPreKeyManager.h"
|
||||||
#import <AxolotlKit/AxolotlExceptions.h>
|
#import <AxolotlKit/AxolotlExceptions.h>
|
||||||
#import <AxolotlKit/SessionCipher.h>
|
#import <AxolotlKit/SessionCipher.h>
|
||||||
|
#import <SignalCoreKit/Randomness.h>
|
||||||
#import <SignalMetadataKit/SignalMetadataKit-Swift.h>
|
#import <SignalMetadataKit/SignalMetadataKit-Swift.h>
|
||||||
#import <SignalServiceKit/SignalServiceKit-Swift.h>
|
#import <SignalServiceKit/SignalServiceKit-Swift.h>
|
||||||
|
|
||||||
|
@ -84,10 +85,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
#pragma mark - Decryption
|
#pragma mark - Decryption
|
||||||
|
|
||||||
- (void)decryptEnvelope:(SSKProtoEnvelope *)envelope
|
- (void)decryptEnvelope:(SSKProtoEnvelope *)envelope
|
||||||
|
envelopeData:(NSData *)envelopeData
|
||||||
successBlock:(DecryptSuccessBlock)successBlockParameter
|
successBlock:(DecryptSuccessBlock)successBlockParameter
|
||||||
failureBlock:(DecryptFailureBlock)failureBlockParameter
|
failureBlock:(DecryptFailureBlock)failureBlockParameter
|
||||||
{
|
{
|
||||||
OWSAssertDebug(envelope);
|
OWSAssertDebug(envelope);
|
||||||
|
OWSAssertDebug(envelopeData);
|
||||||
OWSAssertDebug(successBlockParameter);
|
OWSAssertDebug(successBlockParameter);
|
||||||
OWSAssertDebug(failureBlockParameter);
|
OWSAssertDebug(failureBlockParameter);
|
||||||
OWSAssertDebug([TSAccountManager isRegistered]);
|
OWSAssertDebug([TSAccountManager isRegistered]);
|
||||||
|
@ -103,14 +106,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
};
|
};
|
||||||
|
|
||||||
DecryptSuccessBlock successBlock
|
DecryptSuccessBlock successBlock
|
||||||
= ^(NSData *_Nullable plaintextData, YapDatabaseReadWriteTransaction *transaction) {
|
= ^(NSData *envelopeData, NSData *_Nullable plaintextData, YapDatabaseReadWriteTransaction *transaction) {
|
||||||
// Having received a valid (decryptable) message from this user,
|
// Having received a valid (decryptable) message from this user,
|
||||||
// make note of the fact that they have a valid Signal account.
|
// make note of the fact that they have a valid Signal account.
|
||||||
[SignalRecipient markRecipientAsRegistered:envelope.source
|
[SignalRecipient markRecipientAsRegistered:envelope.source
|
||||||
deviceId:envelope.sourceDevice
|
deviceId:envelope.sourceDevice
|
||||||
transaction:transaction];
|
transaction:transaction];
|
||||||
|
|
||||||
successBlockParameter(plaintextData, transaction);
|
successBlockParameter(envelopeData, plaintextData, transaction);
|
||||||
};
|
};
|
||||||
|
|
||||||
@try {
|
@try {
|
||||||
|
@ -126,9 +129,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
switch (envelope.type) {
|
switch (envelope.type) {
|
||||||
case SSKProtoEnvelopeTypeCiphertext: {
|
case SSKProtoEnvelopeTypeCiphertext: {
|
||||||
[self decryptSecureMessage:envelope
|
[self decryptSecureMessage:envelope
|
||||||
successBlock:^(NSData *_Nullable plaintextData, YapDatabaseReadWriteTransaction *transaction) {
|
envelopeData:envelopeData
|
||||||
|
successBlock:^(NSData *envelopeData,
|
||||||
|
NSData *_Nullable plaintextData,
|
||||||
|
YapDatabaseReadWriteTransaction *transaction) {
|
||||||
OWSLogDebug(@"decrypted secure message.");
|
OWSLogDebug(@"decrypted secure message.");
|
||||||
successBlock(plaintextData, transaction);
|
successBlock(envelopeData, plaintextData, transaction);
|
||||||
}
|
}
|
||||||
failureBlock:^(NSError *_Nullable error) {
|
failureBlock:^(NSError *_Nullable error) {
|
||||||
OWSLogError(@"decrypting secure message from address: %@ failed with error: %@",
|
OWSLogError(@"decrypting secure message from address: %@ failed with error: %@",
|
||||||
|
@ -142,9 +148,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
}
|
}
|
||||||
case SSKProtoEnvelopeTypePrekeyBundle: {
|
case SSKProtoEnvelopeTypePrekeyBundle: {
|
||||||
[self decryptPreKeyBundle:envelope
|
[self decryptPreKeyBundle:envelope
|
||||||
successBlock:^(NSData *_Nullable plaintextData, YapDatabaseReadWriteTransaction *transaction) {
|
envelopeData:envelopeData
|
||||||
|
successBlock:^(NSData *envelopeData,
|
||||||
|
NSData *_Nullable plaintextData,
|
||||||
|
YapDatabaseReadWriteTransaction *transaction) {
|
||||||
OWSLogDebug(@"decrypted pre-key whisper message");
|
OWSLogDebug(@"decrypted pre-key whisper message");
|
||||||
successBlock(plaintextData, transaction);
|
successBlock(envelopeData, plaintextData, transaction);
|
||||||
}
|
}
|
||||||
failureBlock:^(NSError *_Nullable error) {
|
failureBlock:^(NSError *_Nullable error) {
|
||||||
OWSLogError(@"decrypting pre-key whisper message from address: %@ failed "
|
OWSLogError(@"decrypting pre-key whisper message from address: %@ failed "
|
||||||
|
@ -162,7 +171,26 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
case SSKProtoEnvelopeTypeKeyExchange:
|
case SSKProtoEnvelopeTypeKeyExchange:
|
||||||
case SSKProtoEnvelopeTypeUnknown: {
|
case SSKProtoEnvelopeTypeUnknown: {
|
||||||
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||||
successBlock(nil, transaction);
|
successBlock(envelopeData, nil, transaction);
|
||||||
|
}];
|
||||||
|
// Return to avoid double-acknowledging.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case SSKProtoEnvelopeTypeUnidentifiedSender: {
|
||||||
|
[self decryptUnidentifiedSender:envelope
|
||||||
|
successBlock:^(NSData *envelopeData,
|
||||||
|
NSData *_Nullable plaintextData,
|
||||||
|
YapDatabaseReadWriteTransaction *transaction) {
|
||||||
|
OWSLogDebug(@"decrypted unidentified sender message");
|
||||||
|
successBlock(envelopeData, plaintextData, transaction);
|
||||||
|
}
|
||||||
|
failureBlock:^(NSError *_Nullable error) {
|
||||||
|
OWSLogError(@"decrypting unidentified sender message from address: %@ failed "
|
||||||
|
@"with error: %@",
|
||||||
|
envelopeAddress(envelope),
|
||||||
|
error);
|
||||||
|
OWSProdError([OWSAnalyticsEvents messageManagerErrorCouldNotHandleUnidentifiedSenderMessage]);
|
||||||
|
failureBlock();
|
||||||
}];
|
}];
|
||||||
// Return to avoid double-acknowledging.
|
// Return to avoid double-acknowledging.
|
||||||
return;
|
return;
|
||||||
|
@ -187,14 +215,17 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)decryptSecureMessage:(SSKProtoEnvelope *)envelope
|
- (void)decryptSecureMessage:(SSKProtoEnvelope *)envelope
|
||||||
|
envelopeData:(NSData *)envelopeData
|
||||||
successBlock:(DecryptSuccessBlock)successBlock
|
successBlock:(DecryptSuccessBlock)successBlock
|
||||||
failureBlock:(void (^)(NSError *_Nullable error))failureBlock
|
failureBlock:(void (^)(NSError *_Nullable error))failureBlock
|
||||||
{
|
{
|
||||||
OWSAssertDebug(envelope);
|
OWSAssertDebug(envelope);
|
||||||
|
OWSAssertDebug(envelopeData);
|
||||||
OWSAssertDebug(successBlock);
|
OWSAssertDebug(successBlock);
|
||||||
OWSAssertDebug(failureBlock);
|
OWSAssertDebug(failureBlock);
|
||||||
|
|
||||||
[self decryptEnvelope:envelope
|
[self decryptEnvelope:envelope
|
||||||
|
envelopeData:envelopeData
|
||||||
cipherTypeName:@"Secure Message"
|
cipherTypeName:@"Secure Message"
|
||||||
cipherMessageBlock:^(NSData *encryptedData) {
|
cipherMessageBlock:^(NSData *encryptedData) {
|
||||||
return [[WhisperMessage alloc] initWithData:encryptedData];
|
return [[WhisperMessage alloc] initWithData:encryptedData];
|
||||||
|
@ -204,10 +235,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)decryptPreKeyBundle:(SSKProtoEnvelope *)envelope
|
- (void)decryptPreKeyBundle:(SSKProtoEnvelope *)envelope
|
||||||
|
envelopeData:(NSData *)envelopeData
|
||||||
successBlock:(DecryptSuccessBlock)successBlock
|
successBlock:(DecryptSuccessBlock)successBlock
|
||||||
failureBlock:(void (^)(NSError *_Nullable error))failureBlock
|
failureBlock:(void (^)(NSError *_Nullable error))failureBlock
|
||||||
{
|
{
|
||||||
OWSAssertDebug(envelope);
|
OWSAssertDebug(envelope);
|
||||||
|
OWSAssertDebug(envelopeData);
|
||||||
OWSAssertDebug(successBlock);
|
OWSAssertDebug(successBlock);
|
||||||
OWSAssertDebug(failureBlock);
|
OWSAssertDebug(failureBlock);
|
||||||
|
|
||||||
|
@ -215,6 +248,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
[TSPreKeyManager checkPreKeys];
|
[TSPreKeyManager checkPreKeys];
|
||||||
|
|
||||||
[self decryptEnvelope:envelope
|
[self decryptEnvelope:envelope
|
||||||
|
envelopeData:envelopeData
|
||||||
cipherTypeName:@"PreKey Bundle"
|
cipherTypeName:@"PreKey Bundle"
|
||||||
cipherMessageBlock:^(NSData *encryptedData) {
|
cipherMessageBlock:^(NSData *encryptedData) {
|
||||||
return [[PreKeyWhisperMessage alloc] initWithData:encryptedData];
|
return [[PreKeyWhisperMessage alloc] initWithData:encryptedData];
|
||||||
|
@ -224,12 +258,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)decryptEnvelope:(SSKProtoEnvelope *)envelope
|
- (void)decryptEnvelope:(SSKProtoEnvelope *)envelope
|
||||||
|
envelopeData:(NSData *)envelopeData
|
||||||
cipherTypeName:(NSString *)cipherTypeName
|
cipherTypeName:(NSString *)cipherTypeName
|
||||||
cipherMessageBlock:(id<CipherMessage> (^_Nonnull)(NSData *))cipherMessageBlock
|
cipherMessageBlock:(id<CipherMessage> (^_Nonnull)(NSData *))cipherMessageBlock
|
||||||
successBlock:(DecryptSuccessBlock)successBlock
|
successBlock:(DecryptSuccessBlock)successBlock
|
||||||
failureBlock:(void (^)(NSError *_Nullable error))failureBlock
|
failureBlock:(void (^)(NSError *_Nullable error))failureBlock
|
||||||
{
|
{
|
||||||
OWSAssertDebug(envelope);
|
OWSAssertDebug(envelope);
|
||||||
|
OWSAssertDebug(envelopeData);
|
||||||
OWSAssertDebug(cipherTypeName.length > 0);
|
OWSAssertDebug(cipherTypeName.length > 0);
|
||||||
OWSAssertDebug(cipherMessageBlock);
|
OWSAssertDebug(cipherMessageBlock);
|
||||||
OWSAssertDebug(successBlock);
|
OWSAssertDebug(successBlock);
|
||||||
|
@ -248,7 +284,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
}
|
}
|
||||||
|
|
||||||
[self.dbConnection
|
[self.dbConnection
|
||||||
asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) {
|
asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||||
@try {
|
@try {
|
||||||
id<CipherMessage> cipherMessage = cipherMessageBlock(encryptedData);
|
id<CipherMessage> cipherMessage = cipherMessageBlock(encryptedData);
|
||||||
SessionCipher *cipher = [[SessionCipher alloc] initWithSessionStore:primaryStorage
|
SessionCipher *cipher = [[SessionCipher alloc] initWithSessionStore:primaryStorage
|
||||||
|
@ -261,7 +297,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
// plaintextData may be nil for some envelope types.
|
// plaintextData may be nil for some envelope types.
|
||||||
NSData *_Nullable plaintextData =
|
NSData *_Nullable plaintextData =
|
||||||
[[cipher decrypt:cipherMessage protocolContext:transaction] removePadding];
|
[[cipher decrypt:cipherMessage protocolContext:transaction] removePadding];
|
||||||
successBlock(plaintextData, transaction);
|
successBlock(envelopeData, plaintextData, transaction);
|
||||||
} @catch (NSException *exception) {
|
} @catch (NSException *exception) {
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
[self processException:exception envelope:envelope];
|
[self processException:exception envelope:envelope];
|
||||||
|
@ -275,6 +311,111 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)decryptUnidentifiedSender:(SSKProtoEnvelope *)envelope
|
||||||
|
successBlock:(DecryptSuccessBlock)successBlock
|
||||||
|
failureBlock:(void (^)(NSError *_Nullable error))failureBlock
|
||||||
|
{
|
||||||
|
OWSAssertDebug(envelope);
|
||||||
|
OWSAssertDebug(successBlock);
|
||||||
|
OWSAssertDebug(failureBlock);
|
||||||
|
|
||||||
|
// Check whether we need to refresh our PreKeys every time we receive a Unidentified Sender Message.
|
||||||
|
[TSPreKeyManager checkPreKeys];
|
||||||
|
|
||||||
|
OWSPrimaryStorage *primaryStorage = self.primaryStorage;
|
||||||
|
// TODO: Are source & sourceDevice going to eventually be obsolete?
|
||||||
|
NSString *recipientId = envelope.source;
|
||||||
|
int deviceId = envelope.sourceDevice;
|
||||||
|
|
||||||
|
// NOTE: We don't need to bother with `legacyMessage` for UD messages.
|
||||||
|
NSData *encryptedData = envelope.content;
|
||||||
|
if (!encryptedData) {
|
||||||
|
OWSProdFail([OWSAnalyticsEvents messageManagerErrorMessageEnvelopeHasNoContent]);
|
||||||
|
failureBlock(nil);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!envelope.hasServerTimestamp) {
|
||||||
|
OWSProdFail(@"UD Envelope is missing server timestamp.");
|
||||||
|
failureBlock(nil);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
UInt64 serverTimestamp = envelope.serverTimestamp;
|
||||||
|
|
||||||
|
// TODO: This is temporary.
|
||||||
|
NSData *trustRootData = [Randomness generateRandomBytes:ECCKeyLength];
|
||||||
|
NSError *error;
|
||||||
|
ECPublicKey *_Nullable trustRoot = [[ECPublicKey alloc] initWithKeyData:trustRootData error:&error];
|
||||||
|
if (error || !trustRoot) {
|
||||||
|
OWSProdFail(@"Invalid UD trust root.");
|
||||||
|
failureBlock(nil);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
id<SMKCertificateValidator> certificateValidator =
|
||||||
|
[[SMKCertificateDefaultValidator alloc] initWithTrustRoot:trustRoot];
|
||||||
|
|
||||||
|
[self.dbConnection asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||||
|
@try {
|
||||||
|
NSError *error;
|
||||||
|
SMKSecretSessionCipher *_Nullable cipher =
|
||||||
|
[[SMKSecretSessionCipher alloc] initWithSessionStore:primaryStorage
|
||||||
|
preKeyStore:primaryStorage
|
||||||
|
signedPreKeyStore:primaryStorage
|
||||||
|
identityStore:self.identityManager
|
||||||
|
error:&error];
|
||||||
|
if (error || !cipher) {
|
||||||
|
NSString *errorDescription =
|
||||||
|
[NSString stringWithFormat:@"Could not create secret session cipher: %@", error];
|
||||||
|
OWSFailDebug(@"%@", errorDescription);
|
||||||
|
NSError *error = OWSErrorWithCodeDescription(OWSErrorCodeFailedToDecryptMessage, errorDescription);
|
||||||
|
return failureBlock(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
SMKDecryptResult *_Nullable decryptResult =
|
||||||
|
[cipher decryptMessageWithCertificateValidator:certificateValidator
|
||||||
|
cipherTextData:encryptedData
|
||||||
|
timestamp:serverTimestamp
|
||||||
|
protocolContext:transaction
|
||||||
|
error:&error];
|
||||||
|
|
||||||
|
NSString *source = decryptResult.senderRecipientId;
|
||||||
|
if (source.length < 1) {
|
||||||
|
OWSProdFail(@"Invalid UD source.");
|
||||||
|
return failureBlock(nil);
|
||||||
|
}
|
||||||
|
long sourceDeviceId = decryptResult.senderDeviceId;
|
||||||
|
if (sourceDeviceId < 1 || sourceDeviceId > UINT32_MAX) {
|
||||||
|
OWSProdFail(@"Invalid UD sender device id.");
|
||||||
|
return failureBlock(nil);
|
||||||
|
}
|
||||||
|
NSData *plaintextData = [decryptResult.paddedPayload removePadding];
|
||||||
|
|
||||||
|
SSKProtoEnvelopeBuilder *envelopeBuilder = [envelope asBuilder];
|
||||||
|
[envelopeBuilder setSource:source];
|
||||||
|
[envelopeBuilder setSourceDevice:(uint32_t)sourceDeviceId];
|
||||||
|
NSData *_Nullable newEnvelopeData = [envelopeBuilder buildSerializedDataAndReturnError:&error];
|
||||||
|
if (error || !newEnvelopeData) {
|
||||||
|
NSString *errorDescription =
|
||||||
|
[NSString stringWithFormat:@"Could not update UD envelope data: %@", error];
|
||||||
|
OWSFailDebug(@"%@", errorDescription);
|
||||||
|
NSError *error = OWSErrorWithCodeDescription(OWSErrorCodeFailedToDecryptMessage, errorDescription);
|
||||||
|
return failureBlock(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
successBlock(newEnvelopeData, plaintextData, transaction);
|
||||||
|
} @catch (NSException *exception) {
|
||||||
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
|
[self processException:exception envelope:envelope];
|
||||||
|
NSString *errorDescription =
|
||||||
|
[NSString stringWithFormat:@"Exception while decrypting ud message: %@", exception.description];
|
||||||
|
OWSFailDebug(@"%@", errorDescription);
|
||||||
|
NSError *error = OWSErrorWithCodeDescription(OWSErrorCodeFailedToDecryptMessage, errorDescription);
|
||||||
|
failureBlock(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)processException:(NSException *)exception envelope:(SSKProtoEnvelope *)envelope
|
- (void)processException:(NSException *)exception envelope:(SSKProtoEnvelope *)envelope
|
||||||
{
|
{
|
||||||
OWSLogError(
|
OWSLogError(
|
||||||
|
|
|
@ -357,13 +357,18 @@ NSString *const OWSMessageDecryptJobFinderExtensionGroup = @"OWSMessageProcessin
|
||||||
}
|
}
|
||||||
|
|
||||||
[self.messageDecrypter decryptEnvelope:envelope
|
[self.messageDecrypter decryptEnvelope:envelope
|
||||||
successBlock:^(NSData *_Nullable plaintextData, YapDatabaseReadWriteTransaction *transaction) {
|
envelopeData:job.envelopeData
|
||||||
|
successBlock:^(
|
||||||
|
NSData *envelopeData, NSData *_Nullable plaintextData, YapDatabaseReadWriteTransaction *transaction) {
|
||||||
OWSAssertDebug(transaction);
|
OWSAssertDebug(transaction);
|
||||||
|
|
||||||
// We persist the decrypted envelope data in the same transaction within which
|
// We persist the decrypted envelope data in the same transaction within which
|
||||||
// it was decrypted to prevent data loss. If the new job isn't persisted,
|
// it was decrypted to prevent data loss. If the new job isn't persisted,
|
||||||
// the session state side effects of its decryption are also rolled back.
|
// the session state side effects of its decryption are also rolled back.
|
||||||
[self.batchMessageProcessor enqueueEnvelopeData:job.envelopeData
|
//
|
||||||
|
// NOTE: We use envelopeData from the decrypt result, not job.envelopeData,
|
||||||
|
// since the envelope may be altered by the decryption process.
|
||||||
|
[self.batchMessageProcessor enqueueEnvelopeData:envelopeData
|
||||||
plaintextData:plaintextData
|
plaintextData:plaintextData
|
||||||
transaction:transaction];
|
transaction:transaction];
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,12 @@ public enum FingerprintProtoError: Error {
|
||||||
return FingerprintProtoLogicalFingerprintBuilder(identityData: identityData)
|
return FingerprintProtoLogicalFingerprintBuilder(identityData: identityData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> FingerprintProtoLogicalFingerprintBuilder {
|
||||||
|
let builder = FingerprintProtoLogicalFingerprintBuilder(identityData: identityData)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class FingerprintProtoLogicalFingerprintBuilder: NSObject {
|
@objc public class FingerprintProtoLogicalFingerprintBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = FingerprintProtos_LogicalFingerprint()
|
private var proto = FingerprintProtos_LogicalFingerprint()
|
||||||
|
@ -107,6 +113,12 @@ extension FingerprintProtoLogicalFingerprint.FingerprintProtoLogicalFingerprintB
|
||||||
return FingerprintProtoLogicalFingerprintsBuilder(version: version, localFingerprint: localFingerprint, remoteFingerprint: remoteFingerprint)
|
return FingerprintProtoLogicalFingerprintsBuilder(version: version, localFingerprint: localFingerprint, remoteFingerprint: remoteFingerprint)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> FingerprintProtoLogicalFingerprintsBuilder {
|
||||||
|
let builder = FingerprintProtoLogicalFingerprintsBuilder(version: version, localFingerprint: localFingerprint, remoteFingerprint: remoteFingerprint)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class FingerprintProtoLogicalFingerprintsBuilder: NSObject {
|
@objc public class FingerprintProtoLogicalFingerprintsBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = FingerprintProtos_LogicalFingerprints()
|
private var proto = FingerprintProtos_LogicalFingerprints()
|
||||||
|
|
|
@ -20,6 +20,12 @@ public enum ProvisioningProtoError: Error {
|
||||||
return ProvisioningProtoProvisionEnvelopeBuilder(publicKey: publicKey, body: body)
|
return ProvisioningProtoProvisionEnvelopeBuilder(publicKey: publicKey, body: body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> ProvisioningProtoProvisionEnvelopeBuilder {
|
||||||
|
let builder = ProvisioningProtoProvisionEnvelopeBuilder(publicKey: publicKey, body: body)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class ProvisioningProtoProvisionEnvelopeBuilder: NSObject {
|
@objc public class ProvisioningProtoProvisionEnvelopeBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = ProvisioningProtos_ProvisionEnvelope()
|
private var proto = ProvisioningProtos_ProvisionEnvelope()
|
||||||
|
@ -122,6 +128,12 @@ extension ProvisioningProtoProvisionEnvelope.ProvisioningProtoProvisionEnvelopeB
|
||||||
return ProvisioningProtoProvisionMessageBuilder(identityKeyPublic: identityKeyPublic, identityKeyPrivate: identityKeyPrivate, number: number, provisioningCode: provisioningCode, userAgent: userAgent, profileKey: profileKey, readReceipts: readReceipts)
|
return ProvisioningProtoProvisionMessageBuilder(identityKeyPublic: identityKeyPublic, identityKeyPrivate: identityKeyPrivate, number: number, provisioningCode: provisioningCode, userAgent: userAgent, profileKey: profileKey, readReceipts: readReceipts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> ProvisioningProtoProvisionMessageBuilder {
|
||||||
|
let builder = ProvisioningProtoProvisionMessageBuilder(identityKeyPublic: identityKeyPublic, identityKeyPrivate: identityKeyPrivate, number: number, provisioningCode: provisioningCode, userAgent: userAgent, profileKey: profileKey, readReceipts: readReceipts)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class ProvisioningProtoProvisionMessageBuilder: NSObject {
|
@objc public class ProvisioningProtoProvisionMessageBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = ProvisioningProtos_ProvisionMessage()
|
private var proto = ProvisioningProtos_ProvisionMessage()
|
||||||
|
|
|
@ -53,6 +53,27 @@ public enum SSKProtoError: Error {
|
||||||
return SSKProtoEnvelopeBuilder(type: type, source: source, sourceDevice: sourceDevice, timestamp: timestamp)
|
return SSKProtoEnvelopeBuilder(type: type, source: source, sourceDevice: sourceDevice, timestamp: timestamp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoEnvelopeBuilder {
|
||||||
|
let builder = SSKProtoEnvelopeBuilder(type: type, source: source, sourceDevice: sourceDevice, timestamp: timestamp)
|
||||||
|
if let _value = relay {
|
||||||
|
builder.setRelay(_value)
|
||||||
|
}
|
||||||
|
if let _value = legacyMessage {
|
||||||
|
builder.setLegacyMessage(_value)
|
||||||
|
}
|
||||||
|
if let _value = content {
|
||||||
|
builder.setContent(_value)
|
||||||
|
}
|
||||||
|
if let _value = serverGuid {
|
||||||
|
builder.setServerGuid(_value)
|
||||||
|
}
|
||||||
|
if hasServerTimestamp {
|
||||||
|
builder.setServerTimestamp(serverTimestamp)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoEnvelopeBuilder: NSObject {
|
@objc public class SSKProtoEnvelopeBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_Envelope()
|
private var proto = SignalServiceProtos_Envelope()
|
||||||
|
@ -252,6 +273,27 @@ extension SSKProtoEnvelope.SSKProtoEnvelopeBuilder {
|
||||||
return SSKProtoContentBuilder()
|
return SSKProtoContentBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoContentBuilder {
|
||||||
|
let builder = SSKProtoContentBuilder()
|
||||||
|
if let _value = dataMessage {
|
||||||
|
builder.setDataMessage(_value)
|
||||||
|
}
|
||||||
|
if let _value = syncMessage {
|
||||||
|
builder.setSyncMessage(_value)
|
||||||
|
}
|
||||||
|
if let _value = callMessage {
|
||||||
|
builder.setCallMessage(_value)
|
||||||
|
}
|
||||||
|
if let _value = nullMessage {
|
||||||
|
builder.setNullMessage(_value)
|
||||||
|
}
|
||||||
|
if let _value = receiptMessage {
|
||||||
|
builder.setReceiptMessage(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoContentBuilder: NSObject {
|
@objc public class SSKProtoContentBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_Content()
|
private var proto = SignalServiceProtos_Content()
|
||||||
|
@ -324,27 +366,27 @@ extension SSKProtoEnvelope.SSKProtoEnvelopeBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate class func parseProto(_ proto: SignalServiceProtos_Content) throws -> SSKProtoContent {
|
fileprivate class func parseProto(_ proto: SignalServiceProtos_Content) throws -> SSKProtoContent {
|
||||||
var dataMessage: SSKProtoDataMessage?
|
var dataMessage: SSKProtoDataMessage? = nil
|
||||||
if proto.hasDataMessage {
|
if proto.hasDataMessage {
|
||||||
dataMessage = try SSKProtoDataMessage.parseProto(proto.dataMessage)
|
dataMessage = try SSKProtoDataMessage.parseProto(proto.dataMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
var syncMessage: SSKProtoSyncMessage?
|
var syncMessage: SSKProtoSyncMessage? = nil
|
||||||
if proto.hasSyncMessage {
|
if proto.hasSyncMessage {
|
||||||
syncMessage = try SSKProtoSyncMessage.parseProto(proto.syncMessage)
|
syncMessage = try SSKProtoSyncMessage.parseProto(proto.syncMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
var callMessage: SSKProtoCallMessage?
|
var callMessage: SSKProtoCallMessage? = nil
|
||||||
if proto.hasCallMessage {
|
if proto.hasCallMessage {
|
||||||
callMessage = try SSKProtoCallMessage.parseProto(proto.callMessage)
|
callMessage = try SSKProtoCallMessage.parseProto(proto.callMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
var nullMessage: SSKProtoNullMessage?
|
var nullMessage: SSKProtoNullMessage? = nil
|
||||||
if proto.hasNullMessage {
|
if proto.hasNullMessage {
|
||||||
nullMessage = try SSKProtoNullMessage.parseProto(proto.nullMessage)
|
nullMessage = try SSKProtoNullMessage.parseProto(proto.nullMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
var receiptMessage: SSKProtoReceiptMessage?
|
var receiptMessage: SSKProtoReceiptMessage? = nil
|
||||||
if proto.hasReceiptMessage {
|
if proto.hasReceiptMessage {
|
||||||
receiptMessage = try SSKProtoReceiptMessage.parseProto(proto.receiptMessage)
|
receiptMessage = try SSKProtoReceiptMessage.parseProto(proto.receiptMessage)
|
||||||
}
|
}
|
||||||
|
@ -389,6 +431,12 @@ extension SSKProtoContent.SSKProtoContentBuilder {
|
||||||
return SSKProtoCallMessageOfferBuilder(id: id, sessionDescription: sessionDescription)
|
return SSKProtoCallMessageOfferBuilder(id: id, sessionDescription: sessionDescription)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoCallMessageOfferBuilder {
|
||||||
|
let builder = SSKProtoCallMessageOfferBuilder(id: id, sessionDescription: sessionDescription)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoCallMessageOfferBuilder: NSObject {
|
@objc public class SSKProtoCallMessageOfferBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_CallMessage.Offer()
|
private var proto = SignalServiceProtos_CallMessage.Offer()
|
||||||
|
@ -491,6 +539,12 @@ extension SSKProtoCallMessageOffer.SSKProtoCallMessageOfferBuilder {
|
||||||
return SSKProtoCallMessageAnswerBuilder(id: id, sessionDescription: sessionDescription)
|
return SSKProtoCallMessageAnswerBuilder(id: id, sessionDescription: sessionDescription)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoCallMessageAnswerBuilder {
|
||||||
|
let builder = SSKProtoCallMessageAnswerBuilder(id: id, sessionDescription: sessionDescription)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoCallMessageAnswerBuilder: NSObject {
|
@objc public class SSKProtoCallMessageAnswerBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_CallMessage.Answer()
|
private var proto = SignalServiceProtos_CallMessage.Answer()
|
||||||
|
@ -593,6 +647,12 @@ extension SSKProtoCallMessageAnswer.SSKProtoCallMessageAnswerBuilder {
|
||||||
return SSKProtoCallMessageIceUpdateBuilder(id: id, sdpMid: sdpMid, sdpMlineIndex: sdpMlineIndex, sdp: sdp)
|
return SSKProtoCallMessageIceUpdateBuilder(id: id, sdpMid: sdpMid, sdpMlineIndex: sdpMlineIndex, sdp: sdp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoCallMessageIceUpdateBuilder {
|
||||||
|
let builder = SSKProtoCallMessageIceUpdateBuilder(id: id, sdpMid: sdpMid, sdpMlineIndex: sdpMlineIndex, sdp: sdp)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoCallMessageIceUpdateBuilder: NSObject {
|
@objc public class SSKProtoCallMessageIceUpdateBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_CallMessage.IceUpdate()
|
private var proto = SignalServiceProtos_CallMessage.IceUpdate()
|
||||||
|
@ -725,6 +785,12 @@ extension SSKProtoCallMessageIceUpdate.SSKProtoCallMessageIceUpdateBuilder {
|
||||||
return SSKProtoCallMessageBusyBuilder(id: id)
|
return SSKProtoCallMessageBusyBuilder(id: id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoCallMessageBusyBuilder {
|
||||||
|
let builder = SSKProtoCallMessageBusyBuilder(id: id)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoCallMessageBusyBuilder: NSObject {
|
@objc public class SSKProtoCallMessageBusyBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_CallMessage.Busy()
|
private var proto = SignalServiceProtos_CallMessage.Busy()
|
||||||
|
@ -812,6 +878,12 @@ extension SSKProtoCallMessageBusy.SSKProtoCallMessageBusyBuilder {
|
||||||
return SSKProtoCallMessageHangupBuilder(id: id)
|
return SSKProtoCallMessageHangupBuilder(id: id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoCallMessageHangupBuilder {
|
||||||
|
let builder = SSKProtoCallMessageHangupBuilder(id: id)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoCallMessageHangupBuilder: NSObject {
|
@objc public class SSKProtoCallMessageHangupBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_CallMessage.Hangup()
|
private var proto = SignalServiceProtos_CallMessage.Hangup()
|
||||||
|
@ -899,6 +971,28 @@ extension SSKProtoCallMessageHangup.SSKProtoCallMessageHangupBuilder {
|
||||||
return SSKProtoCallMessageBuilder()
|
return SSKProtoCallMessageBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoCallMessageBuilder {
|
||||||
|
let builder = SSKProtoCallMessageBuilder()
|
||||||
|
if let _value = offer {
|
||||||
|
builder.setOffer(_value)
|
||||||
|
}
|
||||||
|
if let _value = answer {
|
||||||
|
builder.setAnswer(_value)
|
||||||
|
}
|
||||||
|
builder.setIceUpdate(iceUpdate)
|
||||||
|
if let _value = hangup {
|
||||||
|
builder.setHangup(_value)
|
||||||
|
}
|
||||||
|
if let _value = busy {
|
||||||
|
builder.setBusy(_value)
|
||||||
|
}
|
||||||
|
if let _value = profileKey {
|
||||||
|
builder.setProfileKey(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoCallMessageBuilder: NSObject {
|
@objc public class SSKProtoCallMessageBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_CallMessage()
|
private var proto = SignalServiceProtos_CallMessage()
|
||||||
|
@ -991,12 +1085,12 @@ extension SSKProtoCallMessageHangup.SSKProtoCallMessageHangupBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate class func parseProto(_ proto: SignalServiceProtos_CallMessage) throws -> SSKProtoCallMessage {
|
fileprivate class func parseProto(_ proto: SignalServiceProtos_CallMessage) throws -> SSKProtoCallMessage {
|
||||||
var offer: SSKProtoCallMessageOffer?
|
var offer: SSKProtoCallMessageOffer? = nil
|
||||||
if proto.hasOffer {
|
if proto.hasOffer {
|
||||||
offer = try SSKProtoCallMessageOffer.parseProto(proto.offer)
|
offer = try SSKProtoCallMessageOffer.parseProto(proto.offer)
|
||||||
}
|
}
|
||||||
|
|
||||||
var answer: SSKProtoCallMessageAnswer?
|
var answer: SSKProtoCallMessageAnswer? = nil
|
||||||
if proto.hasAnswer {
|
if proto.hasAnswer {
|
||||||
answer = try SSKProtoCallMessageAnswer.parseProto(proto.answer)
|
answer = try SSKProtoCallMessageAnswer.parseProto(proto.answer)
|
||||||
}
|
}
|
||||||
|
@ -1004,12 +1098,12 @@ extension SSKProtoCallMessageHangup.SSKProtoCallMessageHangupBuilder {
|
||||||
var iceUpdate: [SSKProtoCallMessageIceUpdate] = []
|
var iceUpdate: [SSKProtoCallMessageIceUpdate] = []
|
||||||
iceUpdate = try proto.iceUpdate.map { try SSKProtoCallMessageIceUpdate.parseProto($0) }
|
iceUpdate = try proto.iceUpdate.map { try SSKProtoCallMessageIceUpdate.parseProto($0) }
|
||||||
|
|
||||||
var hangup: SSKProtoCallMessageHangup?
|
var hangup: SSKProtoCallMessageHangup? = nil
|
||||||
if proto.hasHangup {
|
if proto.hasHangup {
|
||||||
hangup = try SSKProtoCallMessageHangup.parseProto(proto.hangup)
|
hangup = try SSKProtoCallMessageHangup.parseProto(proto.hangup)
|
||||||
}
|
}
|
||||||
|
|
||||||
var busy: SSKProtoCallMessageBusy?
|
var busy: SSKProtoCallMessageBusy? = nil
|
||||||
if proto.hasBusy {
|
if proto.hasBusy {
|
||||||
busy = try SSKProtoCallMessageBusy.parseProto(proto.busy)
|
busy = try SSKProtoCallMessageBusy.parseProto(proto.busy)
|
||||||
}
|
}
|
||||||
|
@ -1072,6 +1166,24 @@ extension SSKProtoCallMessage.SSKProtoCallMessageBuilder {
|
||||||
return SSKProtoDataMessageQuoteQuotedAttachmentBuilder()
|
return SSKProtoDataMessageQuoteQuotedAttachmentBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoDataMessageQuoteQuotedAttachmentBuilder {
|
||||||
|
let builder = SSKProtoDataMessageQuoteQuotedAttachmentBuilder()
|
||||||
|
if let _value = contentType {
|
||||||
|
builder.setContentType(_value)
|
||||||
|
}
|
||||||
|
if let _value = fileName {
|
||||||
|
builder.setFileName(_value)
|
||||||
|
}
|
||||||
|
if let _value = thumbnail {
|
||||||
|
builder.setThumbnail(_value)
|
||||||
|
}
|
||||||
|
if hasFlags {
|
||||||
|
builder.setFlags(flags)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoDataMessageQuoteQuotedAttachmentBuilder: NSObject {
|
@objc public class SSKProtoDataMessageQuoteQuotedAttachmentBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_DataMessage.Quote.QuotedAttachment()
|
private var proto = SignalServiceProtos_DataMessage.Quote.QuotedAttachment()
|
||||||
|
@ -1151,7 +1263,7 @@ extension SSKProtoCallMessage.SSKProtoCallMessageBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate class func parseProto(_ proto: SignalServiceProtos_DataMessage.Quote.QuotedAttachment) throws -> SSKProtoDataMessageQuoteQuotedAttachment {
|
fileprivate class func parseProto(_ proto: SignalServiceProtos_DataMessage.Quote.QuotedAttachment) throws -> SSKProtoDataMessageQuoteQuotedAttachment {
|
||||||
var thumbnail: SSKProtoAttachmentPointer?
|
var thumbnail: SSKProtoAttachmentPointer? = nil
|
||||||
if proto.hasThumbnail {
|
if proto.hasThumbnail {
|
||||||
thumbnail = try SSKProtoAttachmentPointer.parseProto(proto.thumbnail)
|
thumbnail = try SSKProtoAttachmentPointer.parseProto(proto.thumbnail)
|
||||||
}
|
}
|
||||||
|
@ -1192,6 +1304,16 @@ extension SSKProtoDataMessageQuoteQuotedAttachment.SSKProtoDataMessageQuoteQuote
|
||||||
return SSKProtoDataMessageQuoteBuilder(id: id, author: author)
|
return SSKProtoDataMessageQuoteBuilder(id: id, author: author)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoDataMessageQuoteBuilder {
|
||||||
|
let builder = SSKProtoDataMessageQuoteBuilder(id: id, author: author)
|
||||||
|
if let _value = text {
|
||||||
|
builder.setText(_value)
|
||||||
|
}
|
||||||
|
builder.setAttachments(attachments)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoDataMessageQuoteBuilder: NSObject {
|
@objc public class SSKProtoDataMessageQuoteBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_DataMessage.Quote()
|
private var proto = SignalServiceProtos_DataMessage.Quote()
|
||||||
|
@ -1326,6 +1448,30 @@ extension SSKProtoDataMessageQuote.SSKProtoDataMessageQuoteBuilder {
|
||||||
return SSKProtoDataMessageContactNameBuilder()
|
return SSKProtoDataMessageContactNameBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoDataMessageContactNameBuilder {
|
||||||
|
let builder = SSKProtoDataMessageContactNameBuilder()
|
||||||
|
if let _value = givenName {
|
||||||
|
builder.setGivenName(_value)
|
||||||
|
}
|
||||||
|
if let _value = familyName {
|
||||||
|
builder.setFamilyName(_value)
|
||||||
|
}
|
||||||
|
if let _value = prefix {
|
||||||
|
builder.setPrefix(_value)
|
||||||
|
}
|
||||||
|
if let _value = suffix {
|
||||||
|
builder.setSuffix(_value)
|
||||||
|
}
|
||||||
|
if let _value = middleName {
|
||||||
|
builder.setMiddleName(_value)
|
||||||
|
}
|
||||||
|
if let _value = displayName {
|
||||||
|
builder.setDisplayName(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoDataMessageContactNameBuilder: NSObject {
|
@objc public class SSKProtoDataMessageContactNameBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_DataMessage.Contact.Name()
|
private var proto = SignalServiceProtos_DataMessage.Contact.Name()
|
||||||
|
@ -1504,6 +1650,21 @@ extension SSKProtoDataMessageContactName.SSKProtoDataMessageContactNameBuilder {
|
||||||
return SSKProtoDataMessageContactPhoneBuilder()
|
return SSKProtoDataMessageContactPhoneBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoDataMessageContactPhoneBuilder {
|
||||||
|
let builder = SSKProtoDataMessageContactPhoneBuilder()
|
||||||
|
if let _value = value {
|
||||||
|
builder.setValue(_value)
|
||||||
|
}
|
||||||
|
if hasType {
|
||||||
|
builder.setType(type)
|
||||||
|
}
|
||||||
|
if let _value = label {
|
||||||
|
builder.setLabel(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoDataMessageContactPhoneBuilder: NSObject {
|
@objc public class SSKProtoDataMessageContactPhoneBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_DataMessage.Contact.Phone()
|
private var proto = SignalServiceProtos_DataMessage.Contact.Phone()
|
||||||
|
@ -1637,6 +1798,21 @@ extension SSKProtoDataMessageContactPhone.SSKProtoDataMessageContactPhoneBuilder
|
||||||
return SSKProtoDataMessageContactEmailBuilder()
|
return SSKProtoDataMessageContactEmailBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoDataMessageContactEmailBuilder {
|
||||||
|
let builder = SSKProtoDataMessageContactEmailBuilder()
|
||||||
|
if let _value = value {
|
||||||
|
builder.setValue(_value)
|
||||||
|
}
|
||||||
|
if hasType {
|
||||||
|
builder.setType(type)
|
||||||
|
}
|
||||||
|
if let _value = label {
|
||||||
|
builder.setLabel(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoDataMessageContactEmailBuilder: NSObject {
|
@objc public class SSKProtoDataMessageContactEmailBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_DataMessage.Contact.Email()
|
private var proto = SignalServiceProtos_DataMessage.Contact.Email()
|
||||||
|
@ -1767,6 +1943,39 @@ extension SSKProtoDataMessageContactEmail.SSKProtoDataMessageContactEmailBuilder
|
||||||
return SSKProtoDataMessageContactPostalAddressBuilder()
|
return SSKProtoDataMessageContactPostalAddressBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoDataMessageContactPostalAddressBuilder {
|
||||||
|
let builder = SSKProtoDataMessageContactPostalAddressBuilder()
|
||||||
|
if hasType {
|
||||||
|
builder.setType(type)
|
||||||
|
}
|
||||||
|
if let _value = label {
|
||||||
|
builder.setLabel(_value)
|
||||||
|
}
|
||||||
|
if let _value = street {
|
||||||
|
builder.setStreet(_value)
|
||||||
|
}
|
||||||
|
if let _value = pobox {
|
||||||
|
builder.setPobox(_value)
|
||||||
|
}
|
||||||
|
if let _value = neighborhood {
|
||||||
|
builder.setNeighborhood(_value)
|
||||||
|
}
|
||||||
|
if let _value = city {
|
||||||
|
builder.setCity(_value)
|
||||||
|
}
|
||||||
|
if let _value = region {
|
||||||
|
builder.setRegion(_value)
|
||||||
|
}
|
||||||
|
if let _value = postcode {
|
||||||
|
builder.setPostcode(_value)
|
||||||
|
}
|
||||||
|
if let _value = country {
|
||||||
|
builder.setCountry(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoDataMessageContactPostalAddressBuilder: NSObject {
|
@objc public class SSKProtoDataMessageContactPostalAddressBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_DataMessage.Contact.PostalAddress()
|
private var proto = SignalServiceProtos_DataMessage.Contact.PostalAddress()
|
||||||
|
@ -1957,6 +2166,18 @@ extension SSKProtoDataMessageContactPostalAddress.SSKProtoDataMessageContactPost
|
||||||
return SSKProtoDataMessageContactAvatarBuilder()
|
return SSKProtoDataMessageContactAvatarBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoDataMessageContactAvatarBuilder {
|
||||||
|
let builder = SSKProtoDataMessageContactAvatarBuilder()
|
||||||
|
if let _value = avatar {
|
||||||
|
builder.setAvatar(_value)
|
||||||
|
}
|
||||||
|
if hasIsProfile {
|
||||||
|
builder.setIsProfile(isProfile)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoDataMessageContactAvatarBuilder: NSObject {
|
@objc public class SSKProtoDataMessageContactAvatarBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_DataMessage.Contact.Avatar()
|
private var proto = SignalServiceProtos_DataMessage.Contact.Avatar()
|
||||||
|
@ -2008,7 +2229,7 @@ extension SSKProtoDataMessageContactPostalAddress.SSKProtoDataMessageContactPost
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate class func parseProto(_ proto: SignalServiceProtos_DataMessage.Contact.Avatar) throws -> SSKProtoDataMessageContactAvatar {
|
fileprivate class func parseProto(_ proto: SignalServiceProtos_DataMessage.Contact.Avatar) throws -> SSKProtoDataMessageContactAvatar {
|
||||||
var avatar: SSKProtoAttachmentPointer?
|
var avatar: SSKProtoAttachmentPointer? = nil
|
||||||
if proto.hasAvatar {
|
if proto.hasAvatar {
|
||||||
avatar = try SSKProtoAttachmentPointer.parseProto(proto.avatar)
|
avatar = try SSKProtoAttachmentPointer.parseProto(proto.avatar)
|
||||||
}
|
}
|
||||||
|
@ -2049,6 +2270,24 @@ extension SSKProtoDataMessageContactAvatar.SSKProtoDataMessageContactAvatarBuild
|
||||||
return SSKProtoDataMessageContactBuilder()
|
return SSKProtoDataMessageContactBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoDataMessageContactBuilder {
|
||||||
|
let builder = SSKProtoDataMessageContactBuilder()
|
||||||
|
if let _value = name {
|
||||||
|
builder.setName(_value)
|
||||||
|
}
|
||||||
|
builder.setNumber(number)
|
||||||
|
builder.setEmail(email)
|
||||||
|
builder.setAddress(address)
|
||||||
|
if let _value = avatar {
|
||||||
|
builder.setAvatar(_value)
|
||||||
|
}
|
||||||
|
if let _value = organization {
|
||||||
|
builder.setOrganization(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoDataMessageContactBuilder: NSObject {
|
@objc public class SSKProtoDataMessageContactBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_DataMessage.Contact()
|
private var proto = SignalServiceProtos_DataMessage.Contact()
|
||||||
|
@ -2153,7 +2392,7 @@ extension SSKProtoDataMessageContactAvatar.SSKProtoDataMessageContactAvatarBuild
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate class func parseProto(_ proto: SignalServiceProtos_DataMessage.Contact) throws -> SSKProtoDataMessageContact {
|
fileprivate class func parseProto(_ proto: SignalServiceProtos_DataMessage.Contact) throws -> SSKProtoDataMessageContact {
|
||||||
var name: SSKProtoDataMessageContactName?
|
var name: SSKProtoDataMessageContactName? = nil
|
||||||
if proto.hasName {
|
if proto.hasName {
|
||||||
name = try SSKProtoDataMessageContactName.parseProto(proto.name)
|
name = try SSKProtoDataMessageContactName.parseProto(proto.name)
|
||||||
}
|
}
|
||||||
|
@ -2167,7 +2406,7 @@ extension SSKProtoDataMessageContactAvatar.SSKProtoDataMessageContactAvatarBuild
|
||||||
var address: [SSKProtoDataMessageContactPostalAddress] = []
|
var address: [SSKProtoDataMessageContactPostalAddress] = []
|
||||||
address = try proto.address.map { try SSKProtoDataMessageContactPostalAddress.parseProto($0) }
|
address = try proto.address.map { try SSKProtoDataMessageContactPostalAddress.parseProto($0) }
|
||||||
|
|
||||||
var avatar: SSKProtoDataMessageContactAvatar?
|
var avatar: SSKProtoDataMessageContactAvatar? = nil
|
||||||
if proto.hasAvatar {
|
if proto.hasAvatar {
|
||||||
avatar = try SSKProtoDataMessageContactAvatar.parseProto(proto.avatar)
|
avatar = try SSKProtoDataMessageContactAvatar.parseProto(proto.avatar)
|
||||||
}
|
}
|
||||||
|
@ -2236,6 +2475,35 @@ extension SSKProtoDataMessageContact.SSKProtoDataMessageContactBuilder {
|
||||||
return SSKProtoDataMessageBuilder()
|
return SSKProtoDataMessageBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoDataMessageBuilder {
|
||||||
|
let builder = SSKProtoDataMessageBuilder()
|
||||||
|
if let _value = body {
|
||||||
|
builder.setBody(_value)
|
||||||
|
}
|
||||||
|
builder.setAttachments(attachments)
|
||||||
|
if let _value = group {
|
||||||
|
builder.setGroup(_value)
|
||||||
|
}
|
||||||
|
if hasFlags {
|
||||||
|
builder.setFlags(flags)
|
||||||
|
}
|
||||||
|
if hasExpireTimer {
|
||||||
|
builder.setExpireTimer(expireTimer)
|
||||||
|
}
|
||||||
|
if let _value = profileKey {
|
||||||
|
builder.setProfileKey(_value)
|
||||||
|
}
|
||||||
|
if hasTimestamp {
|
||||||
|
builder.setTimestamp(timestamp)
|
||||||
|
}
|
||||||
|
if let _value = quote {
|
||||||
|
builder.setQuote(_value)
|
||||||
|
}
|
||||||
|
builder.setContact(contact)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoDataMessageBuilder: NSObject {
|
@objc public class SSKProtoDataMessageBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_DataMessage()
|
private var proto = SignalServiceProtos_DataMessage()
|
||||||
|
@ -2376,12 +2644,12 @@ extension SSKProtoDataMessageContact.SSKProtoDataMessageContactBuilder {
|
||||||
var attachments: [SSKProtoAttachmentPointer] = []
|
var attachments: [SSKProtoAttachmentPointer] = []
|
||||||
attachments = try proto.attachments.map { try SSKProtoAttachmentPointer.parseProto($0) }
|
attachments = try proto.attachments.map { try SSKProtoAttachmentPointer.parseProto($0) }
|
||||||
|
|
||||||
var group: SSKProtoGroupContext?
|
var group: SSKProtoGroupContext? = nil
|
||||||
if proto.hasGroup {
|
if proto.hasGroup {
|
||||||
group = try SSKProtoGroupContext.parseProto(proto.group)
|
group = try SSKProtoGroupContext.parseProto(proto.group)
|
||||||
}
|
}
|
||||||
|
|
||||||
var quote: SSKProtoDataMessageQuote?
|
var quote: SSKProtoDataMessageQuote? = nil
|
||||||
if proto.hasQuote {
|
if proto.hasQuote {
|
||||||
quote = try SSKProtoDataMessageQuote.parseProto(proto.quote)
|
quote = try SSKProtoDataMessageQuote.parseProto(proto.quote)
|
||||||
}
|
}
|
||||||
|
@ -2428,6 +2696,15 @@ extension SSKProtoDataMessage.SSKProtoDataMessageBuilder {
|
||||||
return SSKProtoNullMessageBuilder()
|
return SSKProtoNullMessageBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoNullMessageBuilder {
|
||||||
|
let builder = SSKProtoNullMessageBuilder()
|
||||||
|
if let _value = padding {
|
||||||
|
builder.setPadding(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoNullMessageBuilder: NSObject {
|
@objc public class SSKProtoNullMessageBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_NullMessage()
|
private var proto = SignalServiceProtos_NullMessage()
|
||||||
|
@ -2530,6 +2807,13 @@ extension SSKProtoNullMessage.SSKProtoNullMessageBuilder {
|
||||||
return SSKProtoReceiptMessageBuilder(type: type)
|
return SSKProtoReceiptMessageBuilder(type: type)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoReceiptMessageBuilder {
|
||||||
|
let builder = SSKProtoReceiptMessageBuilder(type: type)
|
||||||
|
builder.setTimestamp(timestamp)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoReceiptMessageBuilder: NSObject {
|
@objc public class SSKProtoReceiptMessageBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_ReceiptMessage()
|
private var proto = SignalServiceProtos_ReceiptMessage()
|
||||||
|
@ -2655,6 +2939,21 @@ extension SSKProtoReceiptMessage.SSKProtoReceiptMessageBuilder {
|
||||||
return SSKProtoVerifiedBuilder(destination: destination)
|
return SSKProtoVerifiedBuilder(destination: destination)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoVerifiedBuilder {
|
||||||
|
let builder = SSKProtoVerifiedBuilder(destination: destination)
|
||||||
|
if let _value = identityKey {
|
||||||
|
builder.setIdentityKey(_value)
|
||||||
|
}
|
||||||
|
if hasState {
|
||||||
|
builder.setState(state)
|
||||||
|
}
|
||||||
|
if let _value = nullMessage {
|
||||||
|
builder.setNullMessage(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoVerifiedBuilder: NSObject {
|
@objc public class SSKProtoVerifiedBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_Verified()
|
private var proto = SignalServiceProtos_Verified()
|
||||||
|
@ -2781,6 +3080,24 @@ extension SSKProtoVerified.SSKProtoVerifiedBuilder {
|
||||||
return SSKProtoSyncMessageSentBuilder()
|
return SSKProtoSyncMessageSentBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoSyncMessageSentBuilder {
|
||||||
|
let builder = SSKProtoSyncMessageSentBuilder()
|
||||||
|
if let _value = destination {
|
||||||
|
builder.setDestination(_value)
|
||||||
|
}
|
||||||
|
if hasTimestamp {
|
||||||
|
builder.setTimestamp(timestamp)
|
||||||
|
}
|
||||||
|
if let _value = message {
|
||||||
|
builder.setMessage(_value)
|
||||||
|
}
|
||||||
|
if hasExpirationStartTimestamp {
|
||||||
|
builder.setExpirationStartTimestamp(expirationStartTimestamp)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoSyncMessageSentBuilder: NSObject {
|
@objc public class SSKProtoSyncMessageSentBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_SyncMessage.Sent()
|
private var proto = SignalServiceProtos_SyncMessage.Sent()
|
||||||
|
@ -2857,7 +3174,7 @@ extension SSKProtoVerified.SSKProtoVerifiedBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage.Sent) throws -> SSKProtoSyncMessageSent {
|
fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage.Sent) throws -> SSKProtoSyncMessageSent {
|
||||||
var message: SSKProtoDataMessage?
|
var message: SSKProtoDataMessage? = nil
|
||||||
if proto.hasMessage {
|
if proto.hasMessage {
|
||||||
message = try SSKProtoDataMessage.parseProto(proto.message)
|
message = try SSKProtoDataMessage.parseProto(proto.message)
|
||||||
}
|
}
|
||||||
|
@ -2898,6 +3215,15 @@ extension SSKProtoSyncMessageSent.SSKProtoSyncMessageSentBuilder {
|
||||||
return SSKProtoSyncMessageContactsBuilder(blob: blob)
|
return SSKProtoSyncMessageContactsBuilder(blob: blob)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoSyncMessageContactsBuilder {
|
||||||
|
let builder = SSKProtoSyncMessageContactsBuilder(blob: blob)
|
||||||
|
if hasIsComplete {
|
||||||
|
builder.setIsComplete(isComplete)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoSyncMessageContactsBuilder: NSObject {
|
@objc public class SSKProtoSyncMessageContactsBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_SyncMessage.Contacts()
|
private var proto = SignalServiceProtos_SyncMessage.Contacts()
|
||||||
|
@ -2996,6 +3322,15 @@ extension SSKProtoSyncMessageContacts.SSKProtoSyncMessageContactsBuilder {
|
||||||
return SSKProtoSyncMessageGroupsBuilder()
|
return SSKProtoSyncMessageGroupsBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoSyncMessageGroupsBuilder {
|
||||||
|
let builder = SSKProtoSyncMessageGroupsBuilder()
|
||||||
|
if let _value = blob {
|
||||||
|
builder.setBlob(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoSyncMessageGroupsBuilder: NSObject {
|
@objc public class SSKProtoSyncMessageGroupsBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_SyncMessage.Groups()
|
private var proto = SignalServiceProtos_SyncMessage.Groups()
|
||||||
|
@ -3036,7 +3371,7 @@ extension SSKProtoSyncMessageContacts.SSKProtoSyncMessageContactsBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage.Groups) throws -> SSKProtoSyncMessageGroups {
|
fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage.Groups) throws -> SSKProtoSyncMessageGroups {
|
||||||
var blob: SSKProtoAttachmentPointer?
|
var blob: SSKProtoAttachmentPointer? = nil
|
||||||
if proto.hasBlob {
|
if proto.hasBlob {
|
||||||
blob = try SSKProtoAttachmentPointer.parseProto(proto.blob)
|
blob = try SSKProtoAttachmentPointer.parseProto(proto.blob)
|
||||||
}
|
}
|
||||||
|
@ -3077,6 +3412,14 @@ extension SSKProtoSyncMessageGroups.SSKProtoSyncMessageGroupsBuilder {
|
||||||
return SSKProtoSyncMessageBlockedBuilder()
|
return SSKProtoSyncMessageBlockedBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoSyncMessageBlockedBuilder {
|
||||||
|
let builder = SSKProtoSyncMessageBlockedBuilder()
|
||||||
|
builder.setNumbers(numbers)
|
||||||
|
builder.setGroupIds(groupIds)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoSyncMessageBlockedBuilder: NSObject {
|
@objc public class SSKProtoSyncMessageBlockedBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_SyncMessage.Blocked()
|
private var proto = SignalServiceProtos_SyncMessage.Blocked()
|
||||||
|
@ -3202,6 +3545,12 @@ extension SSKProtoSyncMessageBlocked.SSKProtoSyncMessageBlockedBuilder {
|
||||||
return SSKProtoSyncMessageRequestBuilder(type: type)
|
return SSKProtoSyncMessageRequestBuilder(type: type)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoSyncMessageRequestBuilder {
|
||||||
|
let builder = SSKProtoSyncMessageRequestBuilder(type: type)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoSyncMessageRequestBuilder: NSObject {
|
@objc public class SSKProtoSyncMessageRequestBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_SyncMessage.Request()
|
private var proto = SignalServiceProtos_SyncMessage.Request()
|
||||||
|
@ -3289,6 +3638,12 @@ extension SSKProtoSyncMessageRequest.SSKProtoSyncMessageRequestBuilder {
|
||||||
return SSKProtoSyncMessageReadBuilder(sender: sender, timestamp: timestamp)
|
return SSKProtoSyncMessageReadBuilder(sender: sender, timestamp: timestamp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoSyncMessageReadBuilder {
|
||||||
|
let builder = SSKProtoSyncMessageReadBuilder(sender: sender, timestamp: timestamp)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoSyncMessageReadBuilder: NSObject {
|
@objc public class SSKProtoSyncMessageReadBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_SyncMessage.Read()
|
private var proto = SignalServiceProtos_SyncMessage.Read()
|
||||||
|
@ -3391,6 +3746,15 @@ extension SSKProtoSyncMessageRead.SSKProtoSyncMessageReadBuilder {
|
||||||
return SSKProtoSyncMessageConfigurationBuilder()
|
return SSKProtoSyncMessageConfigurationBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoSyncMessageConfigurationBuilder {
|
||||||
|
let builder = SSKProtoSyncMessageConfigurationBuilder()
|
||||||
|
if hasReadReceipts {
|
||||||
|
builder.setReadReceipts(readReceipts)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoSyncMessageConfigurationBuilder: NSObject {
|
@objc public class SSKProtoSyncMessageConfigurationBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_SyncMessage.Configuration()
|
private var proto = SignalServiceProtos_SyncMessage.Configuration()
|
||||||
|
@ -3469,6 +3833,37 @@ extension SSKProtoSyncMessageConfiguration.SSKProtoSyncMessageConfigurationBuild
|
||||||
return SSKProtoSyncMessageBuilder()
|
return SSKProtoSyncMessageBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoSyncMessageBuilder {
|
||||||
|
let builder = SSKProtoSyncMessageBuilder()
|
||||||
|
if let _value = sent {
|
||||||
|
builder.setSent(_value)
|
||||||
|
}
|
||||||
|
if let _value = contacts {
|
||||||
|
builder.setContacts(_value)
|
||||||
|
}
|
||||||
|
if let _value = groups {
|
||||||
|
builder.setGroups(_value)
|
||||||
|
}
|
||||||
|
if let _value = request {
|
||||||
|
builder.setRequest(_value)
|
||||||
|
}
|
||||||
|
builder.setRead(read)
|
||||||
|
if let _value = blocked {
|
||||||
|
builder.setBlocked(_value)
|
||||||
|
}
|
||||||
|
if let _value = verified {
|
||||||
|
builder.setVerified(_value)
|
||||||
|
}
|
||||||
|
if let _value = configuration {
|
||||||
|
builder.setConfiguration(_value)
|
||||||
|
}
|
||||||
|
if let _value = padding {
|
||||||
|
builder.setPadding(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoSyncMessageBuilder: NSObject {
|
@objc public class SSKProtoSyncMessageBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_SyncMessage()
|
private var proto = SignalServiceProtos_SyncMessage()
|
||||||
|
@ -3585,22 +3980,22 @@ extension SSKProtoSyncMessageConfiguration.SSKProtoSyncMessageConfigurationBuild
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage) throws -> SSKProtoSyncMessage {
|
fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage) throws -> SSKProtoSyncMessage {
|
||||||
var sent: SSKProtoSyncMessageSent?
|
var sent: SSKProtoSyncMessageSent? = nil
|
||||||
if proto.hasSent {
|
if proto.hasSent {
|
||||||
sent = try SSKProtoSyncMessageSent.parseProto(proto.sent)
|
sent = try SSKProtoSyncMessageSent.parseProto(proto.sent)
|
||||||
}
|
}
|
||||||
|
|
||||||
var contacts: SSKProtoSyncMessageContacts?
|
var contacts: SSKProtoSyncMessageContacts? = nil
|
||||||
if proto.hasContacts {
|
if proto.hasContacts {
|
||||||
contacts = try SSKProtoSyncMessageContacts.parseProto(proto.contacts)
|
contacts = try SSKProtoSyncMessageContacts.parseProto(proto.contacts)
|
||||||
}
|
}
|
||||||
|
|
||||||
var groups: SSKProtoSyncMessageGroups?
|
var groups: SSKProtoSyncMessageGroups? = nil
|
||||||
if proto.hasGroups {
|
if proto.hasGroups {
|
||||||
groups = try SSKProtoSyncMessageGroups.parseProto(proto.groups)
|
groups = try SSKProtoSyncMessageGroups.parseProto(proto.groups)
|
||||||
}
|
}
|
||||||
|
|
||||||
var request: SSKProtoSyncMessageRequest?
|
var request: SSKProtoSyncMessageRequest? = nil
|
||||||
if proto.hasRequest {
|
if proto.hasRequest {
|
||||||
request = try SSKProtoSyncMessageRequest.parseProto(proto.request)
|
request = try SSKProtoSyncMessageRequest.parseProto(proto.request)
|
||||||
}
|
}
|
||||||
|
@ -3608,17 +4003,17 @@ extension SSKProtoSyncMessageConfiguration.SSKProtoSyncMessageConfigurationBuild
|
||||||
var read: [SSKProtoSyncMessageRead] = []
|
var read: [SSKProtoSyncMessageRead] = []
|
||||||
read = try proto.read.map { try SSKProtoSyncMessageRead.parseProto($0) }
|
read = try proto.read.map { try SSKProtoSyncMessageRead.parseProto($0) }
|
||||||
|
|
||||||
var blocked: SSKProtoSyncMessageBlocked?
|
var blocked: SSKProtoSyncMessageBlocked? = nil
|
||||||
if proto.hasBlocked {
|
if proto.hasBlocked {
|
||||||
blocked = try SSKProtoSyncMessageBlocked.parseProto(proto.blocked)
|
blocked = try SSKProtoSyncMessageBlocked.parseProto(proto.blocked)
|
||||||
}
|
}
|
||||||
|
|
||||||
var verified: SSKProtoVerified?
|
var verified: SSKProtoVerified? = nil
|
||||||
if proto.hasVerified {
|
if proto.hasVerified {
|
||||||
verified = try SSKProtoVerified.parseProto(proto.verified)
|
verified = try SSKProtoVerified.parseProto(proto.verified)
|
||||||
}
|
}
|
||||||
|
|
||||||
var configuration: SSKProtoSyncMessageConfiguration?
|
var configuration: SSKProtoSyncMessageConfiguration? = nil
|
||||||
if proto.hasConfiguration {
|
if proto.hasConfiguration {
|
||||||
configuration = try SSKProtoSyncMessageConfiguration.parseProto(proto.configuration)
|
configuration = try SSKProtoSyncMessageConfiguration.parseProto(proto.configuration)
|
||||||
}
|
}
|
||||||
|
@ -3684,6 +4079,39 @@ extension SSKProtoSyncMessage.SSKProtoSyncMessageBuilder {
|
||||||
return SSKProtoAttachmentPointerBuilder(id: id)
|
return SSKProtoAttachmentPointerBuilder(id: id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoAttachmentPointerBuilder {
|
||||||
|
let builder = SSKProtoAttachmentPointerBuilder(id: id)
|
||||||
|
if let _value = contentType {
|
||||||
|
builder.setContentType(_value)
|
||||||
|
}
|
||||||
|
if let _value = key {
|
||||||
|
builder.setKey(_value)
|
||||||
|
}
|
||||||
|
if hasSize {
|
||||||
|
builder.setSize(size)
|
||||||
|
}
|
||||||
|
if let _value = thumbnail {
|
||||||
|
builder.setThumbnail(_value)
|
||||||
|
}
|
||||||
|
if let _value = digest {
|
||||||
|
builder.setDigest(_value)
|
||||||
|
}
|
||||||
|
if let _value = fileName {
|
||||||
|
builder.setFileName(_value)
|
||||||
|
}
|
||||||
|
if hasFlags {
|
||||||
|
builder.setFlags(flags)
|
||||||
|
}
|
||||||
|
if hasWidth {
|
||||||
|
builder.setWidth(width)
|
||||||
|
}
|
||||||
|
if hasHeight {
|
||||||
|
builder.setHeight(height)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoAttachmentPointerBuilder: NSObject {
|
@objc public class SSKProtoAttachmentPointerBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_AttachmentPointer()
|
private var proto = SignalServiceProtos_AttachmentPointer()
|
||||||
|
@ -3915,6 +4343,19 @@ extension SSKProtoAttachmentPointer.SSKProtoAttachmentPointerBuilder {
|
||||||
return SSKProtoGroupContextBuilder(id: id, type: type)
|
return SSKProtoGroupContextBuilder(id: id, type: type)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoGroupContextBuilder {
|
||||||
|
let builder = SSKProtoGroupContextBuilder(id: id, type: type)
|
||||||
|
if let _value = name {
|
||||||
|
builder.setName(_value)
|
||||||
|
}
|
||||||
|
builder.setMembers(members)
|
||||||
|
if let _value = avatar {
|
||||||
|
builder.setAvatar(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoGroupContextBuilder: NSObject {
|
@objc public class SSKProtoGroupContextBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_GroupContext()
|
private var proto = SignalServiceProtos_GroupContext()
|
||||||
|
@ -4016,7 +4457,7 @@ extension SSKProtoAttachmentPointer.SSKProtoAttachmentPointerBuilder {
|
||||||
}
|
}
|
||||||
let type = SSKProtoGroupContextTypeWrap(proto.type)
|
let type = SSKProtoGroupContextTypeWrap(proto.type)
|
||||||
|
|
||||||
var avatar: SSKProtoAttachmentPointer?
|
var avatar: SSKProtoAttachmentPointer? = nil
|
||||||
if proto.hasAvatar {
|
if proto.hasAvatar {
|
||||||
avatar = try SSKProtoAttachmentPointer.parseProto(proto.avatar)
|
avatar = try SSKProtoAttachmentPointer.parseProto(proto.avatar)
|
||||||
}
|
}
|
||||||
|
@ -4059,6 +4500,18 @@ extension SSKProtoGroupContext.SSKProtoGroupContextBuilder {
|
||||||
return SSKProtoContactDetailsAvatarBuilder()
|
return SSKProtoContactDetailsAvatarBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoContactDetailsAvatarBuilder {
|
||||||
|
let builder = SSKProtoContactDetailsAvatarBuilder()
|
||||||
|
if let _value = contentType {
|
||||||
|
builder.setContentType(_value)
|
||||||
|
}
|
||||||
|
if hasLength {
|
||||||
|
builder.setLength(length)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoContactDetailsAvatarBuilder: NSObject {
|
@objc public class SSKProtoContactDetailsAvatarBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_ContactDetails.Avatar()
|
private var proto = SignalServiceProtos_ContactDetails.Avatar()
|
||||||
|
@ -4151,6 +4604,33 @@ extension SSKProtoContactDetailsAvatar.SSKProtoContactDetailsAvatarBuilder {
|
||||||
return SSKProtoContactDetailsBuilder(number: number)
|
return SSKProtoContactDetailsBuilder(number: number)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoContactDetailsBuilder {
|
||||||
|
let builder = SSKProtoContactDetailsBuilder(number: number)
|
||||||
|
if let _value = name {
|
||||||
|
builder.setName(_value)
|
||||||
|
}
|
||||||
|
if let _value = avatar {
|
||||||
|
builder.setAvatar(_value)
|
||||||
|
}
|
||||||
|
if let _value = color {
|
||||||
|
builder.setColor(_value)
|
||||||
|
}
|
||||||
|
if let _value = verified {
|
||||||
|
builder.setVerified(_value)
|
||||||
|
}
|
||||||
|
if let _value = profileKey {
|
||||||
|
builder.setProfileKey(_value)
|
||||||
|
}
|
||||||
|
if hasBlocked {
|
||||||
|
builder.setBlocked(blocked)
|
||||||
|
}
|
||||||
|
if hasExpireTimer {
|
||||||
|
builder.setExpireTimer(expireTimer)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoContactDetailsBuilder: NSObject {
|
@objc public class SSKProtoContactDetailsBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_ContactDetails()
|
private var proto = SignalServiceProtos_ContactDetails()
|
||||||
|
@ -4282,12 +4762,12 @@ extension SSKProtoContactDetailsAvatar.SSKProtoContactDetailsAvatarBuilder {
|
||||||
}
|
}
|
||||||
let number = proto.number
|
let number = proto.number
|
||||||
|
|
||||||
var avatar: SSKProtoContactDetailsAvatar?
|
var avatar: SSKProtoContactDetailsAvatar? = nil
|
||||||
if proto.hasAvatar {
|
if proto.hasAvatar {
|
||||||
avatar = try SSKProtoContactDetailsAvatar.parseProto(proto.avatar)
|
avatar = try SSKProtoContactDetailsAvatar.parseProto(proto.avatar)
|
||||||
}
|
}
|
||||||
|
|
||||||
var verified: SSKProtoVerified?
|
var verified: SSKProtoVerified? = nil
|
||||||
if proto.hasVerified {
|
if proto.hasVerified {
|
||||||
verified = try SSKProtoVerified.parseProto(proto.verified)
|
verified = try SSKProtoVerified.parseProto(proto.verified)
|
||||||
}
|
}
|
||||||
|
@ -4330,6 +4810,18 @@ extension SSKProtoContactDetails.SSKProtoContactDetailsBuilder {
|
||||||
return SSKProtoGroupDetailsAvatarBuilder()
|
return SSKProtoGroupDetailsAvatarBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoGroupDetailsAvatarBuilder {
|
||||||
|
let builder = SSKProtoGroupDetailsAvatarBuilder()
|
||||||
|
if let _value = contentType {
|
||||||
|
builder.setContentType(_value)
|
||||||
|
}
|
||||||
|
if hasLength {
|
||||||
|
builder.setLength(length)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoGroupDetailsAvatarBuilder: NSObject {
|
@objc public class SSKProtoGroupDetailsAvatarBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_GroupDetails.Avatar()
|
private var proto = SignalServiceProtos_GroupDetails.Avatar()
|
||||||
|
@ -4422,6 +4914,31 @@ extension SSKProtoGroupDetailsAvatar.SSKProtoGroupDetailsAvatarBuilder {
|
||||||
return SSKProtoGroupDetailsBuilder(id: id)
|
return SSKProtoGroupDetailsBuilder(id: id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SSKProtoGroupDetailsBuilder {
|
||||||
|
let builder = SSKProtoGroupDetailsBuilder(id: id)
|
||||||
|
if let _value = name {
|
||||||
|
builder.setName(_value)
|
||||||
|
}
|
||||||
|
builder.setMembers(members)
|
||||||
|
if let _value = avatar {
|
||||||
|
builder.setAvatar(_value)
|
||||||
|
}
|
||||||
|
if hasActive {
|
||||||
|
builder.setActive(active)
|
||||||
|
}
|
||||||
|
if hasExpireTimer {
|
||||||
|
builder.setExpireTimer(expireTimer)
|
||||||
|
}
|
||||||
|
if let _value = color {
|
||||||
|
builder.setColor(_value)
|
||||||
|
}
|
||||||
|
if hasBlocked {
|
||||||
|
builder.setBlocked(blocked)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SSKProtoGroupDetailsBuilder: NSObject {
|
@objc public class SSKProtoGroupDetailsBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = SignalServiceProtos_GroupDetails()
|
private var proto = SignalServiceProtos_GroupDetails()
|
||||||
|
@ -4556,7 +5073,7 @@ extension SSKProtoGroupDetailsAvatar.SSKProtoGroupDetailsAvatarBuilder {
|
||||||
}
|
}
|
||||||
let id = proto.id
|
let id = proto.id
|
||||||
|
|
||||||
var avatar: SSKProtoGroupDetailsAvatar?
|
var avatar: SSKProtoGroupDetailsAvatar? = nil
|
||||||
if proto.hasAvatar {
|
if proto.hasAvatar {
|
||||||
avatar = try SSKProtoGroupDetailsAvatar.parseProto(proto.avatar)
|
avatar = try SSKProtoGroupDetailsAvatar.parseProto(proto.avatar)
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,12 @@ public enum SignalIOSProtoError: Error {
|
||||||
return SignalIOSProtoBackupSnapshotBackupEntityBuilder(type: type, entityData: entityData)
|
return SignalIOSProtoBackupSnapshotBackupEntityBuilder(type: type, entityData: entityData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SignalIOSProtoBackupSnapshotBackupEntityBuilder {
|
||||||
|
let builder = SignalIOSProtoBackupSnapshotBackupEntityBuilder(type: type, entityData: entityData)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SignalIOSProtoBackupSnapshotBackupEntityBuilder: NSObject {
|
@objc public class SignalIOSProtoBackupSnapshotBackupEntityBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = IOSProtos_BackupSnapshot.BackupEntity()
|
private var proto = IOSProtos_BackupSnapshot.BackupEntity()
|
||||||
|
@ -152,6 +158,13 @@ extension SignalIOSProtoBackupSnapshotBackupEntity.SignalIOSProtoBackupSnapshotB
|
||||||
return SignalIOSProtoBackupSnapshotBuilder()
|
return SignalIOSProtoBackupSnapshotBuilder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> SignalIOSProtoBackupSnapshotBuilder {
|
||||||
|
let builder = SignalIOSProtoBackupSnapshotBuilder()
|
||||||
|
builder.setEntity(entity)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class SignalIOSProtoBackupSnapshotBuilder: NSObject {
|
@objc public class SignalIOSProtoBackupSnapshotBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = IOSProtos_BackupSnapshot()
|
private var proto = IOSProtos_BackupSnapshot()
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
|
// DO NOT EDIT.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
// Generated by the Swift generator plugin for the protocol buffer compiler.
|
||||||
|
// Source: SignalService.proto
|
||||||
//
|
//
|
||||||
|
// For information on using the generated types, please see the documenation:
|
||||||
|
// https://github.com/apple/swift-protobuf/
|
||||||
|
|
||||||
//*
|
//*
|
||||||
// Copyright (C) 2014-2016 Open Whisper Systems
|
// Copyright (C) 2014-2016 Open Whisper Systems
|
||||||
|
@ -18,7 +22,7 @@ import SwiftProtobuf
|
||||||
// incompatible with the version of SwiftProtobuf to which you are linking.
|
// incompatible with the version of SwiftProtobuf to which you are linking.
|
||||||
// Please ensure that your are building against the same version of the API
|
// Please ensure that your are building against the same version of the API
|
||||||
// that was used to generate this file.
|
// that was used to generate this file.
|
||||||
private struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
|
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
|
||||||
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
|
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
|
||||||
typealias Version = _2
|
typealias Version = _2
|
||||||
}
|
}
|
||||||
|
@ -159,15 +163,15 @@ struct SignalServiceProtos_Envelope {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _type: SignalServiceProtos_Envelope.TypeEnum?
|
fileprivate var _type: SignalServiceProtos_Envelope.TypeEnum? = nil
|
||||||
fileprivate var _source: String?
|
fileprivate var _source: String? = nil
|
||||||
fileprivate var _sourceDevice: UInt32?
|
fileprivate var _sourceDevice: UInt32? = nil
|
||||||
fileprivate var _relay: String?
|
fileprivate var _relay: String? = nil
|
||||||
fileprivate var _timestamp: UInt64?
|
fileprivate var _timestamp: UInt64? = nil
|
||||||
fileprivate var _legacyMessage: Data?
|
fileprivate var _legacyMessage: Data? = nil
|
||||||
fileprivate var _content: Data?
|
fileprivate var _content: Data? = nil
|
||||||
fileprivate var _serverGuid: String?
|
fileprivate var _serverGuid: String? = nil
|
||||||
fileprivate var _serverTimestamp: UInt64?
|
fileprivate var _serverTimestamp: UInt64? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
#if swift(>=4.2)
|
#if swift(>=4.2)
|
||||||
|
@ -325,8 +329,8 @@ struct SignalServiceProtos_CallMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _id: UInt64?
|
fileprivate var _id: UInt64? = nil
|
||||||
fileprivate var _sessionDescription: String?
|
fileprivate var _sessionDescription: String? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Answer {
|
struct Answer {
|
||||||
|
@ -360,8 +364,8 @@ struct SignalServiceProtos_CallMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _id: UInt64?
|
fileprivate var _id: UInt64? = nil
|
||||||
fileprivate var _sessionDescription: String?
|
fileprivate var _sessionDescription: String? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
struct IceUpdate {
|
struct IceUpdate {
|
||||||
|
@ -413,10 +417,10 @@ struct SignalServiceProtos_CallMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _id: UInt64?
|
fileprivate var _id: UInt64? = nil
|
||||||
fileprivate var _sdpMid: String?
|
fileprivate var _sdpMid: String? = nil
|
||||||
fileprivate var _sdpMlineIndex: UInt32?
|
fileprivate var _sdpMlineIndex: UInt32? = nil
|
||||||
fileprivate var _sdp: String?
|
fileprivate var _sdp: String? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Busy {
|
struct Busy {
|
||||||
|
@ -438,7 +442,7 @@ struct SignalServiceProtos_CallMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _id: UInt64?
|
fileprivate var _id: UInt64? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Hangup {
|
struct Hangup {
|
||||||
|
@ -460,7 +464,7 @@ struct SignalServiceProtos_CallMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _id: UInt64?
|
fileprivate var _id: UInt64? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
@ -688,9 +692,9 @@ struct SignalServiceProtos_DataMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _id: UInt64?
|
fileprivate var _id: UInt64? = nil
|
||||||
fileprivate var _author: String?
|
fileprivate var _author: String? = nil
|
||||||
fileprivate var _text: String?
|
fileprivate var _text: String? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Contact {
|
struct Contact {
|
||||||
|
@ -805,12 +809,12 @@ struct SignalServiceProtos_DataMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _givenName: String?
|
fileprivate var _givenName: String? = nil
|
||||||
fileprivate var _familyName: String?
|
fileprivate var _familyName: String? = nil
|
||||||
fileprivate var _prefix: String?
|
fileprivate var _prefix: String? = nil
|
||||||
fileprivate var _suffix: String?
|
fileprivate var _suffix: String? = nil
|
||||||
fileprivate var _middleName: String?
|
fileprivate var _middleName: String? = nil
|
||||||
fileprivate var _displayName: String?
|
fileprivate var _displayName: String? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Phone {
|
struct Phone {
|
||||||
|
@ -881,9 +885,9 @@ struct SignalServiceProtos_DataMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _value: String?
|
fileprivate var _value: String? = nil
|
||||||
fileprivate var _type: SignalServiceProtos_DataMessage.Contact.Phone.TypeEnum?
|
fileprivate var _type: SignalServiceProtos_DataMessage.Contact.Phone.TypeEnum? = nil
|
||||||
fileprivate var _label: String?
|
fileprivate var _label: String? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Email {
|
struct Email {
|
||||||
|
@ -954,9 +958,9 @@ struct SignalServiceProtos_DataMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _value: String?
|
fileprivate var _value: String? = nil
|
||||||
fileprivate var _type: SignalServiceProtos_DataMessage.Contact.Email.TypeEnum?
|
fileprivate var _type: SignalServiceProtos_DataMessage.Contact.Email.TypeEnum? = nil
|
||||||
fileprivate var _label: String?
|
fileprivate var _label: String? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
struct PostalAddress {
|
struct PostalAddress {
|
||||||
|
@ -1078,15 +1082,15 @@ struct SignalServiceProtos_DataMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _type: SignalServiceProtos_DataMessage.Contact.PostalAddress.TypeEnum?
|
fileprivate var _type: SignalServiceProtos_DataMessage.Contact.PostalAddress.TypeEnum? = nil
|
||||||
fileprivate var _label: String?
|
fileprivate var _label: String? = nil
|
||||||
fileprivate var _street: String?
|
fileprivate var _street: String? = nil
|
||||||
fileprivate var _pobox: String?
|
fileprivate var _pobox: String? = nil
|
||||||
fileprivate var _neighborhood: String?
|
fileprivate var _neighborhood: String? = nil
|
||||||
fileprivate var _city: String?
|
fileprivate var _city: String? = nil
|
||||||
fileprivate var _region: String?
|
fileprivate var _region: String? = nil
|
||||||
fileprivate var _postcode: String?
|
fileprivate var _postcode: String? = nil
|
||||||
fileprivate var _country: String?
|
fileprivate var _country: String? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Avatar {
|
struct Avatar {
|
||||||
|
@ -1155,7 +1159,7 @@ struct SignalServiceProtos_NullMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _padding: Data?
|
fileprivate var _padding: Data? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SignalServiceProtos_ReceiptMessage {
|
struct SignalServiceProtos_ReceiptMessage {
|
||||||
|
@ -1205,7 +1209,7 @@ struct SignalServiceProtos_ReceiptMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _type: SignalServiceProtos_ReceiptMessage.TypeEnum?
|
fileprivate var _type: SignalServiceProtos_ReceiptMessage.TypeEnum? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
#if swift(>=4.2)
|
#if swift(>=4.2)
|
||||||
|
@ -1291,10 +1295,10 @@ struct SignalServiceProtos_Verified {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _destination: String?
|
fileprivate var _destination: String? = nil
|
||||||
fileprivate var _identityKey: Data?
|
fileprivate var _identityKey: Data? = nil
|
||||||
fileprivate var _state: SignalServiceProtos_Verified.State?
|
fileprivate var _state: SignalServiceProtos_Verified.State? = nil
|
||||||
fileprivate var _nullMessage: Data?
|
fileprivate var _nullMessage: Data? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
#if swift(>=4.2)
|
#if swift(>=4.2)
|
||||||
|
@ -1558,7 +1562,7 @@ struct SignalServiceProtos_SyncMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _type: SignalServiceProtos_SyncMessage.Request.TypeEnum?
|
fileprivate var _type: SignalServiceProtos_SyncMessage.Request.TypeEnum? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Read {
|
struct Read {
|
||||||
|
@ -1590,8 +1594,8 @@ struct SignalServiceProtos_SyncMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _sender: String?
|
fileprivate var _sender: String? = nil
|
||||||
fileprivate var _timestamp: UInt64?
|
fileprivate var _timestamp: UInt64? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Configuration {
|
struct Configuration {
|
||||||
|
@ -1612,7 +1616,7 @@ struct SignalServiceProtos_SyncMessage {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _readReceipts: Bool?
|
fileprivate var _readReceipts: Bool? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
@ -1743,16 +1747,16 @@ struct SignalServiceProtos_AttachmentPointer {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _id: UInt64?
|
fileprivate var _id: UInt64? = nil
|
||||||
fileprivate var _contentType: String?
|
fileprivate var _contentType: String? = nil
|
||||||
fileprivate var _key: Data?
|
fileprivate var _key: Data? = nil
|
||||||
fileprivate var _size: UInt32?
|
fileprivate var _size: UInt32? = nil
|
||||||
fileprivate var _thumbnail: Data?
|
fileprivate var _thumbnail: Data? = nil
|
||||||
fileprivate var _digest: Data?
|
fileprivate var _digest: Data? = nil
|
||||||
fileprivate var _fileName: String?
|
fileprivate var _fileName: String? = nil
|
||||||
fileprivate var _flags: UInt32?
|
fileprivate var _flags: UInt32? = nil
|
||||||
fileprivate var _width: UInt32?
|
fileprivate var _width: UInt32? = nil
|
||||||
fileprivate var _height: UInt32?
|
fileprivate var _height: UInt32? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
#if swift(>=4.2)
|
#if swift(>=4.2)
|
||||||
|
@ -1968,8 +1972,8 @@ struct SignalServiceProtos_ContactDetails {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _contentType: String?
|
fileprivate var _contentType: String? = nil
|
||||||
fileprivate var _length: UInt32?
|
fileprivate var _length: UInt32? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
@ -2080,8 +2084,8 @@ struct SignalServiceProtos_GroupDetails {
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
fileprivate var _contentType: String?
|
fileprivate var _contentType: String? = nil
|
||||||
fileprivate var _length: UInt32?
|
fileprivate var _length: UInt32? = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
|
@ -2091,7 +2095,7 @@ struct SignalServiceProtos_GroupDetails {
|
||||||
|
|
||||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||||
|
|
||||||
private let _protobuf_package = "SignalServiceProtos"
|
fileprivate let _protobuf_package = "SignalServiceProtos"
|
||||||
|
|
||||||
extension SignalServiceProtos_Envelope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
extension SignalServiceProtos_Envelope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
static let protoMessageName: String = _protobuf_package + ".Envelope"
|
static let protoMessageName: String = _protobuf_package + ".Envelope"
|
||||||
|
@ -2104,7 +2108,7 @@ extension SignalServiceProtos_Envelope: SwiftProtobuf.Message, SwiftProtobuf._Me
|
||||||
6: .same(proto: "legacyMessage"),
|
6: .same(proto: "legacyMessage"),
|
||||||
8: .same(proto: "content"),
|
8: .same(proto: "content"),
|
||||||
9: .same(proto: "serverGuid"),
|
9: .same(proto: "serverGuid"),
|
||||||
10: .same(proto: "serverTimestamp")
|
10: .same(proto: "serverTimestamp"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -2177,7 +2181,7 @@ extension SignalServiceProtos_Envelope.TypeEnum: SwiftProtobuf._ProtoNameProvidi
|
||||||
2: .same(proto: "KEY_EXCHANGE"),
|
2: .same(proto: "KEY_EXCHANGE"),
|
||||||
3: .same(proto: "PREKEY_BUNDLE"),
|
3: .same(proto: "PREKEY_BUNDLE"),
|
||||||
5: .same(proto: "RECEIPT"),
|
5: .same(proto: "RECEIPT"),
|
||||||
6: .same(proto: "UNIDENTIFIED_SENDER")
|
6: .same(proto: "UNIDENTIFIED_SENDER"),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2188,15 +2192,15 @@ extension SignalServiceProtos_Content: SwiftProtobuf.Message, SwiftProtobuf._Mes
|
||||||
2: .same(proto: "syncMessage"),
|
2: .same(proto: "syncMessage"),
|
||||||
3: .same(proto: "callMessage"),
|
3: .same(proto: "callMessage"),
|
||||||
4: .same(proto: "nullMessage"),
|
4: .same(proto: "nullMessage"),
|
||||||
5: .same(proto: "receiptMessage")
|
5: .same(proto: "receiptMessage"),
|
||||||
]
|
]
|
||||||
|
|
||||||
fileprivate class _StorageClass {
|
fileprivate class _StorageClass {
|
||||||
var _dataMessage: SignalServiceProtos_DataMessage?
|
var _dataMessage: SignalServiceProtos_DataMessage? = nil
|
||||||
var _syncMessage: SignalServiceProtos_SyncMessage?
|
var _syncMessage: SignalServiceProtos_SyncMessage? = nil
|
||||||
var _callMessage: SignalServiceProtos_CallMessage?
|
var _callMessage: SignalServiceProtos_CallMessage? = nil
|
||||||
var _nullMessage: SignalServiceProtos_NullMessage?
|
var _nullMessage: SignalServiceProtos_NullMessage? = nil
|
||||||
var _receiptMessage: SignalServiceProtos_ReceiptMessage?
|
var _receiptMessage: SignalServiceProtos_ReceiptMessage? = nil
|
||||||
|
|
||||||
static let defaultInstance = _StorageClass()
|
static let defaultInstance = _StorageClass()
|
||||||
|
|
||||||
|
@ -2282,16 +2286,16 @@ extension SignalServiceProtos_CallMessage: SwiftProtobuf.Message, SwiftProtobuf.
|
||||||
3: .same(proto: "iceUpdate"),
|
3: .same(proto: "iceUpdate"),
|
||||||
4: .same(proto: "hangup"),
|
4: .same(proto: "hangup"),
|
||||||
5: .same(proto: "busy"),
|
5: .same(proto: "busy"),
|
||||||
6: .same(proto: "profileKey")
|
6: .same(proto: "profileKey"),
|
||||||
]
|
]
|
||||||
|
|
||||||
fileprivate class _StorageClass {
|
fileprivate class _StorageClass {
|
||||||
var _offer: SignalServiceProtos_CallMessage.Offer?
|
var _offer: SignalServiceProtos_CallMessage.Offer? = nil
|
||||||
var _answer: SignalServiceProtos_CallMessage.Answer?
|
var _answer: SignalServiceProtos_CallMessage.Answer? = nil
|
||||||
var _iceUpdate: [SignalServiceProtos_CallMessage.IceUpdate] = []
|
var _iceUpdate: [SignalServiceProtos_CallMessage.IceUpdate] = []
|
||||||
var _hangup: SignalServiceProtos_CallMessage.Hangup?
|
var _hangup: SignalServiceProtos_CallMessage.Hangup? = nil
|
||||||
var _busy: SignalServiceProtos_CallMessage.Busy?
|
var _busy: SignalServiceProtos_CallMessage.Busy? = nil
|
||||||
var _profileKey: Data?
|
var _profileKey: Data? = nil
|
||||||
|
|
||||||
static let defaultInstance = _StorageClass()
|
static let defaultInstance = _StorageClass()
|
||||||
|
|
||||||
|
@ -2379,7 +2383,7 @@ extension SignalServiceProtos_CallMessage.Offer: SwiftProtobuf.Message, SwiftPro
|
||||||
static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Offer"
|
static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Offer"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "id"),
|
1: .same(proto: "id"),
|
||||||
2: .same(proto: "sessionDescription")
|
2: .same(proto: "sessionDescription"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -2414,7 +2418,7 @@ extension SignalServiceProtos_CallMessage.Answer: SwiftProtobuf.Message, SwiftPr
|
||||||
static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Answer"
|
static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Answer"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "id"),
|
1: .same(proto: "id"),
|
||||||
2: .same(proto: "sessionDescription")
|
2: .same(proto: "sessionDescription"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -2451,7 +2455,7 @@ extension SignalServiceProtos_CallMessage.IceUpdate: SwiftProtobuf.Message, Swif
|
||||||
1: .same(proto: "id"),
|
1: .same(proto: "id"),
|
||||||
2: .same(proto: "sdpMid"),
|
2: .same(proto: "sdpMid"),
|
||||||
3: .same(proto: "sdpMLineIndex"),
|
3: .same(proto: "sdpMLineIndex"),
|
||||||
4: .same(proto: "sdp")
|
4: .same(proto: "sdp"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -2495,7 +2499,7 @@ extension SignalServiceProtos_CallMessage.IceUpdate: SwiftProtobuf.Message, Swif
|
||||||
extension SignalServiceProtos_CallMessage.Busy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
extension SignalServiceProtos_CallMessage.Busy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Busy"
|
static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Busy"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "id")
|
1: .same(proto: "id"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -2524,7 +2528,7 @@ extension SignalServiceProtos_CallMessage.Busy: SwiftProtobuf.Message, SwiftProt
|
||||||
extension SignalServiceProtos_CallMessage.Hangup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
extension SignalServiceProtos_CallMessage.Hangup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Hangup"
|
static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Hangup"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "id")
|
1: .same(proto: "id"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -2561,18 +2565,18 @@ extension SignalServiceProtos_DataMessage: SwiftProtobuf.Message, SwiftProtobuf.
|
||||||
6: .same(proto: "profileKey"),
|
6: .same(proto: "profileKey"),
|
||||||
7: .same(proto: "timestamp"),
|
7: .same(proto: "timestamp"),
|
||||||
8: .same(proto: "quote"),
|
8: .same(proto: "quote"),
|
||||||
9: .same(proto: "contact")
|
9: .same(proto: "contact"),
|
||||||
]
|
]
|
||||||
|
|
||||||
fileprivate class _StorageClass {
|
fileprivate class _StorageClass {
|
||||||
var _body: String?
|
var _body: String? = nil
|
||||||
var _attachments: [SignalServiceProtos_AttachmentPointer] = []
|
var _attachments: [SignalServiceProtos_AttachmentPointer] = []
|
||||||
var _group: SignalServiceProtos_GroupContext?
|
var _group: SignalServiceProtos_GroupContext? = nil
|
||||||
var _flags: UInt32?
|
var _flags: UInt32? = nil
|
||||||
var _expireTimer: UInt32?
|
var _expireTimer: UInt32? = nil
|
||||||
var _profileKey: Data?
|
var _profileKey: Data? = nil
|
||||||
var _timestamp: UInt64?
|
var _timestamp: UInt64? = nil
|
||||||
var _quote: SignalServiceProtos_DataMessage.Quote?
|
var _quote: SignalServiceProtos_DataMessage.Quote? = nil
|
||||||
var _contact: [SignalServiceProtos_DataMessage.Contact] = []
|
var _contact: [SignalServiceProtos_DataMessage.Contact] = []
|
||||||
|
|
||||||
static let defaultInstance = _StorageClass()
|
static let defaultInstance = _StorageClass()
|
||||||
|
@ -2679,7 +2683,7 @@ extension SignalServiceProtos_DataMessage.Flags: SwiftProtobuf._ProtoNameProvidi
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "END_SESSION"),
|
1: .same(proto: "END_SESSION"),
|
||||||
2: .same(proto: "EXPIRATION_TIMER_UPDATE"),
|
2: .same(proto: "EXPIRATION_TIMER_UPDATE"),
|
||||||
4: .same(proto: "PROFILE_KEY_UPDATE")
|
4: .same(proto: "PROFILE_KEY_UPDATE"),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2689,7 +2693,7 @@ extension SignalServiceProtos_DataMessage.Quote: SwiftProtobuf.Message, SwiftPro
|
||||||
1: .same(proto: "id"),
|
1: .same(proto: "id"),
|
||||||
2: .same(proto: "author"),
|
2: .same(proto: "author"),
|
||||||
3: .same(proto: "text"),
|
3: .same(proto: "text"),
|
||||||
4: .same(proto: "attachments")
|
4: .same(proto: "attachments"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -2736,14 +2740,14 @@ extension SignalServiceProtos_DataMessage.Quote.QuotedAttachment: SwiftProtobuf.
|
||||||
1: .same(proto: "contentType"),
|
1: .same(proto: "contentType"),
|
||||||
2: .same(proto: "fileName"),
|
2: .same(proto: "fileName"),
|
||||||
3: .same(proto: "thumbnail"),
|
3: .same(proto: "thumbnail"),
|
||||||
4: .same(proto: "flags")
|
4: .same(proto: "flags"),
|
||||||
]
|
]
|
||||||
|
|
||||||
fileprivate class _StorageClass {
|
fileprivate class _StorageClass {
|
||||||
var _contentType: String?
|
var _contentType: String? = nil
|
||||||
var _fileName: String?
|
var _fileName: String? = nil
|
||||||
var _thumbnail: SignalServiceProtos_AttachmentPointer?
|
var _thumbnail: SignalServiceProtos_AttachmentPointer? = nil
|
||||||
var _flags: UInt32?
|
var _flags: UInt32? = nil
|
||||||
|
|
||||||
static let defaultInstance = _StorageClass()
|
static let defaultInstance = _StorageClass()
|
||||||
|
|
||||||
|
@ -2817,7 +2821,7 @@ extension SignalServiceProtos_DataMessage.Quote.QuotedAttachment: SwiftProtobuf.
|
||||||
|
|
||||||
extension SignalServiceProtos_DataMessage.Quote.QuotedAttachment.Flags: SwiftProtobuf._ProtoNameProviding {
|
extension SignalServiceProtos_DataMessage.Quote.QuotedAttachment.Flags: SwiftProtobuf._ProtoNameProviding {
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "VOICE_MESSAGE")
|
1: .same(proto: "VOICE_MESSAGE"),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2829,16 +2833,16 @@ extension SignalServiceProtos_DataMessage.Contact: SwiftProtobuf.Message, SwiftP
|
||||||
4: .same(proto: "email"),
|
4: .same(proto: "email"),
|
||||||
5: .same(proto: "address"),
|
5: .same(proto: "address"),
|
||||||
6: .same(proto: "avatar"),
|
6: .same(proto: "avatar"),
|
||||||
7: .same(proto: "organization")
|
7: .same(proto: "organization"),
|
||||||
]
|
]
|
||||||
|
|
||||||
fileprivate class _StorageClass {
|
fileprivate class _StorageClass {
|
||||||
var _name: SignalServiceProtos_DataMessage.Contact.Name?
|
var _name: SignalServiceProtos_DataMessage.Contact.Name? = nil
|
||||||
var _number: [SignalServiceProtos_DataMessage.Contact.Phone] = []
|
var _number: [SignalServiceProtos_DataMessage.Contact.Phone] = []
|
||||||
var _email: [SignalServiceProtos_DataMessage.Contact.Email] = []
|
var _email: [SignalServiceProtos_DataMessage.Contact.Email] = []
|
||||||
var _address: [SignalServiceProtos_DataMessage.Contact.PostalAddress] = []
|
var _address: [SignalServiceProtos_DataMessage.Contact.PostalAddress] = []
|
||||||
var _avatar: SignalServiceProtos_DataMessage.Contact.Avatar?
|
var _avatar: SignalServiceProtos_DataMessage.Contact.Avatar? = nil
|
||||||
var _organization: String?
|
var _organization: String? = nil
|
||||||
|
|
||||||
static let defaultInstance = _StorageClass()
|
static let defaultInstance = _StorageClass()
|
||||||
|
|
||||||
|
@ -2930,7 +2934,7 @@ extension SignalServiceProtos_DataMessage.Contact.Name: SwiftProtobuf.Message, S
|
||||||
3: .same(proto: "prefix"),
|
3: .same(proto: "prefix"),
|
||||||
4: .same(proto: "suffix"),
|
4: .same(proto: "suffix"),
|
||||||
5: .same(proto: "middleName"),
|
5: .same(proto: "middleName"),
|
||||||
6: .same(proto: "displayName")
|
6: .same(proto: "displayName"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -2986,7 +2990,7 @@ extension SignalServiceProtos_DataMessage.Contact.Phone: SwiftProtobuf.Message,
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "value"),
|
1: .same(proto: "value"),
|
||||||
2: .same(proto: "type"),
|
2: .same(proto: "type"),
|
||||||
3: .same(proto: "label")
|
3: .same(proto: "label"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -3027,7 +3031,7 @@ extension SignalServiceProtos_DataMessage.Contact.Phone.TypeEnum: SwiftProtobuf.
|
||||||
1: .same(proto: "HOME"),
|
1: .same(proto: "HOME"),
|
||||||
2: .same(proto: "MOBILE"),
|
2: .same(proto: "MOBILE"),
|
||||||
3: .same(proto: "WORK"),
|
3: .same(proto: "WORK"),
|
||||||
4: .same(proto: "CUSTOM")
|
4: .same(proto: "CUSTOM"),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3036,7 +3040,7 @@ extension SignalServiceProtos_DataMessage.Contact.Email: SwiftProtobuf.Message,
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "value"),
|
1: .same(proto: "value"),
|
||||||
2: .same(proto: "type"),
|
2: .same(proto: "type"),
|
||||||
3: .same(proto: "label")
|
3: .same(proto: "label"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -3077,7 +3081,7 @@ extension SignalServiceProtos_DataMessage.Contact.Email.TypeEnum: SwiftProtobuf.
|
||||||
1: .same(proto: "HOME"),
|
1: .same(proto: "HOME"),
|
||||||
2: .same(proto: "MOBILE"),
|
2: .same(proto: "MOBILE"),
|
||||||
3: .same(proto: "WORK"),
|
3: .same(proto: "WORK"),
|
||||||
4: .same(proto: "CUSTOM")
|
4: .same(proto: "CUSTOM"),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3092,7 +3096,7 @@ extension SignalServiceProtos_DataMessage.Contact.PostalAddress: SwiftProtobuf.M
|
||||||
6: .same(proto: "city"),
|
6: .same(proto: "city"),
|
||||||
7: .same(proto: "region"),
|
7: .same(proto: "region"),
|
||||||
8: .same(proto: "postcode"),
|
8: .same(proto: "postcode"),
|
||||||
9: .same(proto: "country")
|
9: .same(proto: "country"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -3162,7 +3166,7 @@ extension SignalServiceProtos_DataMessage.Contact.PostalAddress.TypeEnum: SwiftP
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "HOME"),
|
1: .same(proto: "HOME"),
|
||||||
2: .same(proto: "WORK"),
|
2: .same(proto: "WORK"),
|
||||||
3: .same(proto: "CUSTOM")
|
3: .same(proto: "CUSTOM"),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3170,12 +3174,12 @@ extension SignalServiceProtos_DataMessage.Contact.Avatar: SwiftProtobuf.Message,
|
||||||
static let protoMessageName: String = SignalServiceProtos_DataMessage.Contact.protoMessageName + ".Avatar"
|
static let protoMessageName: String = SignalServiceProtos_DataMessage.Contact.protoMessageName + ".Avatar"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "avatar"),
|
1: .same(proto: "avatar"),
|
||||||
2: .same(proto: "isProfile")
|
2: .same(proto: "isProfile"),
|
||||||
]
|
]
|
||||||
|
|
||||||
fileprivate class _StorageClass {
|
fileprivate class _StorageClass {
|
||||||
var _avatar: SignalServiceProtos_AttachmentPointer?
|
var _avatar: SignalServiceProtos_AttachmentPointer? = nil
|
||||||
var _isProfile: Bool?
|
var _isProfile: Bool? = nil
|
||||||
|
|
||||||
static let defaultInstance = _StorageClass()
|
static let defaultInstance = _StorageClass()
|
||||||
|
|
||||||
|
@ -3238,7 +3242,7 @@ extension SignalServiceProtos_DataMessage.Contact.Avatar: SwiftProtobuf.Message,
|
||||||
extension SignalServiceProtos_NullMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
extension SignalServiceProtos_NullMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
static let protoMessageName: String = _protobuf_package + ".NullMessage"
|
static let protoMessageName: String = _protobuf_package + ".NullMessage"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "padding")
|
1: .same(proto: "padding"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -3268,7 +3272,7 @@ extension SignalServiceProtos_ReceiptMessage: SwiftProtobuf.Message, SwiftProtob
|
||||||
static let protoMessageName: String = _protobuf_package + ".ReceiptMessage"
|
static let protoMessageName: String = _protobuf_package + ".ReceiptMessage"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "type"),
|
1: .same(proto: "type"),
|
||||||
2: .same(proto: "timestamp")
|
2: .same(proto: "timestamp"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -3302,7 +3306,7 @@ extension SignalServiceProtos_ReceiptMessage: SwiftProtobuf.Message, SwiftProtob
|
||||||
extension SignalServiceProtos_ReceiptMessage.TypeEnum: SwiftProtobuf._ProtoNameProviding {
|
extension SignalServiceProtos_ReceiptMessage.TypeEnum: SwiftProtobuf._ProtoNameProviding {
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
0: .same(proto: "DELIVERY"),
|
0: .same(proto: "DELIVERY"),
|
||||||
1: .same(proto: "READ")
|
1: .same(proto: "READ"),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3312,7 +3316,7 @@ extension SignalServiceProtos_Verified: SwiftProtobuf.Message, SwiftProtobuf._Me
|
||||||
1: .same(proto: "destination"),
|
1: .same(proto: "destination"),
|
||||||
2: .same(proto: "identityKey"),
|
2: .same(proto: "identityKey"),
|
||||||
3: .same(proto: "state"),
|
3: .same(proto: "state"),
|
||||||
4: .same(proto: "nullMessage")
|
4: .same(proto: "nullMessage"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -3357,7 +3361,7 @@ extension SignalServiceProtos_Verified.State: SwiftProtobuf._ProtoNameProviding
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
0: .same(proto: "DEFAULT"),
|
0: .same(proto: "DEFAULT"),
|
||||||
1: .same(proto: "VERIFIED"),
|
1: .same(proto: "VERIFIED"),
|
||||||
2: .same(proto: "UNVERIFIED")
|
2: .same(proto: "UNVERIFIED"),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3372,19 +3376,19 @@ extension SignalServiceProtos_SyncMessage: SwiftProtobuf.Message, SwiftProtobuf.
|
||||||
6: .same(proto: "blocked"),
|
6: .same(proto: "blocked"),
|
||||||
7: .same(proto: "verified"),
|
7: .same(proto: "verified"),
|
||||||
9: .same(proto: "configuration"),
|
9: .same(proto: "configuration"),
|
||||||
8: .same(proto: "padding")
|
8: .same(proto: "padding"),
|
||||||
]
|
]
|
||||||
|
|
||||||
fileprivate class _StorageClass {
|
fileprivate class _StorageClass {
|
||||||
var _sent: SignalServiceProtos_SyncMessage.Sent?
|
var _sent: SignalServiceProtos_SyncMessage.Sent? = nil
|
||||||
var _contacts: SignalServiceProtos_SyncMessage.Contacts?
|
var _contacts: SignalServiceProtos_SyncMessage.Contacts? = nil
|
||||||
var _groups: SignalServiceProtos_SyncMessage.Groups?
|
var _groups: SignalServiceProtos_SyncMessage.Groups? = nil
|
||||||
var _request: SignalServiceProtos_SyncMessage.Request?
|
var _request: SignalServiceProtos_SyncMessage.Request? = nil
|
||||||
var _read: [SignalServiceProtos_SyncMessage.Read] = []
|
var _read: [SignalServiceProtos_SyncMessage.Read] = []
|
||||||
var _blocked: SignalServiceProtos_SyncMessage.Blocked?
|
var _blocked: SignalServiceProtos_SyncMessage.Blocked? = nil
|
||||||
var _verified: SignalServiceProtos_Verified?
|
var _verified: SignalServiceProtos_Verified? = nil
|
||||||
var _configuration: SignalServiceProtos_SyncMessage.Configuration?
|
var _configuration: SignalServiceProtos_SyncMessage.Configuration? = nil
|
||||||
var _padding: Data?
|
var _padding: Data? = nil
|
||||||
|
|
||||||
static let defaultInstance = _StorageClass()
|
static let defaultInstance = _StorageClass()
|
||||||
|
|
||||||
|
@ -3492,14 +3496,14 @@ extension SignalServiceProtos_SyncMessage.Sent: SwiftProtobuf.Message, SwiftProt
|
||||||
1: .same(proto: "destination"),
|
1: .same(proto: "destination"),
|
||||||
2: .same(proto: "timestamp"),
|
2: .same(proto: "timestamp"),
|
||||||
3: .same(proto: "message"),
|
3: .same(proto: "message"),
|
||||||
4: .same(proto: "expirationStartTimestamp")
|
4: .same(proto: "expirationStartTimestamp"),
|
||||||
]
|
]
|
||||||
|
|
||||||
fileprivate class _StorageClass {
|
fileprivate class _StorageClass {
|
||||||
var _destination: String?
|
var _destination: String? = nil
|
||||||
var _timestamp: UInt64?
|
var _timestamp: UInt64? = nil
|
||||||
var _message: SignalServiceProtos_DataMessage?
|
var _message: SignalServiceProtos_DataMessage? = nil
|
||||||
var _expirationStartTimestamp: UInt64?
|
var _expirationStartTimestamp: UInt64? = nil
|
||||||
|
|
||||||
static let defaultInstance = _StorageClass()
|
static let defaultInstance = _StorageClass()
|
||||||
|
|
||||||
|
@ -3575,12 +3579,12 @@ extension SignalServiceProtos_SyncMessage.Contacts: SwiftProtobuf.Message, Swift
|
||||||
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Contacts"
|
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Contacts"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "blob"),
|
1: .same(proto: "blob"),
|
||||||
2: .same(proto: "isComplete")
|
2: .same(proto: "isComplete"),
|
||||||
]
|
]
|
||||||
|
|
||||||
fileprivate class _StorageClass {
|
fileprivate class _StorageClass {
|
||||||
var _blob: SignalServiceProtos_AttachmentPointer?
|
var _blob: SignalServiceProtos_AttachmentPointer? = nil
|
||||||
var _isComplete: Bool?
|
var _isComplete: Bool? = nil
|
||||||
|
|
||||||
static let defaultInstance = _StorageClass()
|
static let defaultInstance = _StorageClass()
|
||||||
|
|
||||||
|
@ -3643,11 +3647,11 @@ extension SignalServiceProtos_SyncMessage.Contacts: SwiftProtobuf.Message, Swift
|
||||||
extension SignalServiceProtos_SyncMessage.Groups: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
extension SignalServiceProtos_SyncMessage.Groups: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Groups"
|
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Groups"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "blob")
|
1: .same(proto: "blob"),
|
||||||
]
|
]
|
||||||
|
|
||||||
fileprivate class _StorageClass {
|
fileprivate class _StorageClass {
|
||||||
var _blob: SignalServiceProtos_AttachmentPointer?
|
var _blob: SignalServiceProtos_AttachmentPointer? = nil
|
||||||
|
|
||||||
static let defaultInstance = _StorageClass()
|
static let defaultInstance = _StorageClass()
|
||||||
|
|
||||||
|
@ -3705,7 +3709,7 @@ extension SignalServiceProtos_SyncMessage.Blocked: SwiftProtobuf.Message, SwiftP
|
||||||
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Blocked"
|
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Blocked"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "numbers"),
|
1: .same(proto: "numbers"),
|
||||||
2: .same(proto: "groupIds")
|
2: .same(proto: "groupIds"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -3739,7 +3743,7 @@ extension SignalServiceProtos_SyncMessage.Blocked: SwiftProtobuf.Message, SwiftP
|
||||||
extension SignalServiceProtos_SyncMessage.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
extension SignalServiceProtos_SyncMessage.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Request"
|
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Request"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "type")
|
1: .same(proto: "type"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -3771,7 +3775,7 @@ extension SignalServiceProtos_SyncMessage.Request.TypeEnum: SwiftProtobuf._Proto
|
||||||
1: .same(proto: "CONTACTS"),
|
1: .same(proto: "CONTACTS"),
|
||||||
2: .same(proto: "GROUPS"),
|
2: .same(proto: "GROUPS"),
|
||||||
3: .same(proto: "BLOCKED"),
|
3: .same(proto: "BLOCKED"),
|
||||||
4: .same(proto: "CONFIGURATION")
|
4: .same(proto: "CONFIGURATION"),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3779,7 +3783,7 @@ extension SignalServiceProtos_SyncMessage.Read: SwiftProtobuf.Message, SwiftProt
|
||||||
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Read"
|
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Read"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "sender"),
|
1: .same(proto: "sender"),
|
||||||
2: .same(proto: "timestamp")
|
2: .same(proto: "timestamp"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -3813,7 +3817,7 @@ extension SignalServiceProtos_SyncMessage.Read: SwiftProtobuf.Message, SwiftProt
|
||||||
extension SignalServiceProtos_SyncMessage.Configuration: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
extension SignalServiceProtos_SyncMessage.Configuration: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Configuration"
|
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Configuration"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "readReceipts")
|
1: .same(proto: "readReceipts"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -3851,7 +3855,7 @@ extension SignalServiceProtos_AttachmentPointer: SwiftProtobuf.Message, SwiftPro
|
||||||
7: .same(proto: "fileName"),
|
7: .same(proto: "fileName"),
|
||||||
8: .same(proto: "flags"),
|
8: .same(proto: "flags"),
|
||||||
9: .same(proto: "width"),
|
9: .same(proto: "width"),
|
||||||
10: .same(proto: "height")
|
10: .same(proto: "height"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -3924,7 +3928,7 @@ extension SignalServiceProtos_AttachmentPointer: SwiftProtobuf.Message, SwiftPro
|
||||||
|
|
||||||
extension SignalServiceProtos_AttachmentPointer.Flags: SwiftProtobuf._ProtoNameProviding {
|
extension SignalServiceProtos_AttachmentPointer.Flags: SwiftProtobuf._ProtoNameProviding {
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "VOICE_MESSAGE")
|
1: .same(proto: "VOICE_MESSAGE"),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3935,15 +3939,15 @@ extension SignalServiceProtos_GroupContext: SwiftProtobuf.Message, SwiftProtobuf
|
||||||
2: .same(proto: "type"),
|
2: .same(proto: "type"),
|
||||||
3: .same(proto: "name"),
|
3: .same(proto: "name"),
|
||||||
4: .same(proto: "members"),
|
4: .same(proto: "members"),
|
||||||
5: .same(proto: "avatar")
|
5: .same(proto: "avatar"),
|
||||||
]
|
]
|
||||||
|
|
||||||
fileprivate class _StorageClass {
|
fileprivate class _StorageClass {
|
||||||
var _id: Data?
|
var _id: Data? = nil
|
||||||
var _type: SignalServiceProtos_GroupContext.TypeEnum?
|
var _type: SignalServiceProtos_GroupContext.TypeEnum? = nil
|
||||||
var _name: String?
|
var _name: String? = nil
|
||||||
var _members: [String] = []
|
var _members: [String] = []
|
||||||
var _avatar: SignalServiceProtos_AttachmentPointer?
|
var _avatar: SignalServiceProtos_AttachmentPointer? = nil
|
||||||
|
|
||||||
static let defaultInstance = _StorageClass()
|
static let defaultInstance = _StorageClass()
|
||||||
|
|
||||||
|
@ -4027,7 +4031,7 @@ extension SignalServiceProtos_GroupContext.TypeEnum: SwiftProtobuf._ProtoNamePro
|
||||||
1: .same(proto: "UPDATE"),
|
1: .same(proto: "UPDATE"),
|
||||||
2: .same(proto: "DELIVER"),
|
2: .same(proto: "DELIVER"),
|
||||||
3: .same(proto: "QUIT"),
|
3: .same(proto: "QUIT"),
|
||||||
4: .same(proto: "REQUEST_INFO")
|
4: .same(proto: "REQUEST_INFO"),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4041,18 +4045,18 @@ extension SignalServiceProtos_ContactDetails: SwiftProtobuf.Message, SwiftProtob
|
||||||
5: .same(proto: "verified"),
|
5: .same(proto: "verified"),
|
||||||
6: .same(proto: "profileKey"),
|
6: .same(proto: "profileKey"),
|
||||||
7: .same(proto: "blocked"),
|
7: .same(proto: "blocked"),
|
||||||
8: .same(proto: "expireTimer")
|
8: .same(proto: "expireTimer"),
|
||||||
]
|
]
|
||||||
|
|
||||||
fileprivate class _StorageClass {
|
fileprivate class _StorageClass {
|
||||||
var _number: String?
|
var _number: String? = nil
|
||||||
var _name: String?
|
var _name: String? = nil
|
||||||
var _avatar: SignalServiceProtos_ContactDetails.Avatar?
|
var _avatar: SignalServiceProtos_ContactDetails.Avatar? = nil
|
||||||
var _color: String?
|
var _color: String? = nil
|
||||||
var _verified: SignalServiceProtos_Verified?
|
var _verified: SignalServiceProtos_Verified? = nil
|
||||||
var _profileKey: Data?
|
var _profileKey: Data? = nil
|
||||||
var _blocked: Bool?
|
var _blocked: Bool? = nil
|
||||||
var _expireTimer: UInt32?
|
var _expireTimer: UInt32? = nil
|
||||||
|
|
||||||
static let defaultInstance = _StorageClass()
|
static let defaultInstance = _StorageClass()
|
||||||
|
|
||||||
|
@ -4152,7 +4156,7 @@ extension SignalServiceProtos_ContactDetails.Avatar: SwiftProtobuf.Message, Swif
|
||||||
static let protoMessageName: String = SignalServiceProtos_ContactDetails.protoMessageName + ".Avatar"
|
static let protoMessageName: String = SignalServiceProtos_ContactDetails.protoMessageName + ".Avatar"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "contentType"),
|
1: .same(proto: "contentType"),
|
||||||
2: .same(proto: "length")
|
2: .same(proto: "length"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
@ -4193,18 +4197,18 @@ extension SignalServiceProtos_GroupDetails: SwiftProtobuf.Message, SwiftProtobuf
|
||||||
5: .same(proto: "active"),
|
5: .same(proto: "active"),
|
||||||
6: .same(proto: "expireTimer"),
|
6: .same(proto: "expireTimer"),
|
||||||
7: .same(proto: "color"),
|
7: .same(proto: "color"),
|
||||||
8: .same(proto: "blocked")
|
8: .same(proto: "blocked"),
|
||||||
]
|
]
|
||||||
|
|
||||||
fileprivate class _StorageClass {
|
fileprivate class _StorageClass {
|
||||||
var _id: Data?
|
var _id: Data? = nil
|
||||||
var _name: String?
|
var _name: String? = nil
|
||||||
var _members: [String] = []
|
var _members: [String] = []
|
||||||
var _avatar: SignalServiceProtos_GroupDetails.Avatar?
|
var _avatar: SignalServiceProtos_GroupDetails.Avatar? = nil
|
||||||
var _active: Bool?
|
var _active: Bool? = nil
|
||||||
var _expireTimer: UInt32?
|
var _expireTimer: UInt32? = nil
|
||||||
var _color: String?
|
var _color: String? = nil
|
||||||
var _blocked: Bool?
|
var _blocked: Bool? = nil
|
||||||
|
|
||||||
static let defaultInstance = _StorageClass()
|
static let defaultInstance = _StorageClass()
|
||||||
|
|
||||||
|
@ -4304,7 +4308,7 @@ extension SignalServiceProtos_GroupDetails.Avatar: SwiftProtobuf.Message, SwiftP
|
||||||
static let protoMessageName: String = SignalServiceProtos_GroupDetails.protoMessageName + ".Avatar"
|
static let protoMessageName: String = SignalServiceProtos_GroupDetails.protoMessageName + ".Avatar"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "contentType"),
|
1: .same(proto: "contentType"),
|
||||||
2: .same(proto: "length")
|
2: .same(proto: "length"),
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
|
|
@ -20,6 +20,16 @@ public enum WebSocketProtoError: Error {
|
||||||
return WebSocketProtoWebSocketRequestMessageBuilder(verb: verb, path: path, requestID: requestID)
|
return WebSocketProtoWebSocketRequestMessageBuilder(verb: verb, path: path, requestID: requestID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> WebSocketProtoWebSocketRequestMessageBuilder {
|
||||||
|
let builder = WebSocketProtoWebSocketRequestMessageBuilder(verb: verb, path: path, requestID: requestID)
|
||||||
|
if let _value = body {
|
||||||
|
builder.setBody(_value)
|
||||||
|
}
|
||||||
|
builder.setHeaders(headers)
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class WebSocketProtoWebSocketRequestMessageBuilder: NSObject {
|
@objc public class WebSocketProtoWebSocketRequestMessageBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = WebSocketProtos_WebSocketRequestMessage()
|
private var proto = WebSocketProtos_WebSocketRequestMessage()
|
||||||
|
@ -165,6 +175,19 @@ extension WebSocketProtoWebSocketRequestMessage.WebSocketProtoWebSocketRequestMe
|
||||||
return WebSocketProtoWebSocketResponseMessageBuilder(requestID: requestID, status: status)
|
return WebSocketProtoWebSocketResponseMessageBuilder(requestID: requestID, status: status)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> WebSocketProtoWebSocketResponseMessageBuilder {
|
||||||
|
let builder = WebSocketProtoWebSocketResponseMessageBuilder(requestID: requestID, status: status)
|
||||||
|
if let _value = message {
|
||||||
|
builder.setMessage(_value)
|
||||||
|
}
|
||||||
|
builder.setHeaders(headers)
|
||||||
|
if let _value = body {
|
||||||
|
builder.setBody(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class WebSocketProtoWebSocketResponseMessageBuilder: NSObject {
|
@objc public class WebSocketProtoWebSocketResponseMessageBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = WebSocketProtos_WebSocketResponseMessage()
|
private var proto = WebSocketProtos_WebSocketResponseMessage()
|
||||||
|
@ -333,6 +356,18 @@ extension WebSocketProtoWebSocketResponseMessage.WebSocketProtoWebSocketResponse
|
||||||
return WebSocketProtoWebSocketMessageBuilder(type: type)
|
return WebSocketProtoWebSocketMessageBuilder(type: type)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||||
|
@objc public func asBuilder() -> WebSocketProtoWebSocketMessageBuilder {
|
||||||
|
let builder = WebSocketProtoWebSocketMessageBuilder(type: type)
|
||||||
|
if let _value = request {
|
||||||
|
builder.setRequest(_value)
|
||||||
|
}
|
||||||
|
if let _value = response {
|
||||||
|
builder.setResponse(_value)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
@objc public class WebSocketProtoWebSocketMessageBuilder: NSObject {
|
@objc public class WebSocketProtoWebSocketMessageBuilder: NSObject {
|
||||||
|
|
||||||
private var proto = WebSocketProtos_WebSocketMessage()
|
private var proto = WebSocketProtos_WebSocketMessage()
|
||||||
|
@ -400,12 +435,12 @@ extension WebSocketProtoWebSocketResponseMessage.WebSocketProtoWebSocketResponse
|
||||||
}
|
}
|
||||||
let type = WebSocketProtoWebSocketMessageTypeWrap(proto.type)
|
let type = WebSocketProtoWebSocketMessageTypeWrap(proto.type)
|
||||||
|
|
||||||
var request: WebSocketProtoWebSocketRequestMessage?
|
var request: WebSocketProtoWebSocketRequestMessage? = nil
|
||||||
if proto.hasRequest {
|
if proto.hasRequest {
|
||||||
request = try WebSocketProtoWebSocketRequestMessage.parseProto(proto.request)
|
request = try WebSocketProtoWebSocketRequestMessage.parseProto(proto.request)
|
||||||
}
|
}
|
||||||
|
|
||||||
var response: WebSocketProtoWebSocketResponseMessage?
|
var response: WebSocketProtoWebSocketResponseMessage? = nil
|
||||||
if proto.hasResponse {
|
if proto.hasResponse {
|
||||||
response = try WebSocketProtoWebSocketResponseMessage.parseProto(proto.response)
|
response = try WebSocketProtoWebSocketResponseMessage.parseProto(proto.response)
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,6 +112,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
+ (NSString *)messageManagerErrorCouldNotHandlePrekeyBundle;
|
+ (NSString *)messageManagerErrorCouldNotHandlePrekeyBundle;
|
||||||
|
|
||||||
|
+ (NSString *)messageManagerErrorCouldNotHandleUnidentifiedSenderMessage;
|
||||||
|
|
||||||
+ (NSString *)messageManagerErrorCouldNotHandleSecureMessage;
|
+ (NSString *)messageManagerErrorCouldNotHandleSecureMessage;
|
||||||
|
|
||||||
+ (NSString *)messageManagerErrorEnvelopeNoActionablePayload;
|
+ (NSString *)messageManagerErrorEnvelopeNoActionablePayload;
|
||||||
|
|
|
@ -247,6 +247,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
return @"message_manager_error_could_not_handle_prekey_bundle";
|
return @"message_manager_error_could_not_handle_prekey_bundle";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (NSString *)messageManagerErrorCouldNotHandleUnidentifiedSenderMessage
|
||||||
|
{
|
||||||
|
return @"message_manager_error_could_not_handle_unidentified_sender_message";
|
||||||
|
}
|
||||||
|
|
||||||
+ (NSString *)messageManagerErrorCouldNotHandleSecureMessage
|
+ (NSString *)messageManagerErrorCouldNotHandleSecureMessage
|
||||||
{
|
{
|
||||||
return @"message_manager_error_could_not_handle_secure_message";
|
return @"message_manager_error_could_not_handle_secure_message";
|
||||||
|
|
Loading…
Reference in New Issue