Respond to CR.
This commit is contained in:
parent
632dc145fd
commit
03a9b21cfd
|
@ -302,6 +302,7 @@ import Foundation
|
|||
writer.extend(('''
|
||||
public enum %s: Error {
|
||||
case invalidProtobuf(description: String)
|
||||
case unsafeProtobuf(description: String)
|
||||
}
|
||||
''' % writer.invalid_protobuf_error_name).strip())
|
||||
writer.newline()
|
||||
|
@ -493,8 +494,14 @@ class MessageContext(BaseContext):
|
|||
|
||||
# serializedDataIgnoringErrors() func
|
||||
writer.add('// NOTE: This method is intended for debugging purposes only.')
|
||||
writer.add('@objc public func serializedDataIgnoringErrors() -> Data {')
|
||||
writer.add('@objc public func serializedDataIgnoringErrors() -> Data? {')
|
||||
writer.push_indent()
|
||||
writer.add('guard _isDebugAssertConfiguration() else {')
|
||||
writer.push_indent()
|
||||
writer.add('return nil')
|
||||
writer.pop_indent()
|
||||
writer.add('}')
|
||||
writer.newline()
|
||||
writer.add('return try! self.serializedData()')
|
||||
writer.pop_indent()
|
||||
writer.add('}')
|
||||
|
@ -701,8 +708,14 @@ public func serializedData() throws -> Data {
|
|||
|
||||
# buildIgnoringErrors() func
|
||||
writer.add('// NOTE: This method is intended for debugging purposes only.')
|
||||
writer.add('@objc public func buildIgnoringErrors() -> %s {' % self.swift_name)
|
||||
writer.add('@objc public func buildIgnoringErrors() -> %s? {' % self.swift_name)
|
||||
writer.push_indent()
|
||||
writer.add('guard _isDebugAssertConfiguration() else {')
|
||||
writer.push_indent()
|
||||
writer.add('return nil')
|
||||
writer.pop_indent()
|
||||
writer.add('}')
|
||||
writer.newline()
|
||||
writer.add('return try! self.build()')
|
||||
writer.pop_indent()
|
||||
writer.add('}')
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
shift-base:CodedInputStream.m
|
||||
# generated protos
|
||||
bool:WebSocketResources.pb.m
|
||||
bool:SSKProto.pb.m
|
||||
bool:WhisperTextProtocol.pb.m
|
||||
bool:OWSWebRTCDataProtos.pb.m
|
||||
bool:OWSSignaliOSProtos.pb.m
|
||||
|
|
|
@ -21,12 +21,12 @@ class SSKProtoEnvelopeTest: XCTestCase {
|
|||
|
||||
func testParse_EmptyData() {
|
||||
let data = Data()
|
||||
XCTAssertThrowsError(try SSKProtoEnvelope(serializedData: data))
|
||||
XCTAssertThrowsError(try SSKProtoEnvelope.parseData(data))
|
||||
}
|
||||
|
||||
func testParse_UnparseableData() {
|
||||
let data = "asdf".data(using: .utf8)!
|
||||
XCTAssertThrowsError(try SSKProtoEnvelope(serializedData: data)) { error in
|
||||
XCTAssertThrowsError(try SSKProtoEnvelope.parseData(data)) { error in
|
||||
XCTAssert(error is SwiftProtobuf.BinaryDecodingError)
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ class SSKProtoEnvelopeTest: XCTestCase {
|
|||
let encodedData = "CAESDCsxNTU1MTIzMTIzNCjKm4WazSw4AQ=="
|
||||
let data = Data(base64Encoded: encodedData)!
|
||||
|
||||
XCTAssertNoThrow(try SSKProtoEnvelope(serializedData: data))
|
||||
XCTAssertNoThrow(try SSKProtoEnvelope.parseData(data))
|
||||
}
|
||||
|
||||
func testParse_invalidData() {
|
||||
|
@ -56,9 +56,9 @@ class SSKProtoEnvelopeTest: XCTestCase {
|
|||
let encodedData = "EgwrMTU1NTEyMzEyMzQojdmOms0sOAE="
|
||||
let data = Data(base64Encoded: encodedData)!
|
||||
|
||||
XCTAssertThrowsError(try SSKProtoEnvelope(serializedData: data)) { (error) -> Void in
|
||||
XCTAssertThrowsError(try SSKProtoEnvelope.parseData(data)) { (error) -> Void in
|
||||
switch error {
|
||||
case SSKProtoEnvelope.EnvelopeError.invalidProtobuf:
|
||||
case SSKProtoError.invalidProtobuf:
|
||||
break
|
||||
default:
|
||||
XCTFail("unexpected error: \(error)")
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
|
||||
OWSAssert([[NSFileManager defaultManager] fileExistsAtPath:filePath]);
|
||||
|
||||
DataSource *dataSource = [DataSourcePath dataSourceWithFilePath:filePath];
|
||||
DataSource *dataSource = [DataSourcePath dataSourceWithFilePath:filePath shouldDeleteOnDeallocation:NO];
|
||||
TSAttachmentStream *attachment = [[TSAttachmentStream alloc] initWithContentType:mimeType
|
||||
byteCount:(UInt32)dataSource.dataLength
|
||||
sourceFilename:nil];
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SSKProto.pb.h"
|
||||
#import <SignalServiceKit/CDSSigningCertificate.h>
|
||||
#import <SignalServiceKit/NSData+Base64.h>
|
||||
#import <SignalServiceKit/NSData+OWS.h>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SSKProto.pb.h"
|
||||
#import <SignalServiceKit/SignalServiceKit-Swift.h>
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
@interface ProtoParsingTest : XCTestCase
|
||||
|
@ -13,29 +13,22 @@
|
|||
|
||||
@implementation ProtoParsingTest
|
||||
|
||||
- (void)testProtoParsing_nil
|
||||
{
|
||||
SSKProtoEnvelope *_Nullable envelope = [SSKProtoEnvelope parseFromData:nil];
|
||||
XCTAssertNotNil(envelope);
|
||||
}
|
||||
|
||||
- (void)testProtoParsing_empty
|
||||
{
|
||||
NSData *data = [NSData new];
|
||||
SSKProtoEnvelope *_Nullable envelope = [SSKProtoEnvelope parseFromData:data];
|
||||
XCTAssertNotNil(envelope);
|
||||
NSError *error;
|
||||
SSKProtoEnvelope *_Nullable envelope = [SSKProtoEnvelope parseData:data error:&error];
|
||||
XCTAssertNil(envelope);
|
||||
XCTAssertNotNil(error);
|
||||
}
|
||||
|
||||
- (void)testProtoParsing_wrong1
|
||||
{
|
||||
@try {
|
||||
NSData *data = [@"test" dataUsingEncoding:NSUTF8StringEncoding];
|
||||
[SSKProtoEnvelope parseFromData:data];
|
||||
XCTFail(@"Missing expected exception");
|
||||
} @catch (NSException *exception) {
|
||||
// Exception is expected.
|
||||
NSLog(@"Caught expected exception: %@", [exception class]);
|
||||
}
|
||||
NSData *data = [@"test" dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSError *error;
|
||||
SSKProtoEnvelope *_Nullable envelope = [SSKProtoEnvelope parseData:data error:&error];
|
||||
XCTAssertNil(envelope);
|
||||
XCTAssertNotNil(error);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -39,12 +39,12 @@ disappearingMessagesConfiguration:(nullable OWSDisappearingMessagesConfiguration
|
|||
#endif
|
||||
|
||||
if (recipientIdentity != nil) {
|
||||
SSKProtoVerified *_Nullable verified = BuildVerifiedProto(recipientIdentity.recipientId,
|
||||
SSKProtoVerified *_Nullable verified = BuildVerifiedProtoWithRecipientId(recipientIdentity.recipientId,
|
||||
[recipientIdentity.identityKey prependKeyType],
|
||||
recipientIdentity.verificationState,
|
||||
0);
|
||||
if (!verified) {
|
||||
OWSFail(@"%@ could not build protobuf.", self.logTag);
|
||||
DDLogError(@"%@ could not build protobuf.", self.logTag);
|
||||
return;
|
||||
}
|
||||
contactBuilder.verified = verified;
|
||||
|
@ -63,7 +63,7 @@ disappearingMessagesConfiguration:(nullable OWSDisappearingMessagesConfiguration
|
|||
NSError *error;
|
||||
SSKProtoContactDetailsAvatar *_Nullable avatar = [avatarBuilder buildAndReturnError:&error];
|
||||
if (error || !avatar) {
|
||||
OWSFail(@"%@ could not build protobuf: %@", self.logTag, error);
|
||||
DDLogError(@"%@ could not build protobuf: %@", self.logTag, error);
|
||||
return;
|
||||
}
|
||||
[contactBuilder setAvatar:avatar];
|
||||
|
|
|
@ -70,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
// verification sync which is ~1-512 bytes larger then that.
|
||||
OWSAssert(self.paddingBytesLength != 0);
|
||||
|
||||
SSKProtoVerified *_Nullable verifiedProto = BuildVerifiedProto(
|
||||
SSKProtoVerified *_Nullable verifiedProto = BuildVerifiedProtoWithRecipientId(
|
||||
self.verificationForRecipientId, self.identityKey, self.verificationState, self.paddingBytesLength);
|
||||
if (!verifiedProto) {
|
||||
OWSFail(@"%@ could not build protobuf.", self.logTag);
|
||||
|
@ -91,8 +91,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
// will figure that out on it's own.
|
||||
OWSAssert(self.verificationState != OWSVerificationStateNoLongerVerified);
|
||||
|
||||
SSKProtoVerified *_Nullable verifiedProto
|
||||
= BuildVerifiedProto(self.verificationForRecipientId, self.identityKey, self.verificationState, 0);
|
||||
SSKProtoVerified *_Nullable verifiedProto = BuildVerifiedProtoWithRecipientId(
|
||||
self.verificationForRecipientId, self.identityKey, self.verificationState, 0);
|
||||
if (!verifiedProto) {
|
||||
OWSFail(@"%@ could not build protobuf.", self.logTag);
|
||||
return 0;
|
||||
|
|
|
@ -8,6 +8,7 @@ import Foundation
|
|||
|
||||
public enum FingerprintProtoError: Error {
|
||||
case invalidProtobuf(description: String)
|
||||
case unsafeProtobuf(description: String)
|
||||
}
|
||||
|
||||
// MARK: - FingerprintProtoLogicalFingerprint
|
||||
|
@ -26,6 +27,15 @@ public enum FingerprintProtoError: Error {
|
|||
proto.identityData = valueParam
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> FingerprintProtoLogicalFingerprint? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
@objc public func build() throws -> FingerprintProtoLogicalFingerprint {
|
||||
let wrapper = try FingerprintProtoLogicalFingerprint.parseProto(proto)
|
||||
return wrapper
|
||||
|
@ -42,6 +52,15 @@ public enum FingerprintProtoError: Error {
|
|||
self.identityData = identityData
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
@objc
|
||||
public func serializedData() throws -> Data {
|
||||
return try self.proto.serializedData()
|
||||
|
@ -92,6 +111,15 @@ public enum FingerprintProtoError: Error {
|
|||
proto.remoteFingerprint = valueParam.proto
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> FingerprintProtoLogicalFingerprints? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
@objc public func build() throws -> FingerprintProtoLogicalFingerprints {
|
||||
let wrapper = try FingerprintProtoLogicalFingerprints.parseProto(proto)
|
||||
return wrapper
|
||||
|
@ -101,7 +129,9 @@ public enum FingerprintProtoError: Error {
|
|||
fileprivate let proto: FingerprintProtos_LogicalFingerprints
|
||||
|
||||
@objc public let version: UInt32
|
||||
|
||||
@objc public let localFingerprint: FingerprintProtoLogicalFingerprint
|
||||
|
||||
@objc public let remoteFingerprint: FingerprintProtoLogicalFingerprint
|
||||
|
||||
private init(proto: FingerprintProtos_LogicalFingerprints,
|
||||
|
@ -114,6 +144,15 @@ public enum FingerprintProtoError: Error {
|
|||
self.remoteFingerprint = remoteFingerprint
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
@objc
|
||||
public func serializedData() throws -> Data {
|
||||
return try self.proto.serializedData()
|
||||
|
|
|
@ -8,6 +8,7 @@ import Foundation
|
|||
|
||||
public enum ProvisioningProtoError: Error {
|
||||
case invalidProtobuf(description: String)
|
||||
case unsafeProtobuf(description: String)
|
||||
}
|
||||
|
||||
// MARK: - ProvisioningProtoProvisionEnvelope
|
||||
|
@ -30,6 +31,15 @@ public enum ProvisioningProtoError: Error {
|
|||
proto.body = valueParam
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> ProvisioningProtoProvisionEnvelope? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
@objc public func build() throws -> ProvisioningProtoProvisionEnvelope {
|
||||
let wrapper = try ProvisioningProtoProvisionEnvelope.parseProto(proto)
|
||||
return wrapper
|
||||
|
@ -39,6 +49,7 @@ public enum ProvisioningProtoError: Error {
|
|||
fileprivate let proto: ProvisioningProtos_ProvisionEnvelope
|
||||
|
||||
@objc public let publicKey: Data
|
||||
|
||||
@objc public let body: Data
|
||||
|
||||
private init(proto: ProvisioningProtos_ProvisionEnvelope,
|
||||
|
@ -49,6 +60,15 @@ public enum ProvisioningProtoError: Error {
|
|||
self.body = body
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
@objc
|
||||
public func serializedData() throws -> Data {
|
||||
return try self.proto.serializedData()
|
||||
|
@ -121,6 +141,15 @@ public enum ProvisioningProtoError: Error {
|
|||
proto.readReceipts = valueParam
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> ProvisioningProtoProvisionMessage? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
@objc public func build() throws -> ProvisioningProtoProvisionMessage {
|
||||
let wrapper = try ProvisioningProtoProvisionMessage.parseProto(proto)
|
||||
return wrapper
|
||||
|
@ -130,11 +159,17 @@ public enum ProvisioningProtoError: Error {
|
|||
fileprivate let proto: ProvisioningProtos_ProvisionMessage
|
||||
|
||||
@objc public let identityKeyPublic: Data
|
||||
|
||||
@objc public let identityKeyPrivate: Data
|
||||
|
||||
@objc public let number: String
|
||||
|
||||
@objc public let provisioningCode: String
|
||||
|
||||
@objc public let userAgent: String
|
||||
|
||||
@objc public let profileKey: Data
|
||||
|
||||
@objc public let readReceipts: Bool
|
||||
|
||||
private init(proto: ProvisioningProtos_ProvisionMessage,
|
||||
|
@ -155,6 +190,15 @@ public enum ProvisioningProtoError: Error {
|
|||
self.readReceipts = readReceipts
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
@objc
|
||||
public func serializedData() throws -> Data {
|
||||
return try self.proto.serializedData()
|
||||
|
|
|
@ -8,6 +8,7 @@ import Foundation
|
|||
|
||||
public enum SSKProtoError: Error {
|
||||
case invalidProtobuf(description: String)
|
||||
case unsafeProtobuf(description: String)
|
||||
}
|
||||
|
||||
// MARK: - SSKProtoEnvelope
|
||||
|
@ -81,7 +82,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoEnvelope {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoEnvelope? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -144,7 +149,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -225,7 +234,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoContent {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoContent? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -277,7 +290,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -352,7 +369,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoCallMessageOffer {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoCallMessageOffer? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -377,7 +398,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -434,7 +459,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoCallMessageAnswer {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoCallMessageAnswer? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -459,7 +488,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -524,7 +557,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoCallMessageIceUpdate {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoCallMessageIceUpdate? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -557,7 +594,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -622,7 +663,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoCallMessageBusy {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoCallMessageBusy? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -643,7 +688,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -690,7 +739,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoCallMessageHangup {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoCallMessageHangup? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -711,7 +764,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -788,7 +845,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoCallMessage {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoCallMessage? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -847,7 +908,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -949,7 +1014,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageQuoteQuotedAttachment {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageQuoteQuotedAttachment? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -1000,7 +1069,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -1069,7 +1142,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageQuote {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageQuote? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -1108,7 +1185,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -1188,7 +1269,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageContactName {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageContactName? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -1265,7 +1350,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -1341,7 +1430,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageContactPhone {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageContactPhone? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -1385,7 +1478,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -1461,7 +1558,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageContactEmail {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageContactEmail? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -1505,7 +1606,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -1602,7 +1707,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageContactPostalAddress {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageContactPostalAddress? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -1706,7 +1815,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -1751,7 +1864,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageContactAvatar {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageContactAvatar? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -1782,7 +1899,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -1879,7 +2000,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageContact {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessageContact? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -1932,7 +2057,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -2082,7 +2211,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessage {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoDataMessage? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -2162,7 +2295,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -2229,7 +2366,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoNullMessage {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoNullMessage? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -2256,7 +2397,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -2332,7 +2477,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoReceiptMessage {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoReceiptMessage? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -2357,7 +2506,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -2440,7 +2593,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoVerified {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoVerified? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -2488,7 +2645,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -2547,7 +2708,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageSent {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageSent? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -2595,7 +2760,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -2646,7 +2815,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageContacts {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageContacts? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -2674,7 +2847,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -2721,7 +2898,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageGroups {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageGroups? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -2745,7 +2926,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -2802,7 +2987,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageBlocked {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageBlocked? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -2823,7 +3012,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -2894,7 +3087,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageRequest {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageRequest? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -2915,7 +3112,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -2966,7 +3167,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageRead {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageRead? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -2991,7 +3196,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -3044,7 +3253,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageConfiguration {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageConfiguration? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -3068,7 +3281,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -3151,7 +3368,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessage {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessage? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -3231,7 +3452,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -3375,7 +3600,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoAttachmentPointer {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoAttachmentPointer? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -3474,7 +3703,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -3577,7 +3810,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoGroupContext {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoGroupContext? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -3623,7 +3860,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -3686,7 +3927,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoContactDetailsAvatar {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoContactDetailsAvatar? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -3720,7 +3965,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -3789,7 +4038,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoContactDetails {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoContactDetails? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -3868,7 +4121,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -3931,7 +4188,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoGroupDetailsAvatar {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoGroupDetailsAvatar? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -3965,7 +4226,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
@ -4040,7 +4305,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoGroupDetails {
|
||||
@objc public func buildIgnoringErrors() -> SSKProtoGroupDetails? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
|
@ -4106,7 +4375,11 @@ public enum SSKProtoError: Error {
|
|||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import Foundation
|
|||
|
||||
public enum SignalIOSProtoError: Error {
|
||||
case invalidProtobuf(description: String)
|
||||
case unsafeProtobuf(description: String)
|
||||
}
|
||||
|
||||
// MARK: - SignalIOSProtoBackupSnapshotBackupEntity
|
||||
|
@ -60,6 +61,15 @@ public enum SignalIOSProtoError: Error {
|
|||
proto.entityData = valueParam
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SignalIOSProtoBackupSnapshotBackupEntity? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
@objc public func build() throws -> SignalIOSProtoBackupSnapshotBackupEntity {
|
||||
let wrapper = try SignalIOSProtoBackupSnapshotBackupEntity.parseProto(proto)
|
||||
return wrapper
|
||||
|
@ -69,6 +79,7 @@ public enum SignalIOSProtoError: Error {
|
|||
fileprivate let proto: IOSProtos_BackupSnapshot.BackupEntity
|
||||
|
||||
@objc public let type: SignalIOSProtoBackupSnapshotBackupEntityType
|
||||
|
||||
@objc public let entityData: Data
|
||||
|
||||
private init(proto: IOSProtos_BackupSnapshot.BackupEntity,
|
||||
|
@ -79,6 +90,15 @@ public enum SignalIOSProtoError: Error {
|
|||
self.entityData = entityData
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
@objc
|
||||
public func serializedData() throws -> Data {
|
||||
return try self.proto.serializedData()
|
||||
|
@ -129,6 +149,23 @@ public enum SignalIOSProtoError: Error {
|
|||
proto.entity = items
|
||||
}
|
||||
|
||||
@objc public func setEntity(_ wrappedItems: [SignalIOSProtoBackupSnapshotBackupEntity]) {
|
||||
var unwrappedItems = [IOSProtos_BackupSnapshot.BackupEntity]()
|
||||
for wrappedItem in wrappedItems {
|
||||
unwrappedItems.append(wrappedItem.proto)
|
||||
}
|
||||
proto.entity = unwrappedItems
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> SignalIOSProtoBackupSnapshot? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
@objc public func build() throws -> SignalIOSProtoBackupSnapshot {
|
||||
let wrapper = try SignalIOSProtoBackupSnapshot.parseProto(proto)
|
||||
return wrapper
|
||||
|
@ -145,6 +182,15 @@ public enum SignalIOSProtoError: Error {
|
|||
self.entity = entity
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
@objc
|
||||
public func serializedData() throws -> Data {
|
||||
return try self.proto.serializedData()
|
||||
|
|
|
@ -8,6 +8,7 @@ import Foundation
|
|||
|
||||
public enum WebSocketProtoError: Error {
|
||||
case invalidProtobuf(description: String)
|
||||
case unsafeProtobuf(description: String)
|
||||
}
|
||||
|
||||
// MARK: - WebSocketProtoWebSocketRequestMessage
|
||||
|
@ -40,10 +41,27 @@ public enum WebSocketProtoError: Error {
|
|||
proto.headers = items
|
||||
}
|
||||
|
||||
@objc public func setHeaders(_ wrappedItems: [String]) {
|
||||
var unwrappedItems = [String]()
|
||||
for wrappedItem in wrappedItems {
|
||||
unwrappedItems.append(wrappedItem)
|
||||
}
|
||||
proto.headers = unwrappedItems
|
||||
}
|
||||
|
||||
@objc public func setRequestID(_ valueParam: UInt64) {
|
||||
proto.requestID = valueParam
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> WebSocketProtoWebSocketRequestMessage? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
@objc public func build() throws -> WebSocketProtoWebSocketRequestMessage {
|
||||
let wrapper = try WebSocketProtoWebSocketRequestMessage.parseProto(proto)
|
||||
return wrapper
|
||||
|
@ -53,7 +71,9 @@ public enum WebSocketProtoError: Error {
|
|||
fileprivate let proto: WebSocketProtos_WebSocketRequestMessage
|
||||
|
||||
@objc public let verb: String
|
||||
|
||||
@objc public let path: String
|
||||
|
||||
@objc public let requestID: UInt64
|
||||
|
||||
@objc public var body: Data? {
|
||||
|
@ -80,6 +100,15 @@ public enum WebSocketProtoError: Error {
|
|||
self.requestID = requestID
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
@objc
|
||||
public func serializedData() throws -> Data {
|
||||
return try self.proto.serializedData()
|
||||
|
@ -148,10 +177,27 @@ public enum WebSocketProtoError: Error {
|
|||
proto.headers = items
|
||||
}
|
||||
|
||||
@objc public func setHeaders(_ wrappedItems: [String]) {
|
||||
var unwrappedItems = [String]()
|
||||
for wrappedItem in wrappedItems {
|
||||
unwrappedItems.append(wrappedItem)
|
||||
}
|
||||
proto.headers = unwrappedItems
|
||||
}
|
||||
|
||||
@objc public func setBody(_ valueParam: Data) {
|
||||
proto.body = valueParam
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> WebSocketProtoWebSocketResponseMessage? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
@objc public func build() throws -> WebSocketProtoWebSocketResponseMessage {
|
||||
let wrapper = try WebSocketProtoWebSocketResponseMessage.parseProto(proto)
|
||||
return wrapper
|
||||
|
@ -161,7 +207,9 @@ public enum WebSocketProtoError: Error {
|
|||
fileprivate let proto: WebSocketProtos_WebSocketResponseMessage
|
||||
|
||||
@objc public let requestID: UInt64
|
||||
|
||||
@objc public let status: UInt32
|
||||
|
||||
@objc public let body: Data
|
||||
|
||||
@objc public var message: String? {
|
||||
|
@ -188,6 +236,15 @@ public enum WebSocketProtoError: Error {
|
|||
self.body = body
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
@objc
|
||||
public func serializedData() throws -> Data {
|
||||
return try self.proto.serializedData()
|
||||
|
@ -274,6 +331,15 @@ public enum WebSocketProtoError: Error {
|
|||
proto.response = valueParam.proto
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func buildIgnoringErrors() -> WebSocketProtoWebSocketMessage? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.build()
|
||||
}
|
||||
|
||||
@objc public func build() throws -> WebSocketProtoWebSocketMessage {
|
||||
let wrapper = try WebSocketProtoWebSocketMessage.parseProto(proto)
|
||||
return wrapper
|
||||
|
@ -283,8 +349,16 @@ public enum WebSocketProtoError: Error {
|
|||
fileprivate let proto: WebSocketProtos_WebSocketMessage
|
||||
|
||||
@objc public let type: WebSocketProtoWebSocketMessageType
|
||||
|
||||
@objc public let request: WebSocketProtoWebSocketRequestMessage?
|
||||
@objc public var hasRequest: Bool {
|
||||
return proto.hasRequest
|
||||
}
|
||||
|
||||
@objc public let response: WebSocketProtoWebSocketResponseMessage?
|
||||
@objc public var hasResponse: Bool {
|
||||
return proto.hasResponse
|
||||
}
|
||||
|
||||
private init(proto: WebSocketProtos_WebSocketMessage,
|
||||
type: WebSocketProtoWebSocketMessageType,
|
||||
|
@ -296,6 +370,15 @@ public enum WebSocketProtoError: Error {
|
|||
self.response = response
|
||||
}
|
||||
|
||||
// NOTE: This method is intended for debugging purposes only.
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
guard _isDebugAssertConfiguration() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return try! self.serializedData()
|
||||
}
|
||||
|
||||
@objc
|
||||
public func serializedData() throws -> Data {
|
||||
return try self.proto.serializedData()
|
||||
|
|
|
@ -15,7 +15,7 @@ typedef NS_ENUM(NSUInteger, OWSVerificationState) {
|
|||
@class SSKProtoVerified;
|
||||
|
||||
NSString *OWSVerificationStateToString(OWSVerificationState verificationState);
|
||||
SSKProtoVerified *_Nullable BuildVerifiedProto(NSString *destinationRecipientId,
|
||||
SSKProtoVerified *_Nullable BuildVerifiedProtoWithRecipientId(NSString *destinationRecipientId,
|
||||
NSData *identityKey,
|
||||
OWSVerificationState verificationState,
|
||||
NSUInteger paddingBytesLength);
|
||||
|
|
|
@ -36,7 +36,7 @@ SSKProtoVerifiedState OWSVerificationStateToProtoState(OWSVerificationState veri
|
|||
}
|
||||
}
|
||||
|
||||
SSKProtoVerified *_Nullable BuildVerifiedProto(NSString *destinationRecipientId,
|
||||
SSKProtoVerified *_Nullable BuildVerifiedProtoWithRecipientId(NSString *destinationRecipientId,
|
||||
NSData *identityKey,
|
||||
OWSVerificationState verificationState,
|
||||
NSUInteger paddingBytesLength)
|
||||
|
@ -64,7 +64,7 @@ SSKProtoVerified *_Nullable BuildVerifiedProto(NSString *destinationRecipientId,
|
|||
NSError *error;
|
||||
SSKProtoVerified *_Nullable verifiedProto = [verifiedBuilder buildAndReturnError:&error];
|
||||
if (error || !verifiedProto) {
|
||||
OWSCFail(@"%@ could not build protobuf: %@", @"[BuildVerifiedProto]", error);
|
||||
OWSCFail(@"%@ could not build protobuf: %@", @"[BuildVerifiedProtoWithRecipientId]", error);
|
||||
return nil;
|
||||
}
|
||||
return verifiedProto;
|
||||
|
|
Loading…
Reference in New Issue