diff options
author | Jacki <jacki@thejackimonster.de> | 2024-04-28 21:16:37 +0200 |
---|---|---|
committer | Jacki <jacki@thejackimonster.de> | 2024-04-28 21:16:37 +0200 |
commit | a4cae0dff0be3d39d70c4010019808f033940b80 (patch) | |
tree | 9452b55ff4945c5bbb5b197556991835984c108a /src/gnunet_chat_handle_intern.c | |
parent | 7ee0dab6e99668df6f33293d9efbfd147c82191f (diff) | |
download | libgnunetchat-a4cae0dff0be3d39d70c4010019808f033940b80.tar.gz libgnunetchat-a4cae0dff0be3d39d70c4010019808f033940b80.zip |
Delay and merge refresh messages
Signed-off-by: Jacki <jacki@thejackimonster.de>
Diffstat (limited to 'src/gnunet_chat_handle_intern.c')
-rw-r--r-- | src/gnunet_chat_handle_intern.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/gnunet_chat_handle_intern.c b/src/gnunet_chat_handle_intern.c index bdde871..fbe1ee3 100644 --- a/src/gnunet_chat_handle_intern.c +++ b/src/gnunet_chat_handle_intern.c | |||
@@ -276,6 +276,24 @@ notify_handle_fs_progress(void* cls, | |||
276 | return NULL; | 276 | return NULL; |
277 | } | 277 | } |
278 | 278 | ||
279 | static void | ||
280 | on_handle_refresh (void *cls) | ||
281 | { | ||
282 | GNUNET_assert(cls); | ||
283 | |||
284 | struct GNUNET_CHAT_Handle* handle = cls; | ||
285 | |||
286 | handle->refresh = NULL; | ||
287 | |||
288 | handle_send_internal_message( | ||
289 | handle, | ||
290 | NULL, | ||
291 | NULL, | ||
292 | GNUNET_CHAT_FLAG_REFRESH, | ||
293 | NULL | ||
294 | ); | ||
295 | } | ||
296 | |||
279 | void | 297 | void |
280 | on_handle_gnunet_identity (void *cls, | 298 | on_handle_gnunet_identity (void *cls, |
281 | struct GNUNET_IDENTITY_Ego *ego, | 299 | struct GNUNET_IDENTITY_Ego *ego, |
@@ -349,12 +367,12 @@ skip_account: | |||
349 | account_update_directory(accounts->account, handle->directory); | 367 | account_update_directory(accounts->account, handle->directory); |
350 | 368 | ||
351 | send_refresh: | 369 | send_refresh: |
352 | handle_send_internal_message( | 370 | if (handle->refresh) |
353 | handle, | 371 | return; |
354 | NULL, | 372 | |
355 | NULL, | 373 | handle->refresh = GNUNET_SCHEDULER_add_now( |
356 | GNUNET_CHAT_FLAG_REFRESH, | 374 | on_handle_refresh, |
357 | NULL | 375 | handle |
358 | ); | 376 | ); |
359 | } | 377 | } |
360 | 378 | ||