about summary refs log tree commit diff stats
path: root/src/xmpp/omemo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp/omemo.c')
-rw-r--r--src/xmpp/omemo.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/xmpp/omemo.c b/src/xmpp/omemo.c
index 16610cb5..1a10e374 100644
--- a/src/xmpp/omemo.c
+++ b/src/xmpp/omemo.c
@@ -22,6 +22,13 @@ omemo_devicelist_publish(GList *device_list)
 {
     xmpp_ctx_t * const ctx = connection_get_ctx();
     xmpp_stanza_t *iq = stanza_create_omemo_devicelist_publish(ctx, device_list);
+
+    Jid *jid = jid_create(connection_get_fulljid());
+    if (caps_jid_has_feature(jid->barejid, XMPP_FEATURE_PUBSUB_PUBLISH_OPTIONS)) {
+        stanza_attach_publish_options(ctx, iq, "pubsub#access_model", "open");
+    }
+    jid_destroy(jid);
+
     iq_send_stanza(iq);
     xmpp_stanza_release(iq);
 }
@@ -62,6 +69,13 @@ omemo_bundle_publish(void)
         identity_key, identity_key_length, signed_prekey, signed_prekey_length,
         signed_prekey_signature,  signed_prekey_signature_length,
         prekeys, ids, lengths);
+
+    Jid *jid = jid_create(connection_get_fulljid());
+    if (caps_jid_has_feature(jid->barejid, XMPP_FEATURE_PUBSUB_PUBLISH_OPTIONS)) {
+        stanza_attach_publish_options(ctx, iq, "pubsub#access_model", "open");
+    }
+    jid_destroy(jid);
+
     iq_send_stanza(iq);
     xmpp_stanza_release(iq);