36 lines
981 B
Swift
36 lines
981 B
Swift
|
// XEP-0030
|
||
|
import Foundation
|
||
|
|
||
|
// TODO: Implement
|
||
|
final class DiscoveryModule: XmppModule {
|
||
|
let id = "Discovery module"
|
||
|
|
||
|
private let reqId = ""
|
||
|
|
||
|
func reduce(oldState: ClientState, with _: Event) -> ClientState {
|
||
|
oldState
|
||
|
}
|
||
|
|
||
|
func process(state _: ClientState, with _: Event) async -> Event? {
|
||
|
// switch event {
|
||
|
// case .streamReady:
|
||
|
// let req = Stanza.iqGet(payload: XMLElement(name: "query", xmlns: "http://jabber.org/protocol/disco#info", attributes: [:], content: nil, nodes: []))
|
||
|
// if let req {
|
||
|
// return .stanzaOutbound(req)
|
||
|
// } else {
|
||
|
// return nil
|
||
|
// }
|
||
|
//
|
||
|
// case .stanzaInbound(let stanza):
|
||
|
// if stanza.id == reqId && stanza.type == .iq(.result) {
|
||
|
// print(stanza)
|
||
|
// return nil
|
||
|
// }
|
||
|
//
|
||
|
// default:
|
||
|
// return nil
|
||
|
// }
|
||
|
nil
|
||
|
}
|
||
|
}
|