[WIP] Split OMEMO plugin into view and headless components
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
omemoplugin separately - [x] move headless event handlers to headless version
- [x] move over other headless dependency files as appropriate
- [x] create and register the headless
- [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 checkor you can run them in the browser by runningmake serveand then openinghttp://localhost:8000/tests.html.
@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:
@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 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 @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!
@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: Any progress on it?
@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?)
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:
@MirwaisAkrami would you be interested in helping with the rebase?
@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.
Hi @badrihippo, did you get time to wrap up this good work?
Done here: https://github.com/conversejs/converse.js/pull/3789