mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
740 B
Swift
25 lines
740 B
Swift
2 years ago
|
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
||
|
|
||
|
import Foundation
|
||
|
|
||
|
extension SnodeAPI {
|
||
|
/// This is the legacy unauthenticated message store request
|
||
|
public struct LegacySendMessagesRequest: Encodable {
|
||
|
enum CodingKeys: String, CodingKey {
|
||
|
case namespace
|
||
|
}
|
||
|
|
||
|
let message: SnodeMessage
|
||
|
let namespace: SnodeAPI.Namespace
|
||
|
|
||
|
// MARK: - Coding
|
||
|
|
||
|
public func encode(to encoder: Encoder) throws {
|
||
|
var container: KeyedEncodingContainer<CodingKeys> = encoder.container(keyedBy: CodingKeys.self)
|
||
|
|
||
|
try message.encode(to: encoder)
|
||
|
try container.encode(namespace, forKey: .namespace)
|
||
|
}
|
||
|
}
|
||
|
}
|