aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacki <jacki@thejackimonster.de>2024-07-21 17:39:17 +0200
committerJacki <jacki@thejackimonster.de>2024-07-21 17:39:17 +0200
commitc563c16448fcd1439fe1c0dde8f500e16a59af88 (patch)
treeb011bb4726efe1a27ef520fa84369f84d7b0ac26
parent28617e2c834102997101eccebfdeff6e1b82c4e7 (diff)
parent8e629200ae1e2187eddda70093f75ea5e42426a7 (diff)
downloadmessenger-gtk-c563c16448fcd1439fe1c0dde8f500e16a59af88.tar.gz
messenger-gtk-c563c16448fcd1439fe1c0dde8f500e16a59af88.zip
Merge branch 'master' of ssh://git.gnunet.org/messenger-gtk
-rw-r--r--src/application.c3
-rw-r--r--src/chat/messenger.c25
-rw-r--r--src/chat/messenger.h2
3 files changed, 0 insertions, 30 deletions
diff --git a/src/application.c b/src/application.c
index cb9be47..2eb1f73 100644
--- a/src/application.c
+++ b/src/application.c
@@ -774,9 +774,6 @@ _application_stop_chat(gpointer user_data)
774{ 774{
775 MESSENGER_Application *app = user_data; 775 MESSENGER_Application *app = user_data;
776 776
777 if (app->chat.messenger.idle)
778 GNUNET_SCHEDULER_cancel(app->chat.messenger.idle);
779
780 GNUNET_CHAT_disconnect(app->chat.messenger.handle); 777 GNUNET_CHAT_disconnect(app->chat.messenger.handle);
781 GNUNET_CHAT_stop(app->chat.messenger.handle); 778 GNUNET_CHAT_stop(app->chat.messenger.handle);
782 app->chat.messenger.handle = NULL; 779 app->chat.messenger.handle = NULL;
diff --git a/src/chat/messenger.c b/src/chat/messenger.c
index 23ab01e..6455760 100644
--- a/src/chat/messenger.c
+++ b/src/chat/messenger.c
@@ -27,23 +27,6 @@
27#include "../event.h" 27#include "../event.h"
28#include <gnunet/gnunet_chat_lib.h> 28#include <gnunet/gnunet_chat_lib.h>
29 29
30static void
31_chat_messenger_idle(void *cls)
32{
33 g_assert(cls);
34
35 MESSENGER_Application *app = (MESSENGER_Application*) cls;
36
37 // Idling until the application shuts down
38 // (required to get events immediately).
39 app->chat.messenger.idle = GNUNET_SCHEDULER_add_delayed_with_priority(
40 GNUNET_TIME_relative_get_second_(),
41 GNUNET_SCHEDULER_PRIORITY_IDLE,
42 &_chat_messenger_idle,
43 app
44 );
45}
46
47static int 30static int
48_chat_messenger_message(void *cls, 31_chat_messenger_message(void *cls,
49 struct GNUNET_CHAT_Context *context, 32 struct GNUNET_CHAT_Context *context,
@@ -227,17 +210,9 @@ chat_messenger_run(void *cls,
227 210
228 schedule_load_gnunet(&(app->chat.schedule)); 211 schedule_load_gnunet(&(app->chat.schedule));
229 212
230 // Start libgnunetchat handle
231 app->chat.messenger.handle = GNUNET_CHAT_start( 213 app->chat.messenger.handle = GNUNET_CHAT_start(
232 cfg, 214 cfg,
233 &_chat_messenger_message, 215 &_chat_messenger_message,
234 app 216 app
235 ); 217 );
236
237 // The idle callback seems to be necessary to not wait too long for
238 // other events
239 app->chat.messenger.idle = GNUNET_SCHEDULER_add_now(
240 &_chat_messenger_idle,
241 app
242 );
243} 218}
diff --git a/src/chat/messenger.h b/src/chat/messenger.h
index 3ab1910..ad063d4 100644
--- a/src/chat/messenger.h
+++ b/src/chat/messenger.h
@@ -32,8 +32,6 @@ typedef struct MESSENGER_Application MESSENGER_Application;
32typedef struct CHAT_MESSENGER_Handle 32typedef struct CHAT_MESSENGER_Handle
33{ 33{
34 struct GNUNET_CHAT_Handle *handle; 34 struct GNUNET_CHAT_Handle *handle;
35 struct GNUNET_SCHEDULER_Task *quit;
36 struct GNUNET_SCHEDULER_Task *idle;
37} CHAT_MESSENGER_Handle; 35} CHAT_MESSENGER_Handle;
38 36
39/** 37/**