Add 'sent update' transcripts to proto schema.

pull/2/head
Matthew Chen 6 years ago
parent 907159f3f4
commit b53243da31

@ -272,7 +272,9 @@ message SyncMessage {
optional string destination = 1;
optional bool unidentified = 2;
}
optional string destination = 1;
// @required
optional bytes groupId = 1;
// @required
optional uint64 timestamp = 2;
repeated UnidentifiedDeliveryStatus unidentifiedStatus = 3;
}

@ -3848,19 +3848,13 @@ extension SSKProtoSyncMessageSentUpdateUnidentifiedDeliveryStatus.SSKProtoSyncMe
// MARK: - SSKProtoSyncMessageSentUpdateBuilder
@objc public class func builder() -> SSKProtoSyncMessageSentUpdateBuilder {
return SSKProtoSyncMessageSentUpdateBuilder()
@objc public class func builder(groupID: Data, timestamp: UInt64) -> SSKProtoSyncMessageSentUpdateBuilder {
return SSKProtoSyncMessageSentUpdateBuilder(groupID: groupID, timestamp: timestamp)
}
// asBuilder() constructs a builder that reflects the proto's contents.
@objc public func asBuilder() -> SSKProtoSyncMessageSentUpdateBuilder {
let builder = SSKProtoSyncMessageSentUpdateBuilder()
if let _value = destination {
builder.setDestination(_value)
}
if hasTimestamp {
builder.setTimestamp(timestamp)
}
let builder = SSKProtoSyncMessageSentUpdateBuilder(groupID: groupID, timestamp: timestamp)
builder.setUnidentifiedStatus(unidentifiedStatus)
return builder
}
@ -3871,8 +3865,15 @@ extension SSKProtoSyncMessageSentUpdateUnidentifiedDeliveryStatus.SSKProtoSyncMe
@objc fileprivate override init() {}
@objc public func setDestination(_ valueParam: String) {
proto.destination = valueParam
@objc fileprivate init(groupID: Data, timestamp: UInt64) {
super.init()
setGroupID(groupID)
setTimestamp(timestamp)
}
@objc public func setGroupID(_ valueParam: Data) {
proto.groupID = valueParam
}
@objc public func setTimestamp(_ valueParam: UInt64) {
@ -3900,28 +3901,19 @@ extension SSKProtoSyncMessageSentUpdateUnidentifiedDeliveryStatus.SSKProtoSyncMe
fileprivate let proto: SignalServiceProtos_SyncMessage.SentUpdate
@objc public let unidentifiedStatus: [SSKProtoSyncMessageSentUpdateUnidentifiedDeliveryStatus]
@objc public let groupID: Data
@objc public var destination: String? {
guard proto.hasDestination else {
return nil
}
return proto.destination
}
@objc public var hasDestination: Bool {
return proto.hasDestination
}
@objc public let timestamp: UInt64
@objc public var timestamp: UInt64 {
return proto.timestamp
}
@objc public var hasTimestamp: Bool {
return proto.hasTimestamp
}
@objc public let unidentifiedStatus: [SSKProtoSyncMessageSentUpdateUnidentifiedDeliveryStatus]
private init(proto: SignalServiceProtos_SyncMessage.SentUpdate,
groupID: Data,
timestamp: UInt64,
unidentifiedStatus: [SSKProtoSyncMessageSentUpdateUnidentifiedDeliveryStatus]) {
self.proto = proto
self.groupID = groupID
self.timestamp = timestamp
self.unidentifiedStatus = unidentifiedStatus
}
@ -3936,6 +3928,16 @@ extension SSKProtoSyncMessageSentUpdateUnidentifiedDeliveryStatus.SSKProtoSyncMe
}
fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage.SentUpdate) throws -> SSKProtoSyncMessageSentUpdate {
guard proto.hasGroupID else {
throw SSKProtoError.invalidProtobuf(description: "\(logTag) missing required field: groupID")
}
let groupID = proto.groupID
guard proto.hasTimestamp else {
throw SSKProtoError.invalidProtobuf(description: "\(logTag) missing required field: timestamp")
}
let timestamp = proto.timestamp
var unidentifiedStatus: [SSKProtoSyncMessageSentUpdateUnidentifiedDeliveryStatus] = []
unidentifiedStatus = try proto.unidentifiedStatus.map { try SSKProtoSyncMessageSentUpdateUnidentifiedDeliveryStatus.parseProto($0) }
@ -3944,6 +3946,8 @@ extension SSKProtoSyncMessageSentUpdateUnidentifiedDeliveryStatus.SSKProtoSyncMe
// MARK: - End Validation Logic for SSKProtoSyncMessageSentUpdate -
let result = SSKProtoSyncMessageSentUpdate(proto: proto,
groupID: groupID,
timestamp: timestamp,
unidentifiedStatus: unidentifiedStatus)
return result
}

@ -1620,15 +1620,17 @@ struct SignalServiceProtos_SyncMessage {
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
var destination: String {
get {return _destination ?? String()}
set {_destination = newValue}
/// @required
var groupID: Data {
get {return _groupID ?? SwiftProtobuf.Internal.emptyData}
set {_groupID = newValue}
}
/// Returns true if `destination` has been explicitly set.
var hasDestination: Bool {return self._destination != nil}
/// Clears the value of `destination`. Subsequent reads from it will return its default value.
mutating func clearDestination() {self._destination = nil}
/// Returns true if `groupID` has been explicitly set.
var hasGroupID: Bool {return self._groupID != nil}
/// Clears the value of `groupID`. Subsequent reads from it will return its default value.
mutating func clearGroupID() {self._groupID = nil}
/// @required
var timestamp: UInt64 {
get {return _timestamp ?? 0}
set {_timestamp = newValue}
@ -1675,7 +1677,7 @@ struct SignalServiceProtos_SyncMessage {
init() {}
fileprivate var _destination: String? = nil
fileprivate var _groupID: Data? = nil
fileprivate var _timestamp: UInt64? = nil
}
@ -4048,7 +4050,7 @@ extension SignalServiceProtos_SyncMessage.Sent.UnidentifiedDeliveryStatus: Swift
extension SignalServiceProtos_SyncMessage.SentUpdate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".SentUpdate"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "destination"),
1: .same(proto: "groupId"),
2: .same(proto: "timestamp"),
3: .same(proto: "unidentifiedStatus"),
]
@ -4056,7 +4058,7 @@ extension SignalServiceProtos_SyncMessage.SentUpdate: SwiftProtobuf.Message, Swi
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
switch fieldNumber {
case 1: try decoder.decodeSingularStringField(value: &self._destination)
case 1: try decoder.decodeSingularBytesField(value: &self._groupID)
case 2: try decoder.decodeSingularUInt64Field(value: &self._timestamp)
case 3: try decoder.decodeRepeatedMessageField(value: &self.unidentifiedStatus)
default: break
@ -4065,8 +4067,8 @@ extension SignalServiceProtos_SyncMessage.SentUpdate: SwiftProtobuf.Message, Swi
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if let v = self._destination {
try visitor.visitSingularStringField(value: v, fieldNumber: 1)
if let v = self._groupID {
try visitor.visitSingularBytesField(value: v, fieldNumber: 1)
}
if let v = self._timestamp {
try visitor.visitSingularUInt64Field(value: v, fieldNumber: 2)
@ -4078,7 +4080,7 @@ extension SignalServiceProtos_SyncMessage.SentUpdate: SwiftProtobuf.Message, Swi
}
static func ==(lhs: SignalServiceProtos_SyncMessage.SentUpdate, rhs: SignalServiceProtos_SyncMessage.SentUpdate) -> Bool {
if lhs._destination != rhs._destination {return false}
if lhs._groupID != rhs._groupID {return false}
if lhs._timestamp != rhs._timestamp {return false}
if lhs.unidentifiedStatus != rhs.unidentifiedStatus {return false}
if lhs.unknownFields != rhs.unknownFields {return false}

Loading…
Cancel
Save