]> git.0d.be Git - empathy.git/commitdiff
roster-window: display a specific message when we are offline
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 4 Sep 2012 12:34:10 +0000 (14:34 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 5 Sep 2012 07:13:23 +0000 (09:13 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=683326

src/empathy-roster-window.c

index b92507b4f3c346460bb625d98525022a9940f718..ffaa6b926b83c335a8bc0f12cf73cdfefbd350bd 100644 (file)
@@ -1563,6 +1563,7 @@ set_notebook_page (EmpathyRosterWindow *self)
 {
   GList *accounts;
   guint len;
+  TpConnectionPresenceType presence;
 
   accounts = tp_account_manager_get_valid_accounts (
       self->priv->account_manager);
@@ -1588,6 +1589,17 @@ set_notebook_page (EmpathyRosterWindow *self)
       goto out;
     }
 
+  presence = tp_account_manager_get_most_available_presence (
+      self->priv->account_manager, NULL, NULL);
+
+  if (presence == TP_CONNECTION_PRESENCE_TYPE_OFFLINE)
+    {
+      display_page_message (self,
+          _("Change your presence to see contacts here"),
+          FALSE, FALSE);
+      goto out;
+    }
+
   if (empathy_roster_view_is_empty (self->priv->view))
     {
       if (empathy_roster_view_is_searching (self->priv->view))