aboutsummaryrefslogtreecommitdiff
path: root/src/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/event.c')
-rw-r--r--src/event.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/event.c b/src/event.c
index 6683e63..da5295e 100644
--- a/src/event.c
+++ b/src/event.c
@@ -33,10 +33,31 @@ _add_new_chat_entry(MESSENGER_Application *app,
33{ 33{
34 UI_MESSENGER_Handle *ui = &(app->ui.messenger); 34 UI_MESSENGER_Handle *ui = &(app->ui.messenger);
35 35
36 const struct GNUNET_CHAT_Contact* contact;
37 const struct GNUNET_CHAT_Group* group;
38
39 contact = GNUNET_CHAT_context_get_contact(context);
40 group = GNUNET_CHAT_context_get_group(context);
41
42 const char *title = NULL;
43
44 if (contact)
45 title = GNUNET_CHAT_contact_get_name(contact);
46 else if (group)
47 title = GNUNET_CHAT_group_get_name(group);
48
36 UI_CHAT_ENTRY_Handle *entry = ui_chat_entry_new(app); 49 UI_CHAT_ENTRY_Handle *entry = ui_chat_entry_new(app);
37 gtk_container_add(GTK_CONTAINER(ui->chats_listbox), entry->entry_box); 50 gtk_container_add(GTK_CONTAINER(ui->chats_listbox), entry->entry_box);
38 GNUNET_CHAT_context_set_user_pointer(context, entry); 51 GNUNET_CHAT_context_set_user_pointer(context, entry);
39 52
53 if (title)
54 {
55 gtk_label_set_text(entry->title_label, title);
56 hdy_avatar_set_text(entry->entry_avatar, title);
57
58 gtk_label_set_text(entry->chat->chat_title, title);
59 }
60
40 char context_id [9]; 61 char context_id [9];
41 g_snprintf(context_id, sizeof(context_id), "%08lx", (gulong) context); 62 g_snprintf(context_id, sizeof(context_id), "%08lx", (gulong) context);
42 63
@@ -184,4 +205,9 @@ event_receive_message(MESSENGER_Application *app,
184 205
185 gtk_label_set_text(handle->text_label, text? text : ""); 206 gtk_label_set_text(handle->text_label, text? text : "");
186 gtk_label_set_text(handle->timestamp_label, time? time : ""); 207 gtk_label_set_text(handle->timestamp_label, time? time : "");
208
209 gtk_widget_set_visible(
210 GTK_WIDGET(handle->read_receipt_image),
211 GNUNET_YES == sent
212 );
187} 213}