qxmpp
qxmpp copied to clipboard
Introduce QXmppAccountMigrationManager
This manager allows to export and import account data to migrate account into another server.
PR check list:
- [ ] Document your code
- [ ] Add
\since QXmpp 1.X
,QXMPP_EXPORT
- [ ] Fix doxygen warnings (see log when building with
-DBUILD_DOCUMENTATION=ON
) - [ ] Update
doc/doap.xml
- [x] Add unit tests
- [x] Format the code: Run
clang-format -i src/<edited-file(s)> tests/<edited-file(s)>
Funded by NLnet via NGI Zero Entrust.
Sorry for the delay. My idea is to make it possible to add new extensions without modifying QXmpp. It's not that easy to explain how to implement that without giving examples, so I did a proof-of-concept now. See https://github.com/lnjX/qxmpp/commit/167985330a1fbf2057deaa3a16646bec29e86ddc. I didn't do many tests whether everything works though. Feel free to ask if you have any questions.
The idea is basically:
- you can register extension types for an AccountData class by giving a parse, serialize function and the std::type_index (so AccountData can relate the functions with extensions of type std::any)
- you can register managers with import/export functions and a data type they consume/generate
Sorry for the delay. My idea is to make it possible to add new extensions without modifying QXmpp. It's not that easy to explain how to implement that without giving examples, so I did a proof-of-concept now. See lnjX@1679853. I didn't do many tests whether everything works though. Feel free to ask if you have any questions.
The idea is basically:
- you can register extension types for an AccountData class by giving a parse, serialize function and the std::type_index (so AccountData can relate the functions with extensions of type std::any)
- you can register managers with import/export functions and a data type they consume/generate
Hey, thanks for the feedback. I will read that and come back with updated MR at a later time.
Sorry for the delay. My idea is to make it possible to add new extensions without modifying QXmpp. It's not that easy to explain how to implement that without giving examples, so I did a proof-of-concept now. See lnjX@1679853. I didn't do many tests whether everything works though. Feel free to ask if you have any questions.
The idea is basically:
- you can register extension types for an AccountData class by giving a parse, serialize function and the std::type_index (so AccountData can relate the functions with extensions of type std::any)
- you can register managers with import/export functions and a data type they consume/generate
I finally pushed a refactoring around your idea. I have 2 remaining issues:
- For the unit tests, I don't know how I can use a fake client to send data (ie, when importing data, I need to sendIq)
- In QXmppAccountData you added registration helper to serialize / unserialize QXmppAccountData documents, I'm not sure from where I should register those helpers ?
- In QXmppAccountData you added registration helper to serialize / unserialize QXmppAccountData documents, I'm not sure from where I should register those helpers ?
I haven't fully thought this through, but I think registering those in the ctor of the corresponding managers should work.