diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-04-25 17:02:04 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-04-25 19:45:21 +0800 |
commit | 86f71b05736651fe61a63faace83b9599055c181 (patch) | |
tree | 9326beedbbcac4c713ce552cea9767689c9a86d8 /libempathy-gtk | |
parent | 4a88dd610e16b3b1763e706496b0c36924803160 (diff) | |
download | gsoc2013-empathy-86f71b05736651fe61a63faace83b9599055c181.tar gsoc2013-empathy-86f71b05736651fe61a63faace83b9599055c181.tar.gz gsoc2013-empathy-86f71b05736651fe61a63faace83b9599055c181.tar.bz2 gsoc2013-empathy-86f71b05736651fe61a63faace83b9599055c181.tar.lz gsoc2013-empathy-86f71b05736651fe61a63faace83b9599055c181.tar.xz gsoc2013-empathy-86f71b05736651fe61a63faace83b9599055c181.tar.zst gsoc2013-empathy-86f71b05736651fe61a63faace83b9599055c181.zip |
Make 'Anyone' work
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-log-window.c | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index 99d2cd29e..e41049d5a 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -792,6 +792,44 @@ log_window_append_message (TplEvent *event, DEBUG ("Message type not handled"); } +static void +add_all_accounts_and_entities (GList **accounts, + GList **entities) +{ + GtkTreeView *view; + GtkTreeModel *model; + GtkTreeIter iter; + + view = GTK_TREE_VIEW (log_window->treeview_who); + model = gtk_tree_view_get_model (view); + + if (!gtk_tree_model_get_iter_first (model, &iter)) + return; + + do + { + TpAccount *account; + TplEntity *entity; + gint type; + + gtk_tree_model_get (model, &iter, + COL_WHO_ACCOUNT, &account, + COL_WHO_TARGET, &entity, + COL_WHO_TYPE, &type, + -1); + + if (type != COL_TYPE_NORMAL) + continue; + + if (accounts != NULL) + *accounts = g_list_append (*accounts, account); + + if (entities != NULL) + *entities = g_list_append (*entities, entity); + } + while (gtk_tree_model_iter_next (model, &iter)); +} + static gboolean log_window_get_selected (EmpathyLogWindow *window, GList **accounts, @@ -836,8 +874,12 @@ log_window_get_selected (EmpathyLogWindow *window, COL_WHO_TYPE, &type, -1); - if (type != COL_TYPE_NORMAL) - continue; + if (type == COL_TYPE_ANY) + { + if (accounts != NULL || entities != NULL) + add_all_accounts_and_entities (accounts, entities); + break; + } if (accounts != NULL) *accounts = g_list_append (*accounts, g_object_ref (account)); @@ -2375,8 +2417,6 @@ log_window_chats_get_messages (EmpathyLogWindow *window, } _tpl_action_chain_append (window->chain, select_first_date, NULL); _tpl_action_chain_start (window->chain); - - /* FIXME: get dates for all entities when 'Anyone' ? */ } else { |