Match Android protobuf layout

pull/56/head
Niels Andriesse 6 years ago
parent 202a28e64a
commit 306e9cf346

@ -89,8 +89,8 @@ message LokiAddressMessage { // Loki
message LokiDeviceLinkMessage { // Loki
optional string masterHexEncodedPublicKey = 1;
optional string slaveHexEncodedPublicKey = 2;
optional bytes masterSignature = 3;
optional bytes slaveSignature = 4;
optional bytes slaveSignature = 3;
optional bytes masterSignature = 4;
}
message CallMessage {

@ -979,12 +979,12 @@ extension SSKProtoLokiAddressMessage.SSKProtoLokiAddressMessageBuilder {
if let _value = slaveHexEncodedPublicKey {
builder.setSlaveHexEncodedPublicKey(_value)
}
if let _value = masterSignature {
builder.setMasterSignature(_value)
}
if let _value = slaveSignature {
builder.setSlaveSignature(_value)
}
if let _value = masterSignature {
builder.setMasterSignature(_value)
}
return builder
}
@ -1002,14 +1002,14 @@ extension SSKProtoLokiAddressMessage.SSKProtoLokiAddressMessageBuilder {
proto.slaveHexEncodedPublicKey = valueParam
}
@objc public func setMasterSignature(_ valueParam: Data) {
proto.masterSignature = valueParam
}
@objc public func setSlaveSignature(_ valueParam: Data) {
proto.slaveSignature = valueParam
}
@objc public func setMasterSignature(_ valueParam: Data) {
proto.masterSignature = valueParam
}
@objc public func build() throws -> SSKProtoLokiDeviceLinkMessage {
return try SSKProtoLokiDeviceLinkMessage.parseProto(proto)
}
@ -1041,16 +1041,6 @@ extension SSKProtoLokiAddressMessage.SSKProtoLokiAddressMessageBuilder {
return proto.hasSlaveHexEncodedPublicKey
}
@objc public var masterSignature: Data? {
guard proto.hasMasterSignature else {
return nil
}
return proto.masterSignature
}
@objc public var hasMasterSignature: Bool {
return proto.hasMasterSignature
}
@objc public var slaveSignature: Data? {
guard proto.hasSlaveSignature else {
return nil
@ -1061,6 +1051,16 @@ extension SSKProtoLokiAddressMessage.SSKProtoLokiAddressMessageBuilder {
return proto.hasSlaveSignature
}
@objc public var masterSignature: Data? {
guard proto.hasMasterSignature else {
return nil
}
return proto.masterSignature
}
@objc public var hasMasterSignature: Bool {
return proto.hasMasterSignature
}
private init(proto: SignalServiceProtos_LokiDeviceLinkMessage) {
self.proto = proto
}

@ -510,15 +510,6 @@ struct SignalServiceProtos_LokiDeviceLinkMessage {
/// Clears the value of `slaveHexEncodedPublicKey`. Subsequent reads from it will return its default value.
mutating func clearSlaveHexEncodedPublicKey() {self._slaveHexEncodedPublicKey = nil}
var masterSignature: Data {
get {return _masterSignature ?? SwiftProtobuf.Internal.emptyData}
set {_masterSignature = newValue}
}
/// Returns true if `masterSignature` has been explicitly set.
var hasMasterSignature: Bool {return self._masterSignature != nil}
/// Clears the value of `masterSignature`. Subsequent reads from it will return its default value.
mutating func clearMasterSignature() {self._masterSignature = nil}
var slaveSignature: Data {
get {return _slaveSignature ?? SwiftProtobuf.Internal.emptyData}
set {_slaveSignature = newValue}
@ -528,14 +519,23 @@ struct SignalServiceProtos_LokiDeviceLinkMessage {
/// Clears the value of `slaveSignature`. Subsequent reads from it will return its default value.
mutating func clearSlaveSignature() {self._slaveSignature = nil}
var masterSignature: Data {
get {return _masterSignature ?? SwiftProtobuf.Internal.emptyData}
set {_masterSignature = newValue}
}
/// Returns true if `masterSignature` has been explicitly set.
var hasMasterSignature: Bool {return self._masterSignature != nil}
/// Clears the value of `masterSignature`. Subsequent reads from it will return its default value.
mutating func clearMasterSignature() {self._masterSignature = nil}
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
fileprivate var _masterHexEncodedPublicKey: String? = nil
fileprivate var _slaveHexEncodedPublicKey: String? = nil
fileprivate var _masterSignature: Data? = nil
fileprivate var _slaveSignature: Data? = nil
fileprivate var _masterSignature: Data? = nil
}
struct SignalServiceProtos_CallMessage {
@ -2983,8 +2983,8 @@ extension SignalServiceProtos_LokiDeviceLinkMessage: SwiftProtobuf.Message, Swif
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "masterHexEncodedPublicKey"),
2: .same(proto: "slaveHexEncodedPublicKey"),
3: .same(proto: "masterSignature"),
4: .same(proto: "slaveSignature"),
3: .same(proto: "slaveSignature"),
4: .same(proto: "masterSignature"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
@ -2992,8 +2992,8 @@ extension SignalServiceProtos_LokiDeviceLinkMessage: SwiftProtobuf.Message, Swif
switch fieldNumber {
case 1: try decoder.decodeSingularStringField(value: &self._masterHexEncodedPublicKey)
case 2: try decoder.decodeSingularStringField(value: &self._slaveHexEncodedPublicKey)
case 3: try decoder.decodeSingularBytesField(value: &self._masterSignature)
case 4: try decoder.decodeSingularBytesField(value: &self._slaveSignature)
case 3: try decoder.decodeSingularBytesField(value: &self._slaveSignature)
case 4: try decoder.decodeSingularBytesField(value: &self._masterSignature)
default: break
}
}
@ -3006,10 +3006,10 @@ extension SignalServiceProtos_LokiDeviceLinkMessage: SwiftProtobuf.Message, Swif
if let v = self._slaveHexEncodedPublicKey {
try visitor.visitSingularStringField(value: v, fieldNumber: 2)
}
if let v = self._masterSignature {
if let v = self._slaveSignature {
try visitor.visitSingularBytesField(value: v, fieldNumber: 3)
}
if let v = self._slaveSignature {
if let v = self._masterSignature {
try visitor.visitSingularBytesField(value: v, fieldNumber: 4)
}
try unknownFields.traverse(visitor: &visitor)
@ -3018,8 +3018,8 @@ extension SignalServiceProtos_LokiDeviceLinkMessage: SwiftProtobuf.Message, Swif
static func ==(lhs: SignalServiceProtos_LokiDeviceLinkMessage, rhs: SignalServiceProtos_LokiDeviceLinkMessage) -> Bool {
if lhs._masterHexEncodedPublicKey != rhs._masterHexEncodedPublicKey {return false}
if lhs._slaveHexEncodedPublicKey != rhs._slaveHexEncodedPublicKey {return false}
if lhs._masterSignature != rhs._masterSignature {return false}
if lhs._slaveSignature != rhs._slaveSignature {return false}
if lhs._masterSignature != rhs._masterSignature {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}

Loading…
Cancel
Save