mirror of
https://github.com/lux-tel/session-ios.git
synced 2026-10-30 20:38:32 +00:00
• Cleaned up API structures to be more consistent • Moved OpenGroupAPI into SessionNetworkingKit • Moved PushNotificationAPI into SessionNetworkingKit • Renamed to OpenGroupAPI to SOGSAPI
25 lines
749 B
Swift
25 lines
749 B
Swift
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import Foundation
|
|
|
|
extension Network.SnodeAPI {
|
|
/// This is the legacy unauthenticated message store request
|
|
struct LegacySendMessagesRequest: Encodable {
|
|
enum CodingKeys: String, CodingKey {
|
|
case namespace
|
|
}
|
|
|
|
let message: SnodeMessage
|
|
let namespace: Network.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)
|
|
}
|
|
}
|
|
}
|