2022-04-01 08:22:45 +02:00
|
|
|
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
2020-11-11 00:58:56 +01:00
|
|
|
|
2022-04-01 08:22:45 +02:00
|
|
|
import Foundation
|
|
|
|
import SessionSnodeKit
|
2022-06-01 09:41:20 +02:00
|
|
|
import SessionUtilitiesKit
|
2020-11-11 00:58:56 +01:00
|
|
|
|
2022-04-01 08:22:45 +02:00
|
|
|
public extension SNProtoEnvelope {
|
|
|
|
static func from(_ message: SnodeReceivedMessage) -> SNProtoEnvelope? {
|
|
|
|
guard let result = try? MessageWrapper.unwrap(data: message.data) else {
|
|
|
|
SNLog("Failed to unwrap data for message: \(String(reflecting: message)).")
|
2020-11-11 00:58:56 +01:00
|
|
|
return nil
|
|
|
|
}
|
2022-04-01 08:22:45 +02:00
|
|
|
|
2020-11-11 00:58:56 +01:00
|
|
|
return result
|
|
|
|
}
|
|
|
|
}
|