WIP: Converse.JS XMPP chat integration
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:
- User logs in to Pleroma instance
- 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)
- Pleroma receives auth session id from XMPP and stores it in user session
- 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
- Converse.js calls prebind url that returns stored authorised XMPP session id (SID)
- 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.