diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/event.c | 26 | ||||
-rw-r--r-- | src/ui/new_platform.c | 8 |
2 files changed, 32 insertions, 2 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 | } |
diff --git a/src/ui/new_platform.c b/src/ui/new_platform.c index 75966b5..e4f8c4a 100644 --- a/src/ui/new_platform.c +++ b/src/ui/new_platform.c | |||
@@ -39,7 +39,6 @@ _open_new_platform(GtkEntry *entry, MESSENGER_Application *app) | |||
39 | ); | 39 | ); |
40 | 40 | ||
41 | g_string_prepend_c(topic_string, '#'); | 41 | g_string_prepend_c(topic_string, '#'); |
42 | |||
43 | GNUNET_CHAT_group_set_name(group, topic_string->str); | 42 | GNUNET_CHAT_group_set_name(group, topic_string->str); |
44 | 43 | ||
45 | g_string_free(topic_string, TRUE); | 44 | g_string_free(topic_string, TRUE); |
@@ -52,7 +51,12 @@ handle_platform_entry_changed(GtkEditable *editable, | |||
52 | HdyAvatar *avatar = HDY_AVATAR(user_data); | 51 | HdyAvatar *avatar = HDY_AVATAR(user_data); |
53 | GtkEntry *entry = GTK_ENTRY(editable); | 52 | GtkEntry *entry = GTK_ENTRY(editable); |
54 | 53 | ||
55 | hdy_avatar_set_text(avatar, gtk_entry_get_text(entry)); | 54 | GString *topic_string = g_string_new(gtk_entry_get_text(entry)); |
55 | |||
56 | g_string_prepend_c(topic_string, '#'); | ||
57 | hdy_avatar_set_text(avatar, topic_string->str); | ||
58 | |||
59 | g_string_free(topic_string, TRUE); | ||
56 | } | 60 | } |
57 | 61 | ||
58 | static void | 62 | static void |