[empathy] Don't set presence to offline when Shell is running



commit adb1971f4779df5e8b77b8fe7550ec8455aac8c7
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Aug 30 12:10:23 2011 +0200

    Don't set presence to offline when Shell is running
    
    https://bugzilla.gnome.org/show_bug.cgi?id=656632

 src/empathy.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/empathy.c b/src/empathy.c
index ea0db51..e99250f 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -128,6 +128,8 @@ struct _EmpathyApp
 #ifdef ENABLE_DEBUG
   TpDebugSender *debug_sender;
 #endif
+
+  gboolean shell_running;
 };
 
 
@@ -140,7 +142,10 @@ empathy_app_dispose (GObject *object)
   void (*dispose) (GObject *) =
     G_OBJECT_CLASS (empathy_app_parent_class)->dispose;
 
-  if (self->presence_mgr != NULL)
+  /* Only set our presence to offline when exiting if GNOME Shell is not
+   * running */
+  if (self->presence_mgr != NULL &&
+      !self->shell_running)
     {
       empathy_presence_manager_set_state (self->presence_mgr,
           TP_CONNECTION_PRESENCE_TYPE_OFFLINE);
@@ -250,7 +255,6 @@ list_names_cb (TpDBusDaemon *bus_daemon,
         GObject *weak_object)
 {
   EmpathyApp *self = (EmpathyApp *) weak_object;
-  gboolean shell_running = FALSE;
   guint i;
 
   if (error != NULL)
@@ -260,13 +264,13 @@ list_names_cb (TpDBusDaemon *bus_daemon,
     {
       if (!tp_strdiff (names[i], GNOME_SHELL_BUS_NAME))
         {
-          shell_running = TRUE;
+          self->shell_running = TRUE;
           break;
         }
     }
 
 out:
-  if (shell_running)
+  if (self->shell_running)
     {
       DEBUG ("GNOMES Shell is running, don't create status icon");
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]