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

Archived messages not loading for chat ids containing @ (\40) character #560

Closed
90degreenorth opened this issue Jun 18, 2017 · 6 comments
Closed

Comments

@90degreenorth
Copy link

Hello,

Thank you for creating this library. Message archiving is one of the main chat requirements for our project, so we are very happy to see it included in the latest release. However, facing one issue while loading the message history…

Our requirement is to have chat ids as email ids e.g.. username@example.com@chatserver. While registering on the xmpp server(ejabberd in our case), the ids get created correctly as username\40example.com@chatserver. We made some changes to the jsxc code to enable adding contact in this format and all is working fine. However when clicked on “Load older messages”, nothing appears. With ids without a \40, the archived messages get loaded perfectly fine.

Is it possible to provide support for this requirement? Do let me know if you need any more details.

Thank you.

@sualko
Copy link
Member

sualko commented Jun 19, 2017

As you can see in #501, JID escaping was requested before, but not implemented yet. So it would be awesome if you could share your enhancement with the community and I could help even you better if I know which changes you did.

@MarcelWaldvogel
Copy link
Contributor

MarcelWaldvogel commented Jun 20, 2017 via email

@90degreenorth
Copy link
Author

Thank you for your responses.

@MarcelWaldvogel, our organisation does provide mail and chat but we have multiple mail domains and chat is common for all. Eg. user1@example1.com can chat with user2@example2.com

@sualko, I am not sure if the changes we made can be integrated here as they are very specific to our project. We have avoided the special character validation as below -

  1. usernames(containing \40) are registered in a separate application flow using smack library

  2. Modified the jsxc Add Contact form to accept username and select one of the domain names specific to our organisation
    addcontact

  3. Display complete username (containing @) in the roster

Like you mentioned in #501, using bid instead of jid is probably causing the issue in retrieving archived messages.

@MarcelWaldvogel
Copy link
Contributor

MarcelWaldvogel commented Jun 20, 2017

One of the beauties of XMPP is that it works seamless in a federation. It does not matter to a user whether (s)he is

  1. in the same domain,
  2. in a different domain hosted on the same server, or
  3. in a different domain on a different server.

Rosters, MUC, … all work seamlessly across the federation, unless restricted by an admin.

I would suggest changing to a single server with a vhost per internal domain, as there are many benefits of having identical mail and XMPP addresses.

@MarcelWaldvogel
Copy link
Contributor

(I fully agree with you that JSXC should be able to deal with JID escaping.)

@sualko
Copy link
Member

sualko commented Jun 20, 2017

I would assume that the jid is not properly escaped at jsxc.lib.xmpp.mam.js#L42 and therefore the resulting stanza is invalid. Try to enable debugging and use Strophe.escapeNode at this position.

@sualko sualko closed this as completed Jun 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants