From e9f218cdf6e15f4469d77cbaee59cc8501ed4e82 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Tue, 3 May 2022 18:20:11 +0200 Subject: [PATCH] ox: use pubsub acces model open when announce ox public key --- src/xmpp/ox.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xmpp/ox.c b/src/xmpp/ox.c index 0fa5cece..ce43ed89 100644 --- a/src/xmpp/ox.c +++ b/src/xmpp/ox.c @@ -143,6 +143,13 @@ ox_announce_public_key(const char* const filename) xmpp_stanza_add_child(publish, item); xmpp_stanza_add_child(pubsub, publish); xmpp_stanza_add_child(iq, pubsub); + + if (connection_supports(XMPP_FEATURE_PUBSUB_PUBLISH_OPTIONS)) { + stanza_attach_publish_options(ctx, iq, "pubsub#access_model", "open"); + } else { + log_debug("[OX] Cannot publish public key: no PUBSUB feature announced"); + } + xmpp_send(connection_get_conn(), iq); _ox_metadata_node__public_key(fp);