about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPaul Fariello <paul@fariello.eu>2019-03-25 07:17:57 +0140
committerPaul Fariello <paul@fariello.eu>2019-04-10 17:12:31 +0200
commit2fd2ca208cf9c191453f923722df3b9630ba9ff5 (patch)
treec39dd4e78ba8ca9a0be652d081437297e96da426
parent306706bd2efa61f44a9234241d5de60c8e286abd (diff)
downloadprofani-tty-2fd2ca208cf9c191453f923722df3b9630ba9ff5.tar.gz
Use connection_support to check for publish-options support
-rw-r--r--src/xmpp/omemo.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/xmpp/omemo.c b/src/xmpp/omemo.c
index 6c57781b..4fcca699 100644
--- a/src/xmpp/omemo.c
+++ b/src/xmpp/omemo.c
@@ -23,11 +23,9 @@ 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)) {
+    if (connection_supports(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);
@@ -74,11 +72,9 @@ omemo_bundle_publish(void)
     g_list_free(lengths);
     g_list_free(ids);
 
-    Jid *jid = jid_create(connection_get_fulljid());
-    if (caps_jid_has_feature(jid->barejid, XMPP_FEATURE_PUBSUB_PUBLISH_OPTIONS)) {
+    if (connection_supports(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);