another.im-ios/AnotherIM/xmpp/modules/disco/DiscoveryModule.swift

36 lines
981 B
Swift
Raw Normal View History

2024-12-16 08:04:14 +00:00
// 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
}
}