1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Use connection_support to check for publish-options support

This commit is contained in:
Paul Fariello 2019-03-25 07:17:57 +01:40
parent 306706bd2e
commit 2fd2ca208c

View File

@ -23,11 +23,9 @@ omemo_devicelist_publish(GList *device_list)
xmpp_ctx_t * const ctx = connection_get_ctx(); xmpp_ctx_t * const ctx = connection_get_ctx();
xmpp_stanza_t *iq = stanza_create_omemo_devicelist_publish(ctx, device_list); xmpp_stanza_t *iq = stanza_create_omemo_devicelist_publish(ctx, device_list);
Jid *jid = jid_create(connection_get_fulljid()); if (connection_supports(XMPP_FEATURE_PUBSUB_PUBLISH_OPTIONS)) {
if (caps_jid_has_feature(jid->barejid, XMPP_FEATURE_PUBSUB_PUBLISH_OPTIONS)) {
stanza_attach_publish_options(ctx, iq, "pubsub#access_model", "open"); stanza_attach_publish_options(ctx, iq, "pubsub#access_model", "open");
} }
jid_destroy(jid);
iq_send_stanza(iq); iq_send_stanza(iq);
xmpp_stanza_release(iq); xmpp_stanza_release(iq);
@ -74,11 +72,9 @@ omemo_bundle_publish(void)
g_list_free(lengths); g_list_free(lengths);
g_list_free(ids); g_list_free(ids);
Jid *jid = jid_create(connection_get_fulljid()); if (connection_supports(XMPP_FEATURE_PUBSUB_PUBLISH_OPTIONS)) {
if (caps_jid_has_feature(jid->barejid, XMPP_FEATURE_PUBSUB_PUBLISH_OPTIONS)) {
stanza_attach_publish_options(ctx, iq, "pubsub#access_model", "open"); stanza_attach_publish_options(ctx, iq, "pubsub#access_model", "open");
} }
jid_destroy(jid);
iq_send_stanza(iq); iq_send_stanza(iq);
xmpp_stanza_release(iq); xmpp_stanza_release(iq);