Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to register a user to openfire server by using xmpp.js #599

Closed
jishaofeng89 opened this issue Nov 22, 2018 · 3 comments
Closed

How to register a user to openfire server by using xmpp.js #599

jishaofeng89 opened this issue Nov 22, 2018 · 3 comments

Comments

@jishaofeng89
Copy link

I have build an openfire server, but i don't know how to create a user account to server by using xmppjs, is there simple case for reference

@pc-magas
Copy link

pc-magas commented Jan 6, 2019

On a similar case (handling presenc stanzas and roster) I implemented the login on myself by calling the message handling functions into the callback function of the following callback: xmpp.on('stanza')

xmpp.on('stanza', (stanza) => {
    const messageString = stanza.toString();
    try {
      if (new RegExp('<iq\s*.*>\s*<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">.*<\/bind><\/iq>').test(messageString)) return;
      if (presenceReply(stanza, webContents) !== false) return;
      // eslint-disable-next-line no-useless-return
      if (handleRoster(stanza, webContents) !== false) return;
      if (pingReply(stanza) !== false) return;
      if (handleMessageStanza(stanza, webContents) !== false) return;
    } catch (e) {
      console.error('Stanza Processing', e.toString());
      console.error('Error Trace', e.stack);
    }
  });

In other words as fart the documentation says there's no some sort of plugin to support that.

@sonnyp
Copy link
Member

sonnyp commented May 16, 2019

There's no official support in the library (yet?).

Shouldn't be too hard to do https://xmpp.org/extensions/xep-0389.html

@sonnyp
Copy link
Member

sonnyp commented Oct 4, 2019

closing in favor of #783

@sonnyp sonnyp closed this as completed Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants