@@ -116,6 +116,11 @@ omemo_devicelist_request(const char* const jid)
116116void
117117omemo_bundle_publish (gboolean first )
118118{
119+ if (!connection_supports (XMPP_FEATURE_PUBSUB_PUBLISH_OPTIONS )) {
120+ cons_show ("OMEMO: Cannot publish bundle: no PUBSUB feature announced" );
121+ log_debug ("[OMEMO] Cannot publish bundle: no PUBSUB feature announced" );
122+ return ;
123+ }
119124 log_debug ("[OMEMO] publish own OMEMO bundle" );
120125 xmpp_ctx_t * const ctx = connection_get_ctx ();
121126 unsigned char * identity_key = NULL ;
@@ -141,14 +146,10 @@ omemo_bundle_publish(gboolean first)
141146 g_list_free (lengths );
142147 g_list_free (ids );
143148
144- if (connection_supports (XMPP_FEATURE_PUBSUB_PUBLISH_OPTIONS )) {
145- stanza_attach_publish_options_va (ctx , iq ,
146- 4 , // 2 * number of key-value pairs
147- "pubsub#persist_items" , "true" ,
148- "pubsub#access_model" , "open" );
149- } else {
150- log_debug ("[OMEMO] Cannot publish bundle: no PUBSUB feature announced" );
151- }
149+ stanza_attach_publish_options_va (ctx , iq ,
150+ 4 , // 2 * number of key-value pairs
151+ "pubsub#persist_items" , "true" ,
152+ "pubsub#access_model" , "open" );
152153
153154 iq_id_handler_add (id , _omemo_bundle_publish_result , NULL , GINT_TO_POINTER (first ));
154155
0 commit comments