[Telepathy-commits] [telepathy-gabble/master] Do not emit PresenceUpdate if the presence does not change, and do not leak resource

Alban Crequy alban.crequy at collabora.co.uk
Tue Feb 10 01:43:20 PST 2009


---
 src/conn-presence.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/conn-presence.c b/src/conn-presence.c
index 7a13192..96ff72f 100644
--- a/src/conn-presence.c
+++ b/src/conn-presence.c
@@ -257,10 +257,12 @@ set_own_status_cb (GObject *obj,
     }
   else
     {
-      gabble_presence_update (conn->self_presence, resource,
-          GABBLE_PRESENCE_AVAILABLE, NULL, prio);
-      emit_one_presence_update (conn, base->self_handle);
-      return _gabble_connection_signal_own_presence (conn, error);
+      if (gabble_presence_update (conn->self_presence, resource,
+          GABBLE_PRESENCE_AVAILABLE, NULL, prio))
+        {
+          emit_one_presence_update (conn, base->self_handle);
+          retval = _gabble_connection_signal_own_presence (conn, error);
+        }
     }
 
 OUT:
-- 
1.5.6.5



More information about the telepathy-commits mailing list