update protos for group blocking

pull/1/head
Michael Kirk 7 years ago
parent 2c4cd11509
commit bfe1f38c75

@ -250,6 +250,7 @@ message SyncMessage {
message Blocked {
repeated string numbers = 1;
repeated bytes groupIds = 2;
}
message Request {
@ -353,4 +354,5 @@ message GroupDetails {
optional bool active = 5 [default = true];
optional uint32 expireTimer = 6;
optional string color = 7;
optional bool blocked = 8;
}

@ -309,27 +309,27 @@ public enum SSKProtoError: Error {
}
fileprivate class func parseProto(_ proto: SignalServiceProtos_Content) throws -> SSKProtoContent {
var dataMessage: SSKProtoDataMessage?
var dataMessage: SSKProtoDataMessage? = nil
if proto.hasDataMessage {
dataMessage = try SSKProtoDataMessage.parseProto(proto.dataMessage)
}
var syncMessage: SSKProtoSyncMessage?
var syncMessage: SSKProtoSyncMessage? = nil
if proto.hasSyncMessage {
syncMessage = try SSKProtoSyncMessage.parseProto(proto.syncMessage)
}
var callMessage: SSKProtoCallMessage?
var callMessage: SSKProtoCallMessage? = nil
if proto.hasCallMessage {
callMessage = try SSKProtoCallMessage.parseProto(proto.callMessage)
}
var nullMessage: SSKProtoNullMessage?
var nullMessage: SSKProtoNullMessage? = nil
if proto.hasNullMessage {
nullMessage = try SSKProtoNullMessage.parseProto(proto.nullMessage)
}
var receiptMessage: SSKProtoReceiptMessage?
var receiptMessage: SSKProtoReceiptMessage? = nil
if proto.hasReceiptMessage {
receiptMessage = try SSKProtoReceiptMessage.parseProto(proto.receiptMessage)
}
@ -969,12 +969,12 @@ public enum SSKProtoError: Error {
}
fileprivate class func parseProto(_ proto: SignalServiceProtos_CallMessage) throws -> SSKProtoCallMessage {
var offer: SSKProtoCallMessageOffer?
var offer: SSKProtoCallMessageOffer? = nil
if proto.hasOffer {
offer = try SSKProtoCallMessageOffer.parseProto(proto.offer)
}
var answer: SSKProtoCallMessageAnswer?
var answer: SSKProtoCallMessageAnswer? = nil
if proto.hasAnswer {
answer = try SSKProtoCallMessageAnswer.parseProto(proto.answer)
}
@ -982,12 +982,12 @@ public enum SSKProtoError: Error {
var iceUpdate: [SSKProtoCallMessageIceUpdate] = []
iceUpdate = try proto.iceUpdate.map { try SSKProtoCallMessageIceUpdate.parseProto($0) }
var hangup: SSKProtoCallMessageHangup?
var hangup: SSKProtoCallMessageHangup? = nil
if proto.hasHangup {
hangup = try SSKProtoCallMessageHangup.parseProto(proto.hangup)
}
var busy: SSKProtoCallMessageBusy?
var busy: SSKProtoCallMessageBusy? = nil
if proto.hasBusy {
busy = try SSKProtoCallMessageBusy.parseProto(proto.busy)
}
@ -1127,7 +1127,7 @@ public enum SSKProtoError: Error {
}
fileprivate class func parseProto(_ proto: SignalServiceProtos_DataMessage.Quote.QuotedAttachment) throws -> SSKProtoDataMessageQuoteQuotedAttachment {
var thumbnail: SSKProtoAttachmentPointer?
var thumbnail: SSKProtoAttachmentPointer? = nil
if proto.hasThumbnail {
thumbnail = try SSKProtoAttachmentPointer.parseProto(proto.thumbnail)
}
@ -1973,7 +1973,7 @@ public enum SSKProtoError: Error {
}
fileprivate class func parseProto(_ proto: SignalServiceProtos_DataMessage.Contact.Avatar) throws -> SSKProtoDataMessageContactAvatar {
var avatar: SSKProtoAttachmentPointer?
var avatar: SSKProtoAttachmentPointer? = nil
if proto.hasAvatar {
avatar = try SSKProtoAttachmentPointer.parseProto(proto.avatar)
}
@ -2116,7 +2116,7 @@ public enum SSKProtoError: Error {
}
fileprivate class func parseProto(_ proto: SignalServiceProtos_DataMessage.Contact) throws -> SSKProtoDataMessageContact {
var name: SSKProtoDataMessageContactName?
var name: SSKProtoDataMessageContactName? = nil
if proto.hasName {
name = try SSKProtoDataMessageContactName.parseProto(proto.name)
}
@ -2130,7 +2130,7 @@ public enum SSKProtoError: Error {
var address: [SSKProtoDataMessageContactPostalAddress] = []
address = try proto.address.map { try SSKProtoDataMessageContactPostalAddress.parseProto($0) }
var avatar: SSKProtoDataMessageContactAvatar?
var avatar: SSKProtoDataMessageContactAvatar? = nil
if proto.hasAvatar {
avatar = try SSKProtoDataMessageContactAvatar.parseProto(proto.avatar)
}
@ -2337,12 +2337,12 @@ public enum SSKProtoError: Error {
var attachments: [SSKProtoAttachmentPointer] = []
attachments = try proto.attachments.map { try SSKProtoAttachmentPointer.parseProto($0) }
var group: SSKProtoGroupContext?
var group: SSKProtoGroupContext? = nil
if proto.hasGroup {
group = try SSKProtoGroupContext.parseProto(proto.group)
}
var quote: SSKProtoDataMessageQuote?
var quote: SSKProtoDataMessageQuote? = nil
if proto.hasQuote {
quote = try SSKProtoDataMessageQuote.parseProto(proto.quote)
}
@ -2812,7 +2812,7 @@ public enum SSKProtoError: Error {
}
fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage.Sent) throws -> SSKProtoSyncMessageSent {
var message: SSKProtoDataMessage?
var message: SSKProtoDataMessage? = nil
if proto.hasMessage {
message = try SSKProtoDataMessage.parseProto(proto.message)
}
@ -2988,7 +2988,7 @@ public enum SSKProtoError: Error {
}
fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage.Groups) throws -> SSKProtoSyncMessageGroups {
var blob: SSKProtoAttachmentPointer?
var blob: SSKProtoAttachmentPointer? = nil
if proto.hasBlob {
blob = try SSKProtoAttachmentPointer.parseProto(proto.blob)
}
@ -3025,6 +3025,16 @@ public enum SSKProtoError: Error {
proto.numbers = wrappedItems
}
@objc public func addGroupIds(_ valueParam: Data) {
var items = proto.groupIds
items.append(valueParam)
proto.groupIds = items
}
@objc public func setGroupIds(_ wrappedItems: [Data]) {
proto.groupIds = wrappedItems
}
// NOTE: This method is intended for debugging purposes only.
@objc public func buildIgnoringErrors() -> SSKProtoSyncMessageBlocked? {
guard _isDebugAssertConfiguration() else {
@ -3049,6 +3059,10 @@ public enum SSKProtoError: Error {
return proto.numbers
}
@objc public var groupIds: [Data] {
return proto.groupIds
}
private init(proto: SignalServiceProtos_SyncMessage.Blocked) {
self.proto = proto
}
@ -3515,22 +3529,22 @@ public enum SSKProtoError: Error {
}
fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage) throws -> SSKProtoSyncMessage {
var sent: SSKProtoSyncMessageSent?
var sent: SSKProtoSyncMessageSent? = nil
if proto.hasSent {
sent = try SSKProtoSyncMessageSent.parseProto(proto.sent)
}
var contacts: SSKProtoSyncMessageContacts?
var contacts: SSKProtoSyncMessageContacts? = nil
if proto.hasContacts {
contacts = try SSKProtoSyncMessageContacts.parseProto(proto.contacts)
}
var groups: SSKProtoSyncMessageGroups?
var groups: SSKProtoSyncMessageGroups? = nil
if proto.hasGroups {
groups = try SSKProtoSyncMessageGroups.parseProto(proto.groups)
}
var request: SSKProtoSyncMessageRequest?
var request: SSKProtoSyncMessageRequest? = nil
if proto.hasRequest {
request = try SSKProtoSyncMessageRequest.parseProto(proto.request)
}
@ -3538,17 +3552,17 @@ public enum SSKProtoError: Error {
var read: [SSKProtoSyncMessageRead] = []
read = try proto.read.map { try SSKProtoSyncMessageRead.parseProto($0) }
var blocked: SSKProtoSyncMessageBlocked?
var blocked: SSKProtoSyncMessageBlocked? = nil
if proto.hasBlocked {
blocked = try SSKProtoSyncMessageBlocked.parseProto(proto.blocked)
}
var verified: SSKProtoVerified?
var verified: SSKProtoVerified? = nil
if proto.hasVerified {
verified = try SSKProtoVerified.parseProto(proto.verified)
}
var configuration: SSKProtoSyncMessageConfiguration?
var configuration: SSKProtoSyncMessageConfiguration? = nil
if proto.hasConfiguration {
configuration = try SSKProtoSyncMessageConfiguration.parseProto(proto.configuration)
}
@ -3944,7 +3958,7 @@ public enum SSKProtoError: Error {
}
let type = SSKProtoGroupContextTypeWrap(proto.type)
var avatar: SSKProtoAttachmentPointer?
var avatar: SSKProtoAttachmentPointer? = nil
if proto.hasAvatar {
avatar = try SSKProtoAttachmentPointer.parseProto(proto.avatar)
}
@ -4207,12 +4221,12 @@ public enum SSKProtoError: Error {
}
let number = proto.number
var avatar: SSKProtoContactDetailsAvatar?
var avatar: SSKProtoContactDetailsAvatar? = nil
if proto.hasAvatar {
avatar = try SSKProtoContactDetailsAvatar.parseProto(proto.avatar)
}
var verified: SSKProtoVerified?
var verified: SSKProtoVerified? = nil
if proto.hasVerified {
verified = try SSKProtoVerified.parseProto(proto.verified)
}
@ -4372,6 +4386,10 @@ public enum SSKProtoError: Error {
proto.color = valueParam
}
@objc public func setBlocked(_ valueParam: Bool) {
proto.blocked = valueParam
}
// NOTE: This method is intended for debugging purposes only.
@objc public func buildIgnoringErrors() -> SSKProtoGroupDetails? {
guard _isDebugAssertConfiguration() else {
@ -4434,6 +4452,13 @@ public enum SSKProtoError: Error {
return proto.hasColor
}
@objc public var blocked: Bool {
return proto.blocked
}
@objc public var hasBlocked: Bool {
return proto.hasBlocked
}
private init(proto: SignalServiceProtos_GroupDetails,
id: Data,
avatar: SSKProtoGroupDetailsAvatar?) {
@ -4467,7 +4492,7 @@ public enum SSKProtoError: Error {
}
let id = proto.id
var avatar: SSKProtoGroupDetailsAvatar?
var avatar: SSKProtoGroupDetailsAvatar? = nil
if proto.hasAvatar {
avatar = try SSKProtoGroupDetailsAvatar.parseProto(proto.avatar)
}

@ -149,14 +149,6 @@ struct SignalServiceProtos_Envelope {
fileprivate var _content: Data? = nil
}
#if swift(>=4.2)
extension SignalServiceProtos_Envelope.TypeEnum: CaseIterable {
// Support synthesized by the compiler.
}
#endif // swift(>=4.2)
struct SignalServiceProtos_Content {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
@ -1108,14 +1100,6 @@ struct SignalServiceProtos_DataMessage {
fileprivate var _storage = _StorageClass.defaultInstance
}
#if swift(>=4.2)
extension SignalServiceProtos_DataMessage.Flags: CaseIterable {
// Support synthesized by the compiler.
}
#endif // swift(>=4.2)
struct SignalServiceProtos_NullMessage {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
@ -1187,14 +1171,6 @@ struct SignalServiceProtos_ReceiptMessage {
fileprivate var _type: SignalServiceProtos_ReceiptMessage.TypeEnum? = nil
}
#if swift(>=4.2)
extension SignalServiceProtos_ReceiptMessage.TypeEnum: CaseIterable {
// Support synthesized by the compiler.
}
#endif // swift(>=4.2)
struct SignalServiceProtos_Verified {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
@ -1276,14 +1252,6 @@ struct SignalServiceProtos_Verified {
fileprivate var _nullMessage: Data? = nil
}
#if swift(>=4.2)
extension SignalServiceProtos_Verified.State: CaseIterable {
// Support synthesized by the compiler.
}
#endif // swift(>=4.2)
struct SignalServiceProtos_SyncMessage {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
@ -1476,6 +1444,8 @@ struct SignalServiceProtos_SyncMessage {
var numbers: [String] = []
var groupIds: [Data] = []
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
@ -1732,14 +1702,6 @@ struct SignalServiceProtos_AttachmentPointer {
fileprivate var _height: UInt32? = nil
}
#if swift(>=4.2)
extension SignalServiceProtos_AttachmentPointer.Flags: CaseIterable {
// Support synthesized by the compiler.
}
#endif // swift(>=4.2)
struct SignalServiceProtos_GroupContext {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
@ -1830,14 +1792,6 @@ struct SignalServiceProtos_GroupContext {
fileprivate var _storage = _StorageClass.defaultInstance
}
#if swift(>=4.2)
extension SignalServiceProtos_GroupContext.TypeEnum: CaseIterable {
// Support synthesized by the compiler.
}
#endif // swift(>=4.2)
struct SignalServiceProtos_ContactDetails {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
@ -2019,6 +1973,15 @@ struct SignalServiceProtos_GroupDetails {
/// Clears the value of `color`. Subsequent reads from it will return its default value.
mutating func clearColor() {_storage._color = nil}
var blocked: Bool {
get {return _storage._blocked ?? false}
set {_uniqueStorage()._blocked = newValue}
}
/// Returns true if `blocked` has been explicitly set.
var hasBlocked: Bool {return _storage._blocked != nil}
/// Clears the value of `blocked`. Subsequent reads from it will return its default value.
mutating func clearBlocked() {_storage._blocked = nil}
var unknownFields = SwiftProtobuf.UnknownStorage()
struct Avatar {
@ -3660,12 +3623,14 @@ extension SignalServiceProtos_SyncMessage.Blocked: SwiftProtobuf.Message, SwiftP
static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Blocked"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "numbers"),
2: .same(proto: "groupIds"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
switch fieldNumber {
case 1: try decoder.decodeRepeatedStringField(value: &self.numbers)
case 2: try decoder.decodeRepeatedBytesField(value: &self.groupIds)
default: break
}
}
@ -3675,11 +3640,15 @@ extension SignalServiceProtos_SyncMessage.Blocked: SwiftProtobuf.Message, SwiftP
if !self.numbers.isEmpty {
try visitor.visitRepeatedStringField(value: self.numbers, fieldNumber: 1)
}
if !self.groupIds.isEmpty {
try visitor.visitRepeatedBytesField(value: self.groupIds, fieldNumber: 2)
}
try unknownFields.traverse(visitor: &visitor)
}
func _protobuf_generated_isEqualTo(other: SignalServiceProtos_SyncMessage.Blocked) -> Bool {
if self.numbers != other.numbers {return false}
if self.groupIds != other.groupIds {return false}
if unknownFields != other.unknownFields {return false}
return true
}
@ -4142,6 +4111,7 @@ extension SignalServiceProtos_GroupDetails: SwiftProtobuf.Message, SwiftProtobuf
5: .same(proto: "active"),
6: .same(proto: "expireTimer"),
7: .same(proto: "color"),
8: .same(proto: "blocked"),
]
fileprivate class _StorageClass {
@ -4152,6 +4122,7 @@ extension SignalServiceProtos_GroupDetails: SwiftProtobuf.Message, SwiftProtobuf
var _active: Bool? = nil
var _expireTimer: UInt32? = nil
var _color: String? = nil
var _blocked: Bool? = nil
static let defaultInstance = _StorageClass()
@ -4165,6 +4136,7 @@ extension SignalServiceProtos_GroupDetails: SwiftProtobuf.Message, SwiftProtobuf
_active = source._active
_expireTimer = source._expireTimer
_color = source._color
_blocked = source._blocked
}
}
@ -4187,6 +4159,7 @@ extension SignalServiceProtos_GroupDetails: SwiftProtobuf.Message, SwiftProtobuf
case 5: try decoder.decodeSingularBoolField(value: &_storage._active)
case 6: try decoder.decodeSingularUInt32Field(value: &_storage._expireTimer)
case 7: try decoder.decodeSingularStringField(value: &_storage._color)
case 8: try decoder.decodeSingularBoolField(value: &_storage._blocked)
default: break
}
}
@ -4216,6 +4189,9 @@ extension SignalServiceProtos_GroupDetails: SwiftProtobuf.Message, SwiftProtobuf
if let v = _storage._color {
try visitor.visitSingularStringField(value: v, fieldNumber: 7)
}
if let v = _storage._blocked {
try visitor.visitSingularBoolField(value: v, fieldNumber: 8)
}
}
try unknownFields.traverse(visitor: &visitor)
}
@ -4232,6 +4208,7 @@ extension SignalServiceProtos_GroupDetails: SwiftProtobuf.Message, SwiftProtobuf
if _storage._active != other_storage._active {return false}
if _storage._expireTimer != other_storage._expireTimer {return false}
if _storage._color != other_storage._color {return false}
if _storage._blocked != other_storage._blocked {return false}
return true
}
if !storagesAreEqual {return false}

@ -413,12 +413,12 @@ public enum WebSocketProtoError: Error {
}
let type = WebSocketProtoWebSocketMessageTypeWrap(proto.type)
var request: WebSocketProtoWebSocketRequestMessage?
var request: WebSocketProtoWebSocketRequestMessage? = nil
if proto.hasRequest {
request = try WebSocketProtoWebSocketRequestMessage.parseProto(proto.request)
}
var response: WebSocketProtoWebSocketResponseMessage?
var response: WebSocketProtoWebSocketResponseMessage? = nil
if proto.hasResponse {
response = try WebSocketProtoWebSocketResponseMessage.parseProto(proto.response)
}

@ -207,14 +207,6 @@ struct WebSocketProtos_WebSocketMessage {
fileprivate var _storage = _StorageClass.defaultInstance
}
#if swift(>=4.2)
extension WebSocketProtos_WebSocketMessage.TypeEnum: CaseIterable {
// Support synthesized by the compiler.
}
#endif // swift(>=4.2)
// MARK: - Code below here is support for the SwiftProtobuf runtime.
fileprivate let _protobuf_package = "WebSocketProtos"

Loading…
Cancel
Save