2025-11-05 17:04:23 -03:00

14 lines
417 B
JavaScript

import xml from "@xmpp/xml";
// https://tools.ietf.org/html/draft-cridland-xmpp-session-01
const NS = "urn:ietf:params:xml:ns:xmpp-session";
export default function sessionEstablishment({ iqCaller, streamFeatures }) {
streamFeatures.use("session", NS, async (context, next, feature) => {
if (feature.getChild("optional")) return next();
await iqCaller.set(xml("session", NS));
return next();
});
}