OMEMO - Unable to publish own device list
If we are not able to publish our own device list, we just ignored it. This commit will show at least an error message and informs the user that this device is currently not in the list of devices. See Issue: #1538 Next task will be to handle the <precondition-not-met/> conflict properly.
This commit is contained in:
committed by
Michael Vetter
parent
956fd547c1
commit
41913a0aea
@@ -51,6 +51,8 @@ static int _omemo_bundle_publish_result(xmpp_stanza_t* const stanza, void* const
|
||||
static int _omemo_bundle_publish_configure(xmpp_stanza_t* const stanza, void* const userdata);
|
||||
static int _omemo_bundle_publish_configure_result(xmpp_stanza_t* const stanza, void* const userdata);
|
||||
|
||||
static int _omemo_device_list_publish_result(xmpp_stanza_t* const stanza, void* const userdata);
|
||||
|
||||
void
|
||||
omemo_devicelist_subscribe(void)
|
||||
{
|
||||
@@ -71,6 +73,8 @@ omemo_devicelist_publish(GList* device_list)
|
||||
stanza_attach_publish_options(ctx, iq, "pubsub#access_model", "open");
|
||||
}
|
||||
|
||||
iq_id_handler_add(xmpp_stanza_get_id(iq), _omemo_device_list_publish_result, NULL, NULL);
|
||||
|
||||
iq_send_stanza(iq);
|
||||
xmpp_stanza_release(iq);
|
||||
}
|
||||
@@ -608,3 +612,15 @@ _omemo_bundle_publish_configure_result(xmpp_stanza_t* const stanza, void* const
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
_omemo_device_list_publish_result(xmpp_stanza_t* const stanza, void* const userdata)
|
||||
{
|
||||
const char* type = xmpp_stanza_get_type(stanza);
|
||||
if (g_strcmp0(type, STANZA_TYPE_ERROR) == 0) {
|
||||
cons_show_error("Unable to publish own OMEMO device list");
|
||||
log_error("[OMEMO] Publishing device list failed");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user