aboutsummaryrefslogtreecommitdiff
path: root/src/ui/messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/messenger.c')
-rw-r--r--src/ui/messenger.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ui/messenger.c b/src/ui/messenger.c
index 69200f9..7d68f27 100644
--- a/src/ui/messenger.c
+++ b/src/ui/messenger.c
@@ -37,6 +37,7 @@
37#include "settings.h" 37#include "settings.h"
38 38
39#include "../application.h" 39#include "../application.h"
40#include "../ui.h"
40 41
41static gboolean 42static gboolean
42_flap_user_details_reveal_switch(gpointer user_data) 43_flap_user_details_reveal_switch(gpointer user_data)
@@ -605,24 +606,22 @@ _messenger_iterate_accounts(void *cls,
605 MESSENGER_Application *app = (MESSENGER_Application*) cls; 606 MESSENGER_Application *app = (MESSENGER_Application*) cls;
606 UI_MESSENGER_Handle *ui = &(app->ui.messenger); 607 UI_MESSENGER_Handle *ui = &(app->ui.messenger);
607 608
608 const gchar *name = GNUNET_CHAT_account_get_name(account); 609 const char *name = GNUNET_CHAT_account_get_name(account);
609 610
610 UI_ACCOUNT_ENTRY_Handle *entry = ui_account_entry_new(app); 611 UI_ACCOUNT_ENTRY_Handle *entry = ui_account_entry_new(app);
611 612
612 hdy_avatar_set_text(entry->entry_avatar, name); 613 ui_avatar_set_text(entry->entry_avatar, name);
613 gtk_label_set_text(entry->entry_label, name); 614 ui_label_set_text(entry->entry_label, name);
614 615
615 gtk_list_box_prepend(ui->accounts_listbox, entry->entry_box); 616 gtk_list_box_prepend(ui->accounts_listbox, entry->entry_box);
616 617
617 GtkListBoxRow *row = GTK_LIST_BOX_ROW( 618 GtkWidget *row = gtk_widget_get_parent(entry->entry_box);
618 gtk_widget_get_parent(entry->entry_box)
619 );
620 619
621 g_object_set_qdata(G_OBJECT(row), app->quarks.data, account); 620 g_object_set_qdata(G_OBJECT(row), app->quarks.data, account);
622 621
623 if ((account == GNUNET_CHAT_get_connected(handle)) || 622 if ((account == GNUNET_CHAT_get_connected(handle)) ||
624 ((app->chat.identity) && (0 == g_strcmp0(app->chat.identity, name)))) 623 ((app->chat.identity) && (0 == g_strcmp0(app->chat.identity, name))))
625 gtk_widget_activate(GTK_WIDGET(row)); 624 gtk_widget_activate(row);
626 625
627 ui_account_entry_delete(entry); 626 ui_account_entry_delete(entry);
628 return GNUNET_YES; 627 return GNUNET_YES;
@@ -673,13 +672,16 @@ ui_messenger_is_context_active(UI_MESSENGER_Handle *handle,
673 672
674 UI_CHAT_ENTRY_Handle *entry = GNUNET_CHAT_context_get_user_pointer(context); 673 UI_CHAT_ENTRY_Handle *entry = GNUNET_CHAT_context_get_user_pointer(context);
675 674
676 if (!entry) 675 if ((!entry) || (!(entry->entry_box)))
677 return FALSE; 676 return FALSE;
678 677
679 GtkListBoxRow *row = GTK_LIST_BOX_ROW( 678 GtkListBoxRow *row = GTK_LIST_BOX_ROW(
680 gtk_widget_get_parent(entry->entry_box) 679 gtk_widget_get_parent(entry->entry_box)
681 ); 680 );
682 681
682 if (!row)
683 return FALSE;
684
683 return gtk_list_box_row_is_selected(row); 685 return gtk_list_box_row_is_selected(row);
684} 686}
685 687