I’m exploriing the idea that would be the “reverse” of Libervia: an offline-first AcitivityPub application that keeps all information in the client and only relies on the server to be the receiver of the inbox messages. To make sure that the client can synchronize properly, I am considering two approaches:
- The server and the client need to use the same database which has a replication protocol (like CouchDB/PouchDB)
- The server receives the messages in the inbox via HTTP, but relays to the client via XMPP.
The first idea simplifies things a bit, but forces the client to use a specific tech stack. I’m also not sure if the server needs to have everything replicated, just the messages that the device haven’t seen yet.
I’d also be interested in something like MUC, because I would use to let the server use rooms for things like Mastodon’s “follow tags”.
Lastly, because I’m planning to do this as a browser extension, it would have to be something that runs on the browser. xmpp.js seems like a good candidate (lots of contributors and reasonably well documented), but the last commit was from two years ago. Is it still being used/maintained? If not, is there any other recommendation?
Javascript libraries are not in the best shape, but you could try to use the headless version of ConverseJS.
Edit: there is a version of ConverseJS that works as a browser plugin called “Pade” if I recall correctly. Might be a good reference point.
Thanks. I’ve seen ConverseJS but it seems overkill to what I have in mind. Is there any part of the modules that can be taken out of the main code base and used just to authenticate and receive the messages?
I think it uses this internally: https://github.com/strophe/strophejs
There is also: https://github.com/legastero/stanza
That looks more like it! I will try them out and report back how it went. Thank you very much!