diff options
Diffstat (limited to 'opt/profanity/omemo-publish-options.patch')
| -rw-r--r-- | opt/profanity/omemo-publish-options.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/opt/profanity/omemo-publish-options.patch b/opt/profanity/omemo-publish-options.patch new file mode 100644 index 0000000..daabd81 --- /dev/null +++ b/opt/profanity/omemo-publish-options.patch @@ -0,0 +1,55 @@ +Publish OMEMO bundle and device list with publish-options regardless of the +server domain's advertised features. + +connection_supports() only inspects features_by_jid, which connection.c seeds +with the server domain (conn.domain) plus whatever disco#items returns for that +domain. The account's own bare JID -- which is what actually hosts the PEP +service used for OMEMO -- is never added to that table. On deployments whose +host disco#info is trimmed down, the check therefore fails even though the +account itself advertises +http://jabber.org/protocol/pubsub#publish-options. + +Two separate symptoms follow: + + * omemo_bundle_publish() returned early and sent nothing at all, so the + bundles:<device_id> node was never created. Contacts fetching it got + item-not-found and no session could ever be established. + + * omemo_devicelist_publish() published without publish-options, so the + devicelist node was auto-created with the server's default access model + (presence on Prosody) instead of open. Contacts without a presence + subscription could not read the device list, so they never learned which + bundle to request. + +Send publish-options unconditionally in both cases. If a server genuinely +rejects them, the existing recovery paths handle it: _omemo_bundle_publish_result() +falls back to configuring the node explicitly, and _omemo_devicelist_publish_result() +reconfigures on precondition-not-met. + +--- a/src/xmpp/omemo.c ++++ b/src/xmpp/omemo.c +@@ -44,11 +44,7 @@ + + log_debug("[OMEMO] publish device list"); + +- if (connection_supports(XMPP_FEATURE_PUBSUB_PUBLISH_OPTIONS)) { +- stanza_attach_publish_options(ctx, iq, "pubsub#access_model", "open"); +- } else { +- log_debug("[OMEMO] Cannot publish devicelist: no PUBSUB feature announced"); +- } ++ stanza_attach_publish_options(ctx, iq, "pubsub#access_model", "open"); + + iq_id_handler_add(xmpp_stanza_get_id(iq), _omemo_devicelist_publish_result, NULL, NULL); + +@@ -90,11 +86,6 @@ + void + omemo_bundle_publish(gboolean first) + { +- if (!connection_supports(XMPP_FEATURE_PUBSUB_PUBLISH_OPTIONS)) { +- cons_show("OMEMO: Cannot publish bundle: no PUBSUB feature announced"); +- log_debug("[OMEMO] Cannot publish bundle: no PUBSUB feature announced"); +- return; +- } + log_debug("[OMEMO] publish own OMEMO bundle"); + xmpp_ctx_t* const ctx = connection_get_ctx(); + unsigned char* identity_key = NULL; |
