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

[XEP-0106] Unallowed chars in username #501

Closed
Broatcast opened this Issue Mar 23, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@Broatcast
Copy link

Broatcast commented Mar 23, 2017

It's a known problem that unallowed chars in the username like a space for example will crash the functionaltiy of jsxc, i looked a lot over the source but i'am a php dev and dont have any plan about js.

Meanwhile many app's exist where are chars allowed in user/login name which are not allowed in the xmpp protocol. But it's ontemporary and not able to disallow or modify this apps to use this chars. Like boards, blogs and other webapps.
For me i'am currently dev a plugin for integrate jsxc into MyBB the plugin work great and i love the idea behind making xmpp great again and use it for webchats in apps.

So i looked into the code of jsxc (very clean by the way ;)) and try to find a global point for the username to do something like a replace. But my js skills like i sayed are realy crap. Then i thinked about how to solve this problem globaly.

My idea at this point is to create an option with a char that get placed where the unallowed chars are, this give the ability for any user/admin who integrate jsxc in his app to decide for his own to replace all bad chars with an "_" for example.

This option should be optional settable in the init, for example:

var settings = {
    xmpp: {
      url: '/http-bind/',
      domain: 'example.com',
      resource: 'example.com',
      overwrite: true,
      onlogin: true,
      replacebadchars: '_'
    }
  };

Now jsxc know to replace all unallowed/bad chars with the '_'.

I hope you understand my suggestion. And sry for my bad english.

@sualko

This comment has been minimized.

Copy link
Member

sualko commented Mar 24, 2017

XEP-0106 is probably the more standard way and there is already a function in the underlying XMPP lib for that (Strophe.escapeNode). While we are using the bare jid as identifier at multiple points, I am afraid that this would lead to side effects. I will consider this for 4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment