Skip to content

WIP: Converse.JS XMPP chat integration

Roman Chvanikov requested to merge chvanikoff/pleroma:feature/xmpp-chat into develop

This PR adds XMPP chat support via Converse.JS to the Pleroma.

It can be enabled during instance setup (mix pleroma.instance gen), or by manually updating config keys pleroma.xmpp.enabled = true and pleroma.xmpp.host = "http://site.tld"

Authorization flow is following:

  1. User logs in to Pleroma instance
  2. If XMPP integration is enabled, Pleroma makes a request to authorize the user with the given username/password on the XMPP server (assuming the XMPP server uses Pleroma instance to auth a user)
  3. Pleroma receives auth session id from XMPP and stores it in user session
  4. On client side, we make a request to server to get JID, prebind url (which is on the pleroma instance, so might not be needed), and XMPP server url
  5. Converse.js calls prebind url that returns stored authorised XMPP session id (SID)
  6. Converse.js uses the SID to connect to the XMPP server

Currently, I've added Converse.JS static files (JS/CSS/Webfonts), I guess we should fix the version and bundle it along with our JS on FE. Also, we should move the naive JS code I wrote for the demo purpose into the JS bundle on FE.

Edited by Roman Chvanikov

Merge request reports