about summary refs log tree commit diff stats
path: root/src/command/cmd_funcs.c
diff options
context:
space:
mode:
authorPaul Fariello <paul@fariello.eu>2019-04-01 13:14:46 +0200
committerPaul Fariello <paul@fariello.eu>2019-04-10 17:23:46 +0200
commit898302243e2890c0d2ffc6c48451718e43a85d23 (patch)
tree23c93f605eb52c5819678ffd004892cc0485c899 /src/command/cmd_funcs.c
parent5cd2b8dc9d7823d479dff33adc2c916ba1b772e0 (diff)
downloadprofani-tty-898302243e2890c0d2ffc6c48451718e43a85d23.tar.gz
Add clear_device_list command
Diffstat (limited to 'src/command/cmd_funcs.c')
-rw-r--r--src/command/cmd_funcs.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 369a992f..c2696c31 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -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
+}