Add clear_device_list command

This commit is contained in:
Paul Fariello
2019-04-01 13:14:46 +02:00
parent 5cd2b8dc9d
commit 898302243e
4 changed files with 28 additions and 4 deletions

View File

@@ -87,6 +87,7 @@
#ifdef HAVE_OMEMO
#include "omemo/omemo.h"
#include "xmpp/omemo.h"
#endif
#ifdef HAVE_GTK
@@ -8268,3 +8269,21 @@ cmd_omemo_untrust(ProfWin *window, const char *const command, gchar **args)
return TRUE;
#endif
}
gboolean
cmd_omemo_clear_device_list(ProfWin *window, const char *const command, gchar **args)
{
#ifdef HAVE_OMEMO
if (connection_get_status() != JABBER_CONNECTED) {
cons_show("You must be connected with an account to initialize OMEMO.");
return TRUE;
}
omemo_devicelist_publish(NULL);
cons_show("Cleared OMEMO device list");
return TRUE;
#else
cons_show("This version of Profanity has not been built with OMEMO support enabled");
return TRUE;
#endif
}