|
|
@ -3126,15 +3126,18 @@ extension SNProtoConfigurationMessageClosedGroup.SNProtoConfigurationMessageClos
|
|
|
|
|
|
|
|
|
|
|
|
// MARK: - SNProtoConfigurationMessageBuilder
|
|
|
|
// MARK: - SNProtoConfigurationMessageBuilder
|
|
|
|
|
|
|
|
|
|
|
|
@objc public class func builder(displayName: String) -> SNProtoConfigurationMessageBuilder {
|
|
|
|
@objc public class func builder() -> SNProtoConfigurationMessageBuilder {
|
|
|
|
return SNProtoConfigurationMessageBuilder(displayName: displayName)
|
|
|
|
return SNProtoConfigurationMessageBuilder()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
|
|
|
// asBuilder() constructs a builder that reflects the proto's contents.
|
|
|
|
@objc public func asBuilder() -> SNProtoConfigurationMessageBuilder {
|
|
|
|
@objc public func asBuilder() -> SNProtoConfigurationMessageBuilder {
|
|
|
|
let builder = SNProtoConfigurationMessageBuilder(displayName: displayName)
|
|
|
|
let builder = SNProtoConfigurationMessageBuilder()
|
|
|
|
builder.setClosedGroups(closedGroups)
|
|
|
|
builder.setClosedGroups(closedGroups)
|
|
|
|
builder.setOpenGroups(openGroups)
|
|
|
|
builder.setOpenGroups(openGroups)
|
|
|
|
|
|
|
|
if let _value = displayName {
|
|
|
|
|
|
|
|
builder.setDisplayName(_value)
|
|
|
|
|
|
|
|
}
|
|
|
|
if let _value = profilePicture {
|
|
|
|
if let _value = profilePicture {
|
|
|
|
builder.setProfilePicture(_value)
|
|
|
|
builder.setProfilePicture(_value)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3150,12 +3153,6 @@ extension SNProtoConfigurationMessageClosedGroup.SNProtoConfigurationMessageClos
|
|
|
|
|
|
|
|
|
|
|
|
@objc fileprivate override init() {}
|
|
|
|
@objc fileprivate override init() {}
|
|
|
|
|
|
|
|
|
|
|
|
@objc fileprivate init(displayName: String) {
|
|
|
|
|
|
|
|
super.init()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setDisplayName(displayName)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@objc public func addClosedGroups(_ valueParam: SNProtoConfigurationMessageClosedGroup) {
|
|
|
|
@objc public func addClosedGroups(_ valueParam: SNProtoConfigurationMessageClosedGroup) {
|
|
|
|
var items = proto.closedGroups
|
|
|
|
var items = proto.closedGroups
|
|
|
|
items.append(valueParam.proto)
|
|
|
|
items.append(valueParam.proto)
|
|
|
@ -3201,12 +3198,20 @@ extension SNProtoConfigurationMessageClosedGroup.SNProtoConfigurationMessageClos
|
|
|
|
|
|
|
|
|
|
|
|
@objc public let closedGroups: [SNProtoConfigurationMessageClosedGroup]
|
|
|
|
@objc public let closedGroups: [SNProtoConfigurationMessageClosedGroup]
|
|
|
|
|
|
|
|
|
|
|
|
@objc public let displayName: String
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@objc public var openGroups: [String] {
|
|
|
|
@objc public var openGroups: [String] {
|
|
|
|
return proto.openGroups
|
|
|
|
return proto.openGroups
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@objc public var displayName: String? {
|
|
|
|
|
|
|
|
guard proto.hasDisplayName else {
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return proto.displayName
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@objc public var hasDisplayName: Bool {
|
|
|
|
|
|
|
|
return proto.hasDisplayName
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@objc public var profilePicture: String? {
|
|
|
|
@objc public var profilePicture: String? {
|
|
|
|
guard proto.hasProfilePicture else {
|
|
|
|
guard proto.hasProfilePicture else {
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
@ -3228,11 +3233,9 @@ extension SNProtoConfigurationMessageClosedGroup.SNProtoConfigurationMessageClos
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private init(proto: SessionProtos_ConfigurationMessage,
|
|
|
|
private init(proto: SessionProtos_ConfigurationMessage,
|
|
|
|
closedGroups: [SNProtoConfigurationMessageClosedGroup],
|
|
|
|
closedGroups: [SNProtoConfigurationMessageClosedGroup]) {
|
|
|
|
displayName: String) {
|
|
|
|
|
|
|
|
self.proto = proto
|
|
|
|
self.proto = proto
|
|
|
|
self.closedGroups = closedGroups
|
|
|
|
self.closedGroups = closedGroups
|
|
|
|
self.displayName = displayName
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
@objc
|
|
|
@ -3249,18 +3252,12 @@ extension SNProtoConfigurationMessageClosedGroup.SNProtoConfigurationMessageClos
|
|
|
|
var closedGroups: [SNProtoConfigurationMessageClosedGroup] = []
|
|
|
|
var closedGroups: [SNProtoConfigurationMessageClosedGroup] = []
|
|
|
|
closedGroups = try proto.closedGroups.map { try SNProtoConfigurationMessageClosedGroup.parseProto($0) }
|
|
|
|
closedGroups = try proto.closedGroups.map { try SNProtoConfigurationMessageClosedGroup.parseProto($0) }
|
|
|
|
|
|
|
|
|
|
|
|
guard proto.hasDisplayName else {
|
|
|
|
|
|
|
|
throw SNProtoError.invalidProtobuf(description: "\(logTag) missing required field: displayName")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
let displayName = proto.displayName
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MARK: - Begin Validation Logic for SNProtoConfigurationMessage -
|
|
|
|
// MARK: - Begin Validation Logic for SNProtoConfigurationMessage -
|
|
|
|
|
|
|
|
|
|
|
|
// MARK: - End Validation Logic for SNProtoConfigurationMessage -
|
|
|
|
// MARK: - End Validation Logic for SNProtoConfigurationMessage -
|
|
|
|
|
|
|
|
|
|
|
|
let result = SNProtoConfigurationMessage(proto: proto,
|
|
|
|
let result = SNProtoConfigurationMessage(proto: proto,
|
|
|
|
closedGroups: closedGroups,
|
|
|
|
closedGroups: closedGroups)
|
|
|
|
displayName: displayName)
|
|
|
|
|
|
|
|
return result
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|