From 2602ba91fb804224aeece0c9abf1abcbc2345403 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 8 Jan 2023 18:43:45 +0100 Subject: Implement close on click This adds the option to close the XMPP connection. --- gui.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gui.c b/gui.c index 6d0d267..2b4a2a2 100644 --- a/gui.c +++ b/gui.c @@ -19,6 +19,7 @@ #include #include +#include #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; } -- cgit v1.2.3-70-g09d2