Add publish option to OMEMO device list and bundle

This commit is contained in:
Paul Fariello
2019-03-19 18:40:24 +01:40
parent 9044e3732c
commit d8f0bcef94
4 changed files with 57 additions and 0 deletions

View File

@@ -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);