Fix OMEMO devicelist access model by reconfiguring it#1591
Fix OMEMO devicelist access model by reconfiguring it#1591jubalh merged 7 commits intoprofanity-im:masterfrom
Conversation
986c921 to
4d93df4
Compare
|
Awesome! Thanks for this! |
| } | ||
|
|
||
| if (g_strcmp0(xmpp_stanza_get_name(pubsub_error), "precondition-not-met") == 0) { | ||
| static gboolean reconfigured = false; |
There was a problem hiding this comment.
I'm unsure whether this works as intended.
There was a problem hiding this comment.
we will after the first run always be in true but it could be that we switch accounts without restarting profanity. or it could be that we need to republish because while profanity was running another client did something to the devicelist and we need to republish.
I asked around and heard that the auto-create is pretty common. So we probably don't have to bother with adding the fallback. |
|
There is the corner case with the static variable mentioned in the review above. Instead of using a static variable we maybe could also pass it along the userdata parameter. That's a long line of calls. According to paul:
omemo_devicelist_request and _handle_own_device_list seem to be not so easy. The corner cases probably will be quite rare anyways. |
|
The issue with the static boolean could arise in two cases:
|
Fix #1538
Handle precondition-not-met returned when inserting our device in the device list. Try to reconfigure it properly and give up if it fails again.
Also add support for missing device list node. It rely on auto-create. We should ensure this feature is enabled and fallback to a proper create with config otherwise.