converse.js icon indicating copy to clipboard operation
converse.js copied to clipboard

[WIP] Split OMEMO plugin into view and headless components

Open badrihippo opened this issue 3 years ago • 10 comments

This commit replaces src/omemo with plugins/omemo-views and headless/plugins/omemo. The way I'm working on this is to keep everything on omemo-views for now, and then gradually move whatever possible out to the headless omemo.

Files to be tackled (more will be added as events warrant):

  • [x] util
    • [x] copy the functions whole
    • [x] break up the functions which have UI and non-UI parts to them
  • [x] index
    • [x] create and register the headless omemo plugin separately
    • [x] move headless event handlers to headless version
    • [x] move over other headless dependency files as appropriate
  • [x] miscellaneous small files which can mostly be copied over directly

Standard steps to finish before completing pull request:

  • [ ] Add a changelog entry for your change in CHANGES.md
  • [x] When adding a configuration variable, please make sure to document it in docs/source/configuration.rst
  • [ ] Please add a test for your change. Tests can be run in the commandline with make check or you can run them in the browser by running make serve and then opening http://localhost:8000/tests.html.

badrihippo avatar Jan 08 '23 15:01 badrihippo

@jcbrand thanks for the comments! Just letting you know I've seen them; will get onto it once I've processed index.js :construction_worker:

badrihippo avatar Jan 11 '23 13:01 badrihippo

@jcbrand I have a problem: the omemo-views plugin seems to be working, but the headless/omemo does not.

Symptom: I get a converse.api.omemo.generateKeys() is not defined when keys are to be generated. This function is set during the the initialize() function of headless/omemo.

Debugging: I tried adding a test console.log inside the initialize() function, and as I suspected it wasn't running. (A similar console.log line inside omemo-views/initialize() printed properly.

I tried importing the headless plugin to src/headless/index.js as well as to src/plugins/omemo-views/index.js, which is how it done for other plugins (like chatbox-views) but that didn't help either. Any idea what I could be missing?

badrihippo avatar Jan 24 '23 13:01 badrihippo

@badrihippo Yes, I think I know what the issue is.

You need to add converse-omemo to the list of headless plugins at src/headless/shared/constants.js.

That is necessary in order to register it as a pluggable.js plugin. Otherwise, even though you import it, it's not registered as a plugin and the initialize function doesn't get called.

jcbrand avatar Jan 26 '23 08:01 jcbrand

@jcbrand @badrihippo hi, I'm interested in using the converse headless but it doesn't support omemo? any eta on this pr to make it possible? thanks!

timothyerwin avatar Apr 09 '23 19:04 timothyerwin

@jcbrand @badrihippo hi, I'm interested in using the converse headless but it doesn't support omemo? any eta on this pr to make it possible? thanks!

Well, I guess this has become stale :slightly_frowning_face: and also, I've forgotten half of what I did. But let me start afresh and see if I can do a better job this time...

badrihippo avatar Aug 30 '23 11:08 badrihippo

@badrihippo: Any progress on it?

Neustradamus avatar Oct 25 '24 11:10 Neustradamus

@Neustradamus I'm afraid not :slightly_frowning_face: I think I got quite close, but I haven't had time to work on it since that last commit. I think I got pretty close, so if anyone is willing to clone and do the last few fixes to get it running that would help. (@timothyerwin would you be interested?)

badrihippo avatar Oct 26 '24 04:10 badrihippo

Hi all. Finally, an update on this! I (re)set up my ConverseJS development environment, and rebased the headless thing onto the latest master. I haven't pushed it yet as I'm still ironing out a few issues (missing, or more likely misplaced, functions), but thought I'd post an update to let people know I am now back in action :construction_worker:

badrihippo avatar Apr 05 '25 17:04 badrihippo

@MirwaisAkrami would you be interested in helping with the rebase?

badrihippo avatar Apr 22 '25 10:04 badrihippo

@MirwaisAkrami would you be interested in helping with the rebase?

I would love to, though I am pretty new to the XMPP protocol and Conversejs. Just started exploring it a couple of weeks ago. So, if you think I can contribute, then please guide me a bit, so that I will start working on it.

MirwaisAkrami avatar Apr 23 '25 07:04 MirwaisAkrami

Hi @badrihippo, did you get time to wrap up this good work?

MirwaisAkrami avatar Jul 06 '25 06:07 MirwaisAkrami

Done here: https://github.com/conversejs/converse.js/pull/3789

jcbrand avatar Aug 10 '25 11:08 jcbrand