summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gui.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gui.c b/gui.c
index 6d0d267..2b4a2a2 100644
--- a/gui.c
+++ b/gui.c
@@ -19,6 +19,7 @@
#include <SDL2/SDL.h>
#include <stdbool.h>
+#include <unistd.h>
#include "xmpp.h"
@@ -65,6 +66,9 @@ void gui_run(void) {
case SDL_MOUSEBUTTONDOWN:
if (xmpp_fd == -1) {
xmpp_fd = xmpp_connect();
+ } else {
+ close(xmpp_fd);
+ printf("Closed XMPP connection.\n");
}
break;
}