Create DataExtractionNotification
This commit is contained in:
parent
defb3a751b
commit
b1cd34c9b4
|
@ -287,6 +287,7 @@
|
|||
B8F5F54E25EC50A5003BF8D4 /* BlockListUIUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F5F52725EC4F6A003BF8D4 /* BlockListUIUtils.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
B8F5F56525EC8453003BF8D4 /* Notification+Contacts.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8F5F56425EC8453003BF8D4 /* Notification+Contacts.swift */; };
|
||||
B8F5F58325EC94A6003BF8D4 /* Collection+Subscripting.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8F5F58225EC94A6003BF8D4 /* Collection+Subscripting.swift */; };
|
||||
B8F5F60325EDE16F003BF8D4 /* DataExtractionNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8F5F60225EDE16F003BF8D4 /* DataExtractionNotification.swift */; };
|
||||
B8FF8DAE25C0D00F004D1F22 /* SessionMessagingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3C2A6F025539DE700C340D1 /* SessionMessagingKit.framework */; };
|
||||
B8FF8DAF25C0D00F004D1F22 /* SessionUtilitiesKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3C2A679255388CC00C340D1 /* SessionUtilitiesKit.framework */; };
|
||||
B8FF8E6225C10DA5004D1F22 /* GeoLite2-Country-Blocks-IPv4 in Resources */ = {isa = PBXBuildFile; fileRef = B8FF8E6125C10DA5004D1F22 /* GeoLite2-Country-Blocks-IPv4 */; };
|
||||
|
@ -1283,6 +1284,7 @@
|
|||
B8F5F52825EC4F8A003BF8D4 /* BlockListUIUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BlockListUIUtils.m; sourceTree = "<group>"; };
|
||||
B8F5F56425EC8453003BF8D4 /* Notification+Contacts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Notification+Contacts.swift"; sourceTree = "<group>"; };
|
||||
B8F5F58225EC94A6003BF8D4 /* Collection+Subscripting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Collection+Subscripting.swift"; sourceTree = "<group>"; };
|
||||
B8F5F60225EDE16F003BF8D4 /* DataExtractionNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataExtractionNotification.swift; sourceTree = "<group>"; };
|
||||
B8FF8E6125C10DA5004D1F22 /* GeoLite2-Country-Blocks-IPv4 */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; name = "GeoLite2-Country-Blocks-IPv4"; path = "Countries/GeoLite2-Country-Blocks-IPv4"; sourceTree = "<group>"; };
|
||||
B8FF8E7325C10FC3004D1F22 /* GeoLite2-Country-Locations-English */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; name = "GeoLite2-Country-Locations-English"; path = "Countries/GeoLite2-Country-Locations-English"; sourceTree = "<group>"; };
|
||||
B8FF8EA525C11FEF004D1F22 /* IPv4.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IPv4.swift; sourceTree = "<group>"; };
|
||||
|
@ -2424,6 +2426,7 @@
|
|||
C300A5BC2554B00D00555489 /* ReadReceipt.swift */,
|
||||
C300A5D22554B05A00555489 /* TypingIndicator.swift */,
|
||||
C34A977325A3E34A00852C71 /* ClosedGroupControlMessage.swift */,
|
||||
B8F5F60225EDE16F003BF8D4 /* DataExtractionNotification.swift */,
|
||||
C300A5E62554B07300555489 /* ExpirationTimerUpdate.swift */,
|
||||
C3DA9C0625AE7396008F7C7E /* ConfigurationMessage.swift */,
|
||||
);
|
||||
|
@ -4761,6 +4764,7 @@
|
|||
C3A3A171256E1D25004D228D /* SSKReachabilityManager.swift in Sources */,
|
||||
C3A721392558BDFA0043A11F /* OpenGroupAPI.swift in Sources */,
|
||||
C3A71D0B2558989C0043A11F /* MessageWrapper.swift in Sources */,
|
||||
B8F5F60325EDE16F003BF8D4 /* DataExtractionNotification.swift in Sources */,
|
||||
C32C5D24256DD4C0003C73A2 /* MentionsManager.swift in Sources */,
|
||||
C3A71D1E25589AC30043A11F /* WebSocketProto.swift in Sources */,
|
||||
C3A721382558BDFA0043A11F /* OpenGroupMessage.swift in Sources */,
|
||||
|
|
|
@ -0,0 +1,106 @@
|
|||
import SessionUtilitiesKit
|
||||
|
||||
public final class DataExtractionNotification : ControlMessage {
|
||||
public var kind: Kind?
|
||||
|
||||
// MARK: Kind
|
||||
public enum Kind : CustomStringConvertible {
|
||||
case screenshot
|
||||
case mediaSaved(timestamp: UInt64)
|
||||
|
||||
public var description: String {
|
||||
switch self {
|
||||
case .screenshot: return "screenshot"
|
||||
case .mediaSaved: return "mediaSaved"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Initialization
|
||||
public override init() { super.init() }
|
||||
|
||||
internal init(kind: Kind) {
|
||||
super.init()
|
||||
self.kind = kind
|
||||
}
|
||||
|
||||
// MARK: Validation
|
||||
public override var isValid: Bool {
|
||||
guard super.isValid, let kind = kind else { return false }
|
||||
switch kind {
|
||||
case .screenshot: return true
|
||||
case .mediaSaved(let timestamp): return timestamp > 0
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Coding
|
||||
public required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
guard let rawKind = coder.decodeObject(forKey: "kind") as? String else { return nil }
|
||||
switch rawKind {
|
||||
case "screenshot":
|
||||
self.kind = .screenshot
|
||||
case "mediaSaved":
|
||||
guard let timestamp = coder.decodeObject(forKey: "timestamp") as? UInt64 else { return nil }
|
||||
self.kind = .mediaSaved(timestamp: timestamp)
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
public override func encode(with coder: NSCoder) {
|
||||
super.encode(with: coder)
|
||||
guard let kind = kind else { return }
|
||||
switch kind {
|
||||
case .screenshot:
|
||||
coder.encode("screenshot", forKey: "kind")
|
||||
case .mediaSaved(let timestamp):
|
||||
coder.encode("mediaSaved", forKey: "kind")
|
||||
coder.encode(timestamp, forKey: "timestamp")
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Proto Conversion
|
||||
public override class func fromProto(_ proto: SNProtoContent) -> DataExtractionNotification? {
|
||||
guard let dataExtractionNotification = proto.dataExtractionNotification else { return nil }
|
||||
let kind: Kind
|
||||
switch dataExtractionNotification.type {
|
||||
case .screenshot: kind = .screenshot
|
||||
case .mediaSaved:
|
||||
let timestamp = dataExtractionNotification.hasTimestamp ? dataExtractionNotification.timestamp : 0
|
||||
kind = .mediaSaved(timestamp: timestamp)
|
||||
}
|
||||
return DataExtractionNotification(kind: kind)
|
||||
}
|
||||
|
||||
public override func toProto(using transaction: YapDatabaseReadWriteTransaction) -> SNProtoContent? {
|
||||
guard let kind = kind else {
|
||||
SNLog("Couldn't construct data extraction notification proto from: \(self).")
|
||||
return nil
|
||||
}
|
||||
do {
|
||||
let dataExtractionNotification: SNProtoDataExtractionNotification.SNProtoDataExtractionNotificationBuilder
|
||||
switch kind {
|
||||
case .screenshot:
|
||||
dataExtractionNotification = SNProtoDataExtractionNotification.builder(type: .screenshot)
|
||||
case .mediaSaved(let timestamp):
|
||||
dataExtractionNotification = SNProtoDataExtractionNotification.builder(type: .mediaSaved)
|
||||
dataExtractionNotification.setTimestamp(timestamp)
|
||||
}
|
||||
let contentProto = SNProtoContent.builder()
|
||||
contentProto.setDataExtractionNotification(try dataExtractionNotification.build())
|
||||
return try contentProto.build()
|
||||
} catch {
|
||||
SNLog("Couldn't construct data extraction notification proto from: \(self).")
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Description
|
||||
public override var description: String {
|
||||
"""
|
||||
DataExtractionNotification(
|
||||
kind: \(kind?.description ?? "null")
|
||||
)
|
||||
"""
|
||||
}
|
||||
}
|
|
@ -363,8 +363,8 @@ extension SNProtoTypingMessage.SNProtoTypingMessageBuilder {
|
|||
if let _value = configurationMessage {
|
||||
builder.setConfigurationMessage(_value)
|
||||
}
|
||||
if let _value = infoMessage {
|
||||
builder.setInfoMessage(_value)
|
||||
if let _value = dataExtractionNotification {
|
||||
builder.setDataExtractionNotification(_value)
|
||||
}
|
||||
return builder
|
||||
}
|
||||
|
@ -391,8 +391,8 @@ extension SNProtoTypingMessage.SNProtoTypingMessageBuilder {
|
|||
proto.configurationMessage = valueParam.proto
|
||||
}
|
||||
|
||||
@objc public func setInfoMessage(_ valueParam: SNProtoInfoMessage) {
|
||||
proto.infoMessage = valueParam.proto
|
||||
@objc public func setDataExtractionNotification(_ valueParam: SNProtoDataExtractionNotification) {
|
||||
proto.dataExtractionNotification = valueParam.proto
|
||||
}
|
||||
|
||||
@objc public func build() throws -> SNProtoContent {
|
||||
|
@ -414,20 +414,20 @@ extension SNProtoTypingMessage.SNProtoTypingMessageBuilder {
|
|||
|
||||
@objc public let configurationMessage: SNProtoConfigurationMessage?
|
||||
|
||||
@objc public let infoMessage: SNProtoInfoMessage?
|
||||
@objc public let dataExtractionNotification: SNProtoDataExtractionNotification?
|
||||
|
||||
private init(proto: SessionProtos_Content,
|
||||
dataMessage: SNProtoDataMessage?,
|
||||
receiptMessage: SNProtoReceiptMessage?,
|
||||
typingMessage: SNProtoTypingMessage?,
|
||||
configurationMessage: SNProtoConfigurationMessage?,
|
||||
infoMessage: SNProtoInfoMessage?) {
|
||||
dataExtractionNotification: SNProtoDataExtractionNotification?) {
|
||||
self.proto = proto
|
||||
self.dataMessage = dataMessage
|
||||
self.receiptMessage = receiptMessage
|
||||
self.typingMessage = typingMessage
|
||||
self.configurationMessage = configurationMessage
|
||||
self.infoMessage = infoMessage
|
||||
self.dataExtractionNotification = dataExtractionNotification
|
||||
}
|
||||
|
||||
@objc
|
||||
|
@ -461,9 +461,9 @@ extension SNProtoTypingMessage.SNProtoTypingMessageBuilder {
|
|||
configurationMessage = try SNProtoConfigurationMessage.parseProto(proto.configurationMessage)
|
||||
}
|
||||
|
||||
var infoMessage: SNProtoInfoMessage? = nil
|
||||
if proto.hasInfoMessage {
|
||||
infoMessage = try SNProtoInfoMessage.parseProto(proto.infoMessage)
|
||||
var dataExtractionNotification: SNProtoDataExtractionNotification? = nil
|
||||
if proto.hasDataExtractionNotification {
|
||||
dataExtractionNotification = try SNProtoDataExtractionNotification.parseProto(proto.dataExtractionNotification)
|
||||
}
|
||||
|
||||
// MARK: - Begin Validation Logic for SNProtoContent -
|
||||
|
@ -475,7 +475,7 @@ extension SNProtoTypingMessage.SNProtoTypingMessageBuilder {
|
|||
receiptMessage: receiptMessage,
|
||||
typingMessage: typingMessage,
|
||||
configurationMessage: configurationMessage,
|
||||
infoMessage: infoMessage)
|
||||
dataExtractionNotification: dataExtractionNotification)
|
||||
return result
|
||||
}
|
||||
|
||||
|
@ -612,78 +612,78 @@ extension SNProtoKeyPair.SNProtoKeyPairBuilder {
|
|||
|
||||
#endif
|
||||
|
||||
// MARK: - SNProtoInfoMessage
|
||||
// MARK: - SNProtoDataExtractionNotification
|
||||
|
||||
@objc public class SNProtoInfoMessage: NSObject {
|
||||
@objc public class SNProtoDataExtractionNotification: NSObject {
|
||||
|
||||
// MARK: - SNProtoInfoMessageType
|
||||
// MARK: - SNProtoDataExtractionNotificationType
|
||||
|
||||
@objc public enum SNProtoInfoMessageType: Int32 {
|
||||
@objc public enum SNProtoDataExtractionNotificationType: Int32 {
|
||||
case screenshot = 1
|
||||
case mediaSaved = 2
|
||||
}
|
||||
|
||||
private class func SNProtoInfoMessageTypeWrap(_ value: SessionProtos_InfoMessage.TypeEnum) -> SNProtoInfoMessageType {
|
||||
private class func SNProtoDataExtractionNotificationTypeWrap(_ value: SessionProtos_DataExtractionNotification.TypeEnum) -> SNProtoDataExtractionNotificationType {
|
||||
switch value {
|
||||
case .screenshot: return .screenshot
|
||||
case .mediaSaved: return .mediaSaved
|
||||
}
|
||||
}
|
||||
|
||||
private class func SNProtoInfoMessageTypeUnwrap(_ value: SNProtoInfoMessageType) -> SessionProtos_InfoMessage.TypeEnum {
|
||||
private class func SNProtoDataExtractionNotificationTypeUnwrap(_ value: SNProtoDataExtractionNotificationType) -> SessionProtos_DataExtractionNotification.TypeEnum {
|
||||
switch value {
|
||||
case .screenshot: return .screenshot
|
||||
case .mediaSaved: return .mediaSaved
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - SNProtoInfoMessageBuilder
|
||||
// MARK: - SNProtoDataExtractionNotificationBuilder
|
||||
|
||||
@objc public class func builder(type: SNProtoInfoMessageType) -> SNProtoInfoMessageBuilder {
|
||||
return SNProtoInfoMessageBuilder(type: type)
|
||||
@objc public class func builder(type: SNProtoDataExtractionNotificationType) -> SNProtoDataExtractionNotificationBuilder {
|
||||
return SNProtoDataExtractionNotificationBuilder(type: type)
|
||||
}
|
||||
|
||||
// asBuilder() constructs a builder that reflects the proto's contents.
|
||||
@objc public func asBuilder() -> SNProtoInfoMessageBuilder {
|
||||
let builder = SNProtoInfoMessageBuilder(type: type)
|
||||
@objc public func asBuilder() -> SNProtoDataExtractionNotificationBuilder {
|
||||
let builder = SNProtoDataExtractionNotificationBuilder(type: type)
|
||||
if hasTimestamp {
|
||||
builder.setTimestamp(timestamp)
|
||||
}
|
||||
return builder
|
||||
}
|
||||
|
||||
@objc public class SNProtoInfoMessageBuilder: NSObject {
|
||||
@objc public class SNProtoDataExtractionNotificationBuilder: NSObject {
|
||||
|
||||
private var proto = SessionProtos_InfoMessage()
|
||||
private var proto = SessionProtos_DataExtractionNotification()
|
||||
|
||||
@objc fileprivate override init() {}
|
||||
|
||||
@objc fileprivate init(type: SNProtoInfoMessageType) {
|
||||
@objc fileprivate init(type: SNProtoDataExtractionNotificationType) {
|
||||
super.init()
|
||||
|
||||
setType(type)
|
||||
}
|
||||
|
||||
@objc public func setType(_ valueParam: SNProtoInfoMessageType) {
|
||||
proto.type = SNProtoInfoMessageTypeUnwrap(valueParam)
|
||||
@objc public func setType(_ valueParam: SNProtoDataExtractionNotificationType) {
|
||||
proto.type = SNProtoDataExtractionNotificationTypeUnwrap(valueParam)
|
||||
}
|
||||
|
||||
@objc public func setTimestamp(_ valueParam: UInt64) {
|
||||
proto.timestamp = valueParam
|
||||
}
|
||||
|
||||
@objc public func build() throws -> SNProtoInfoMessage {
|
||||
return try SNProtoInfoMessage.parseProto(proto)
|
||||
@objc public func build() throws -> SNProtoDataExtractionNotification {
|
||||
return try SNProtoDataExtractionNotification.parseProto(proto)
|
||||
}
|
||||
|
||||
@objc public func buildSerializedData() throws -> Data {
|
||||
return try SNProtoInfoMessage.parseProto(proto).serializedData()
|
||||
return try SNProtoDataExtractionNotification.parseProto(proto).serializedData()
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate let proto: SessionProtos_InfoMessage
|
||||
fileprivate let proto: SessionProtos_DataExtractionNotification
|
||||
|
||||
@objc public let type: SNProtoInfoMessageType
|
||||
@objc public let type: SNProtoDataExtractionNotificationType
|
||||
|
||||
@objc public var timestamp: UInt64 {
|
||||
return proto.timestamp
|
||||
|
@ -692,8 +692,8 @@ extension SNProtoKeyPair.SNProtoKeyPairBuilder {
|
|||
return proto.hasTimestamp
|
||||
}
|
||||
|
||||
private init(proto: SessionProtos_InfoMessage,
|
||||
type: SNProtoInfoMessageType) {
|
||||
private init(proto: SessionProtos_DataExtractionNotification,
|
||||
type: SNProtoDataExtractionNotificationType) {
|
||||
self.proto = proto
|
||||
self.type = type
|
||||
}
|
||||
|
@ -703,23 +703,23 @@ extension SNProtoKeyPair.SNProtoKeyPairBuilder {
|
|||
return try self.proto.serializedData()
|
||||
}
|
||||
|
||||
@objc public class func parseData(_ serializedData: Data) throws -> SNProtoInfoMessage {
|
||||
let proto = try SessionProtos_InfoMessage(serializedData: serializedData)
|
||||
@objc public class func parseData(_ serializedData: Data) throws -> SNProtoDataExtractionNotification {
|
||||
let proto = try SessionProtos_DataExtractionNotification(serializedData: serializedData)
|
||||
return try parseProto(proto)
|
||||
}
|
||||
|
||||
fileprivate class func parseProto(_ proto: SessionProtos_InfoMessage) throws -> SNProtoInfoMessage {
|
||||
fileprivate class func parseProto(_ proto: SessionProtos_DataExtractionNotification) throws -> SNProtoDataExtractionNotification {
|
||||
guard proto.hasType else {
|
||||
throw SNProtoError.invalidProtobuf(description: "\(logTag) missing required field: type")
|
||||
}
|
||||
let type = SNProtoInfoMessageTypeWrap(proto.type)
|
||||
let type = SNProtoDataExtractionNotificationTypeWrap(proto.type)
|
||||
|
||||
// MARK: - Begin Validation Logic for SNProtoInfoMessage -
|
||||
// MARK: - Begin Validation Logic for SNProtoDataExtractionNotification -
|
||||
|
||||
// MARK: - End Validation Logic for SNProtoInfoMessage -
|
||||
// MARK: - End Validation Logic for SNProtoDataExtractionNotification -
|
||||
|
||||
let result = SNProtoInfoMessage(proto: proto,
|
||||
type: type)
|
||||
let result = SNProtoDataExtractionNotification(proto: proto,
|
||||
type: type)
|
||||
return result
|
||||
}
|
||||
|
||||
|
@ -730,14 +730,14 @@ extension SNProtoKeyPair.SNProtoKeyPairBuilder {
|
|||
|
||||
#if DEBUG
|
||||
|
||||
extension SNProtoInfoMessage {
|
||||
extension SNProtoDataExtractionNotification {
|
||||
@objc public func serializedDataIgnoringErrors() -> Data? {
|
||||
return try! self.serializedData()
|
||||
}
|
||||
}
|
||||
|
||||
extension SNProtoInfoMessage.SNProtoInfoMessageBuilder {
|
||||
@objc public func buildIgnoringErrors() -> SNProtoInfoMessage? {
|
||||
extension SNProtoDataExtractionNotification.SNProtoDataExtractionNotificationBuilder {
|
||||
@objc public func buildIgnoringErrors() -> SNProtoDataExtractionNotification? {
|
||||
return try! self.build()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -236,14 +236,14 @@ struct SessionProtos_Content {
|
|||
/// Clears the value of `configurationMessage`. Subsequent reads from it will return its default value.
|
||||
mutating func clearConfigurationMessage() {_uniqueStorage()._configurationMessage = nil}
|
||||
|
||||
var infoMessage: SessionProtos_InfoMessage {
|
||||
get {return _storage._infoMessage ?? SessionProtos_InfoMessage()}
|
||||
set {_uniqueStorage()._infoMessage = newValue}
|
||||
var dataExtractionNotification: SessionProtos_DataExtractionNotification {
|
||||
get {return _storage._dataExtractionNotification ?? SessionProtos_DataExtractionNotification()}
|
||||
set {_uniqueStorage()._dataExtractionNotification = newValue}
|
||||
}
|
||||
/// Returns true if `infoMessage` has been explicitly set.
|
||||
var hasInfoMessage: Bool {return _storage._infoMessage != nil}
|
||||
/// Clears the value of `infoMessage`. Subsequent reads from it will return its default value.
|
||||
mutating func clearInfoMessage() {_uniqueStorage()._infoMessage = nil}
|
||||
/// Returns true if `dataExtractionNotification` has been explicitly set.
|
||||
var hasDataExtractionNotification: Bool {return _storage._dataExtractionNotification != nil}
|
||||
/// Clears the value of `dataExtractionNotification`. Subsequent reads from it will return its default value.
|
||||
mutating func clearDataExtractionNotification() {_uniqueStorage()._dataExtractionNotification = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
|
@ -285,13 +285,13 @@ struct SessionProtos_KeyPair {
|
|||
fileprivate var _privateKey: Data? = nil
|
||||
}
|
||||
|
||||
struct SessionProtos_InfoMessage {
|
||||
struct SessionProtos_DataExtractionNotification {
|
||||
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
||||
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||
// methods supported on all messages.
|
||||
|
||||
/// @required
|
||||
var type: SessionProtos_InfoMessage.TypeEnum {
|
||||
var type: SessionProtos_DataExtractionNotification.TypeEnum {
|
||||
get {return _type ?? .screenshot}
|
||||
set {_type = newValue}
|
||||
}
|
||||
|
@ -341,13 +341,13 @@ struct SessionProtos_InfoMessage {
|
|||
|
||||
init() {}
|
||||
|
||||
fileprivate var _type: SessionProtos_InfoMessage.TypeEnum? = nil
|
||||
fileprivate var _type: SessionProtos_DataExtractionNotification.TypeEnum? = nil
|
||||
fileprivate var _timestamp: UInt64? = nil
|
||||
}
|
||||
|
||||
#if swift(>=4.2)
|
||||
|
||||
extension SessionProtos_InfoMessage.TypeEnum: CaseIterable {
|
||||
extension SessionProtos_DataExtractionNotification.TypeEnum: CaseIterable {
|
||||
// Support synthesized by the compiler.
|
||||
}
|
||||
|
||||
|
@ -1435,7 +1435,7 @@ extension SessionProtos_Content: SwiftProtobuf.Message, SwiftProtobuf._MessageIm
|
|||
5: .same(proto: "receiptMessage"),
|
||||
6: .same(proto: "typingMessage"),
|
||||
7: .same(proto: "configurationMessage"),
|
||||
82: .same(proto: "infoMessage"),
|
||||
82: .same(proto: "dataExtractionNotification"),
|
||||
]
|
||||
|
||||
fileprivate class _StorageClass {
|
||||
|
@ -1443,7 +1443,7 @@ extension SessionProtos_Content: SwiftProtobuf.Message, SwiftProtobuf._MessageIm
|
|||
var _receiptMessage: SessionProtos_ReceiptMessage? = nil
|
||||
var _typingMessage: SessionProtos_TypingMessage? = nil
|
||||
var _configurationMessage: SessionProtos_ConfigurationMessage? = nil
|
||||
var _infoMessage: SessionProtos_InfoMessage? = nil
|
||||
var _dataExtractionNotification: SessionProtos_DataExtractionNotification? = nil
|
||||
|
||||
static let defaultInstance = _StorageClass()
|
||||
|
||||
|
@ -1454,7 +1454,7 @@ extension SessionProtos_Content: SwiftProtobuf.Message, SwiftProtobuf._MessageIm
|
|||
_receiptMessage = source._receiptMessage
|
||||
_typingMessage = source._typingMessage
|
||||
_configurationMessage = source._configurationMessage
|
||||
_infoMessage = source._infoMessage
|
||||
_dataExtractionNotification = source._dataExtractionNotification
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1471,7 +1471,7 @@ extension SessionProtos_Content: SwiftProtobuf.Message, SwiftProtobuf._MessageIm
|
|||
if let v = _storage._receiptMessage, !v.isInitialized {return false}
|
||||
if let v = _storage._typingMessage, !v.isInitialized {return false}
|
||||
if let v = _storage._configurationMessage, !v.isInitialized {return false}
|
||||
if let v = _storage._infoMessage, !v.isInitialized {return false}
|
||||
if let v = _storage._dataExtractionNotification, !v.isInitialized {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@ -1485,7 +1485,7 @@ extension SessionProtos_Content: SwiftProtobuf.Message, SwiftProtobuf._MessageIm
|
|||
case 5: try decoder.decodeSingularMessageField(value: &_storage._receiptMessage)
|
||||
case 6: try decoder.decodeSingularMessageField(value: &_storage._typingMessage)
|
||||
case 7: try decoder.decodeSingularMessageField(value: &_storage._configurationMessage)
|
||||
case 82: try decoder.decodeSingularMessageField(value: &_storage._infoMessage)
|
||||
case 82: try decoder.decodeSingularMessageField(value: &_storage._dataExtractionNotification)
|
||||
default: break
|
||||
}
|
||||
}
|
||||
|
@ -1506,7 +1506,7 @@ extension SessionProtos_Content: SwiftProtobuf.Message, SwiftProtobuf._MessageIm
|
|||
if let v = _storage._configurationMessage {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
|
||||
}
|
||||
if let v = _storage._infoMessage {
|
||||
if let v = _storage._dataExtractionNotification {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 82)
|
||||
}
|
||||
}
|
||||
|
@ -1522,7 +1522,7 @@ extension SessionProtos_Content: SwiftProtobuf.Message, SwiftProtobuf._MessageIm
|
|||
if _storage._receiptMessage != rhs_storage._receiptMessage {return false}
|
||||
if _storage._typingMessage != rhs_storage._typingMessage {return false}
|
||||
if _storage._configurationMessage != rhs_storage._configurationMessage {return false}
|
||||
if _storage._infoMessage != rhs_storage._infoMessage {return false}
|
||||
if _storage._dataExtractionNotification != rhs_storage._dataExtractionNotification {return false}
|
||||
return true
|
||||
}
|
||||
if !storagesAreEqual {return false}
|
||||
|
@ -1573,8 +1573,8 @@ extension SessionProtos_KeyPair: SwiftProtobuf.Message, SwiftProtobuf._MessageIm
|
|||
}
|
||||
}
|
||||
|
||||
extension SessionProtos_InfoMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".InfoMessage"
|
||||
extension SessionProtos_DataExtractionNotification: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".DataExtractionNotification"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "type"),
|
||||
2: .same(proto: "timestamp"),
|
||||
|
@ -1605,7 +1605,7 @@ extension SessionProtos_InfoMessage: SwiftProtobuf.Message, SwiftProtobuf._Messa
|
|||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: SessionProtos_InfoMessage, rhs: SessionProtos_InfoMessage) -> Bool {
|
||||
static func ==(lhs: SessionProtos_DataExtractionNotification, rhs: SessionProtos_DataExtractionNotification) -> Bool {
|
||||
if lhs._type != rhs._type {return false}
|
||||
if lhs._timestamp != rhs._timestamp {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
|
@ -1613,7 +1613,7 @@ extension SessionProtos_InfoMessage: SwiftProtobuf.Message, SwiftProtobuf._Messa
|
|||
}
|
||||
}
|
||||
|
||||
extension SessionProtos_InfoMessage.TypeEnum: SwiftProtobuf._ProtoNameProviding {
|
||||
extension SessionProtos_DataExtractionNotification.TypeEnum: SwiftProtobuf._ProtoNameProviding {
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "SCREENSHOT"),
|
||||
2: .same(proto: "MEDIA_SAVED"),
|
||||
|
|
|
@ -35,11 +35,11 @@ message TypingMessage {
|
|||
}
|
||||
|
||||
message Content {
|
||||
optional DataMessage dataMessage = 1;
|
||||
optional ReceiptMessage receiptMessage = 5;
|
||||
optional TypingMessage typingMessage = 6;
|
||||
optional ConfigurationMessage configurationMessage = 7;
|
||||
optional InfoMessage infoMessage = 82;
|
||||
optional DataMessage dataMessage = 1;
|
||||
optional ReceiptMessage receiptMessage = 5;
|
||||
optional TypingMessage typingMessage = 6;
|
||||
optional ConfigurationMessage configurationMessage = 7;
|
||||
optional DataExtractionNotification dataExtractionNotification = 82;
|
||||
}
|
||||
|
||||
message KeyPair {
|
||||
|
@ -49,7 +49,7 @@ message KeyPair {
|
|||
required bytes privateKey = 2;
|
||||
}
|
||||
|
||||
message InfoMessage {
|
||||
message DataExtractionNotification {
|
||||
|
||||
enum Type {
|
||||
SCREENSHOT = 1;
|
||||
|
|
Loading…
Reference in New Issue