diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2021-12-12 22:31:42 +0100 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2021-12-12 22:31:42 +0100 |
commit | cbefefb69b4db53fad2c01d45b66d9056bc98fdb (patch) | |
tree | 8e80423c16ea14e926e1629471d81a0f50a0db08 /src/event.c | |
parent | 1e666517d6f6bccb85b2a92fd51986efba2e2563 (diff) | |
download | messenger-gtk-cbefefb69b4db53fad2c01d45b66d9056bc98fdb.tar.gz messenger-gtk-cbefefb69b4db53fad2c01d45b66d9056bc98fdb.zip |
Added chat details with a list of contacts for groups
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'src/event.c')
-rw-r--r-- | src/event.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/src/event.c b/src/event.c index a1cb4fc..f63598d 100644 --- a/src/event.c +++ b/src/event.c | |||
@@ -35,31 +35,13 @@ _add_new_chat_entry(MESSENGER_Application *app, | |||
35 | { | 35 | { |
36 | UI_MESSENGER_Handle *ui = &(app->ui.messenger); | 36 | UI_MESSENGER_Handle *ui = &(app->ui.messenger); |
37 | 37 | ||
38 | const struct GNUNET_CHAT_Contact* contact; | 38 | UI_CHAT_ENTRY_Handle *entry = ui_chat_entry_new(app); |
39 | const struct GNUNET_CHAT_Group* group; | ||
40 | |||
41 | contact = GNUNET_CHAT_context_get_contact(context); | ||
42 | group = GNUNET_CHAT_context_get_group(context); | ||
43 | |||
44 | const char *title = NULL; | ||
45 | 39 | ||
46 | if (contact) | 40 | ui_chat_entry_update(entry, context); |
47 | title = GNUNET_CHAT_contact_get_name(contact); | ||
48 | else if (group) | ||
49 | title = GNUNET_CHAT_group_get_name(group); | ||
50 | 41 | ||
51 | UI_CHAT_ENTRY_Handle *entry = ui_chat_entry_new(app); | ||
52 | gtk_container_add(GTK_CONTAINER(ui->chats_listbox), entry->entry_box); | 42 | gtk_container_add(GTK_CONTAINER(ui->chats_listbox), entry->entry_box); |
53 | GNUNET_CHAT_context_set_user_pointer(context, entry); | 43 | GNUNET_CHAT_context_set_user_pointer(context, entry); |
54 | 44 | ||
55 | if (title) | ||
56 | { | ||
57 | gtk_label_set_text(entry->title_label, title); | ||
58 | hdy_avatar_set_text(entry->entry_avatar, title); | ||
59 | |||
60 | gtk_label_set_text(entry->chat->chat_title, title); | ||
61 | } | ||
62 | |||
63 | char context_id [9]; | 45 | char context_id [9]; |
64 | g_snprintf(context_id, sizeof(context_id), "%08lx", (gulong) context); | 46 | g_snprintf(context_id, sizeof(context_id), "%08lx", (gulong) context); |
65 | 47 | ||
@@ -181,10 +163,7 @@ event_joining_contact(MESSENGER_Application *app, | |||
181 | if (!handle) | 163 | if (!handle) |
182 | return; | 164 | return; |
183 | 165 | ||
184 | int status = GNUNET_CHAT_context_get_status(context); | 166 | ui_chat_entry_update(handle, context); |
185 | |||
186 | if (GNUNET_OK == status) | ||
187 | ui_chat_entry_activate(handle); | ||
188 | 167 | ||
189 | UI_MESSAGE_Handle *message = ui_message_new(app, UI_MESSAGE_STATUS); | 168 | UI_MESSAGE_Handle *message = ui_message_new(app, UI_MESSAGE_STATUS); |
190 | 169 | ||