aboutsummaryrefslogtreecommitdiff
path: root/src/ui/chat_entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/chat_entry.c')
-rw-r--r--src/ui/chat_entry.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/ui/chat_entry.c b/src/ui/chat_entry.c
index c065fc7..3c9461e 100644
--- a/src/ui/chat_entry.c
+++ b/src/ui/chat_entry.c
@@ -66,16 +66,6 @@ ui_chat_entry_new(MESSENGER_Application *app)
66 return handle; 66 return handle;
67} 67}
68 68
69/*static int
70_iterate_message_read_receipt(UNUSED void *cls,
71 UNUSED const struct GNUNET_CHAT_Message *message,
72 const struct GNUNET_CHAT_Contact *contact,
73 int read_receipt)
74{
75 printf("read_receipt: %s %d\n", GNUNET_CHAT_contact_get_name(contact), read_receipt);
76 return GNUNET_YES;
77}*/
78
79void 69void
80ui_chat_entry_update(UI_CHAT_ENTRY_Handle *handle, 70ui_chat_entry_update(UI_CHAT_ENTRY_Handle *handle,
81 MESSENGER_Application *app, 71 MESSENGER_Application *app,
@@ -88,23 +78,36 @@ ui_chat_entry_update(UI_CHAT_ENTRY_Handle *handle,
88 group = GNUNET_CHAT_context_get_group(context); 78 group = GNUNET_CHAT_context_get_group(context);
89 79
90 const char *title = NULL; 80 const char *title = NULL;
81 const char *icon = "action-unavailable-symbolic";
91 82
92 if (contact) 83 if (contact)
84 {
93 title = GNUNET_CHAT_contact_get_name(contact); 85 title = GNUNET_CHAT_contact_get_name(contact);
86 icon = "avatar-default-symbolic";
87 }
94 else if (group) 88 else if (group)
89 {
95 title = GNUNET_CHAT_group_get_name(group); 90 title = GNUNET_CHAT_group_get_name(group);
96 91
97 if (title) 92 if ((title) && ('#' == *title))
98 { 93 icon = "network-wired-symbolic";
99 gtk_label_set_text(handle->title_label, title); 94 else
100 hdy_avatar_set_text(handle->entry_avatar, title); 95 icon = "system-users-symbolic";
101 } 96 }
102 97
98 gtk_label_set_text(handle->title_label, title? title : "");
99
100 hdy_avatar_set_text(handle->entry_avatar, title? title : "");
101 hdy_avatar_set_icon_name(handle->entry_avatar, icon);
102
103 if (!(handle->chat)) 103 if (!(handle->chat))
104 return; 104 return;
105 105
106 ui_chat_update(handle->chat, app, context); 106 ui_chat_update(handle->chat, app, context);
107 107
108 hdy_avatar_set_text(handle->chat->chat_avatar, title? title : "");
109 hdy_avatar_set_icon_name(handle->chat->chat_avatar, icon);
110
108 if (!(handle->chat->messages)) 111 if (!(handle->chat->messages))
109 return; 112 return;
110 113