aboutsummaryrefslogtreecommitdiff
path: root/src/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/event.c')
-rw-r--r--src/event.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/event.c b/src/event.c
index e023613..5ad3016 100644
--- a/src/event.c
+++ b/src/event.c
@@ -73,7 +73,8 @@ _clear_each_widget(GtkWidget *widget,
73} 73}
74 74
75void 75void
76event_update_profile(MESSENGER_Application *app) 76event_update_profile(MESSENGER_Application *app,
77 UNUSED void *cls)
77{ 78{
78 UI_MESSENGER_Handle *ui = &(app->ui.messenger); 79 UI_MESSENGER_Handle *ui = &(app->ui.messenger);
79 CHAT_MESSENGER_Handle *chat = &(app->chat.messenger); 80 CHAT_MESSENGER_Handle *chat = &(app->chat.messenger);
@@ -95,13 +96,28 @@ event_update_profile(MESSENGER_Application *app)
95 GNUNET_CHAT_iterate_contacts(chat->handle, _iterate_profile_contacts, app); 96 GNUNET_CHAT_iterate_contacts(chat->handle, _iterate_profile_contacts, app);
96 GNUNET_CHAT_iterate_groups(chat->handle, _iterate_profile_groups, app); 97 GNUNET_CHAT_iterate_groups(chat->handle, _iterate_profile_groups, app);
97 98
98 UI_CHAT_ENTRY_Handle *entry = ui_chat_entry_new();
99 gtk_container_add(GTK_CONTAINER(ui->chats_listbox), entry->entry_box);
100 g_free(entry);
101
102 for (int i = 0; i < 8; i++) { 99 for (int i = 0; i < 8; i++) {
103 UI_MESSAGE_Handle *message = ui_message_new(app, i % 2 == 0); 100 UI_MESSAGE_Handle *message = ui_message_new(app, i % 2 == 0);
104 gtk_container_add(GTK_CONTAINER(ui->messages_listbox), message->message_box); 101 gtk_container_add(GTK_CONTAINER(ui->messages_listbox), message->message_box);
105 g_free(message); 102 g_free(message); // TODO: this is just a test!
106 } 103 }
107} 104}
105
106void
107event_update_chats(MESSENGER_Application *app,
108 void *cls)
109{
110 struct GNUNET_CHAT_Context *context = (struct GNUNET_CHAT_Context*) cls;
111
112 if (GNUNET_CHAT_context_get_user_pointer(context))
113 return;
114
115 UI_MESSENGER_Handle *ui = &(app->ui.messenger);
116
117 UI_CHAT_ENTRY_Handle *entry = ui_chat_entry_new();
118 gtk_container_add(GTK_CONTAINER(ui->chats_listbox), entry->entry_box);
119 g_free(entry); // TODO: free already?
120
121 // TODO: put something better here to attach it!
122 GNUNET_CHAT_context_set_user_pointer(context, ui);
123}