All pastes #794701 Raw Edit

Someone

public text v1 · immutable
#794701 ·published 2007-11-23 10:56 UTC
rendered paste body
diff --git a/shell/model/Friends.py b/shell/model/Friends.py
index 2b7d6bf..552c9b6 100644
--- a/shell/model/Friends.py
+++ b/shell/model/Friends.py
@@ -14,6 +14,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+import dbus
 import os
 from ConfigParser import ConfigParser
 
@@ -86,3 +87,16 @@ class Friends(gobject.GObject):
         fileobject = open(self._path, 'w')
         cp.write(fileobject)
         fileobject.close()
+
+        # XXX: temporary hack
+        # remove this when the shell service has a D-Bus API for buddies
+
+        try:
+            bus = dbus.SessionBus()
+            ps = bus.get_object('org.laptop.Sugar.Presence',
+                '/org/laptop/Sugar/Presence')
+            psi = dbus.Interface(ps, 'org.laptop.Sugar.Presence')
+            psi.SyncFriends()
+        except Exception, exc:
+            logging.error("Error asking presence service to sync friends: %s"
+                % exc)