aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Contzen <lcontzen@gmail.com>2012-07-13 23:10:50 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-17 17:53:00 +0800
commita507ac419e482b94c2dd4d0c7ddd3cc67116b6e1 (patch)
treedec8892b789045b62768f7407cbf1c140ac8a842
parent33ad5c340ed97da141c3182051502043a710e92f (diff)
downloadgsoc2013-empathy-a507ac419e482b94c2dd4d0c7ddd3cc67116b6e1.tar
gsoc2013-empathy-a507ac419e482b94c2dd4d0c7ddd3cc67116b6e1.tar.gz
gsoc2013-empathy-a507ac419e482b94c2dd4d0c7ddd3cc67116b6e1.tar.bz2
gsoc2013-empathy-a507ac419e482b94c2dd4d0c7ddd3cc67116b6e1.tar.lz
gsoc2013-empathy-a507ac419e482b94c2dd4d0c7ddd3cc67116b6e1.tar.xz
gsoc2013-empathy-a507ac419e482b94c2dd4d0c7ddd3cc67116b6e1.tar.zst
gsoc2013-empathy-a507ac419e482b94c2dd4d0c7ddd3cc67116b6e1.zip
Display the Top Contacts group name above the top contacts even if all of them are offline
https://bugzilla.gnome.org/show_bug.cgi?id=679868
-rw-r--r--libempathy-gtk/empathy-roster-view.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index 5b0433f16..9647a1a4f 100644
--- a/libempathy-gtk/empathy-roster-view.c
+++ b/libempathy-gtk/empathy-roster-view.c
@@ -809,26 +809,30 @@ contact_should_be_displayed (EmpathyRosterView *self,
empathy_live_search_get_text (self->priv->search),
empathy_live_search_get_words (self->priv->search));
}
- else
+
+ if (self->priv->show_offline)
+ return TRUE;
+
+ if (contact_is_favourite (contact))
{
- if (self->priv->show_offline)
- {
- return TRUE;
- }
- else if (!self->priv->show_groups &&
- contact_is_favourite (contact))
- {
- /* Always display favourite contacts in non-group mode. In the group
- * mode we'll display only the one in the 'top' section. */
- return TRUE;
- }
- else
- {
- return empathy_roster_contact_is_online (contact);
- }
+ const gchar *group_name;
+
+ if (!self->priv->show_groups)
+ /* Always display favourite contacts in non-group mode. */
+ return TRUE;
+
+ group_name = empathy_roster_contact_get_group (contact);
+
+ if (!tp_strdiff (group_name, EMPATHY_ROSTER_VIEW_GROUP_TOP_GROUP))
+ /* Always display favourite contact in group mode only in the
+ * 'top group'*/
+ return TRUE;
}
+
+ return empathy_roster_contact_is_online (contact);
}
+
static gboolean
filter_contact (EmpathyRosterView *self,
EmpathyRosterContact *contact)
@@ -845,10 +849,6 @@ filter_contact (EmpathyRosterView *self,
group_name = empathy_roster_contact_get_group (contact);
group = lookup_roster_group (self, group_name);
- if (!tp_strdiff (group_name, EMPATHY_ROSTER_VIEW_GROUP_TOP_GROUP) &&
- contact_is_favourite (contact))
- displayed = TRUE;
-
if (group != NULL)
{
/* When searching, always display even if the group is closed */