aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2021-12-22 14:13:17 +0100
committerTheJackiMonster <thejackimonster@gmail.com>2021-12-22 14:13:17 +0100
commit62090cdc581f6b7c52997f124c791912b91977f5 (patch)
treebfc910f9abbeb1a8b008949fa1912efd739967e8
parent61ceb54276f7f3e2ac9cdd9d4ada7ee9e2e5241e (diff)
downloadmessenger-gtk-62090cdc581f6b7c52997f124c791912b91977f5.tar.gz
messenger-gtk-62090cdc581f6b7c52997f124c791912b91977f5.zip
Added uploading callback
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r--src/ui/send_file.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/ui/send_file.c b/src/ui/send_file.c
index 2d3f4a6..0d0c04b 100644
--- a/src/ui/send_file.c
+++ b/src/ui/send_file.c
@@ -35,6 +35,15 @@ handle_cancel_button_click(UNUSED GtkButton *button,
35} 35}
36 36
37static void 37static void
38handle_sending_upload_file(UNUSED void *cls,
39 UNUSED const struct GNUNET_CHAT_File *file,
40 uint64_t completed,
41 uint64_t size)
42{
43 printf("UPLOAD: %lu / %lu\n", completed, size);
44}
45
46static void
38handle_send_button_click(GtkButton *button, 47handle_send_button_click(GtkButton *button,
39 gpointer user_data) 48 gpointer user_data)
40{ 49{
@@ -59,9 +68,16 @@ handle_send_button_click(GtkButton *button,
59 ); 68 );
60 69
61 if (context) 70 if (context)
62 GNUNET_CHAT_context_send_file(context, filename, NULL, NULL); // TODO: callbacks! 71 GNUNET_CHAT_context_send_file(
72 context,
73 filename,
74 handle_sending_upload_file,
75 NULL
76 );
63 77
64 g_free(filename); 78 g_free(filename);
79
80 gtk_window_close(GTK_WINDOW(app->ui.send_file.dialog));
65} 81}
66 82
67static void 83static void