Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const SubDoLubDub = (client, stanzas) => {
- const types = stanzas.utils;
- const Event = stanzas.define({
- name: '_event',
- element: 'event',
- fields: {
- node: types.attribute('node'),
- },
- });
- const Subscribe = stanzas.define({
- name: 'mucsub',
- namespace: 'urn:xmpp:mucsub:0',
- element: 'subscribe',
- fields: {
- nick: types.attribute('nick'),
- events: types.multiExtension(Event),
- }
- });
- stanzas.withIQ((IQ) => {
- stanzas.extend(IQ, Subscribe);
- });
- };
- const client = XMPP.createClient({
- ...
- });
- client.use(SubDoLubDub);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement