Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2007-06-07 14:51:17 (GMT)
committer Simon McVittie <simon.mcvittie@collabora.co.uk>2007-06-07 14:51:17 (GMT)
commit5fed12edbc6c7f058a990241d12fd0b02da38d80 (patch)
tree6e250ed792883e81df250dd04822b8a8536917f6
parent1d00d192c2af83e5c981d9753fd87760898b565b (diff)
presenceservice, server_plugin: share the icon cache now it can handle multiple accounts
-rw-r--r--src/presenceservice.py6
-rw-r--r--src/server_plugin.py5
2 files changed, 7 insertions, 4 deletions
diff --git a/src/presenceservice.py b/src/presenceservice.py
index ae2b770..f238098 100644
--- a/src/presenceservice.py
+++ b/src/presenceservice.py
@@ -35,6 +35,7 @@ from sugar import util
from server_plugin import ServerPlugin
from linklocal_plugin import LinkLocalPlugin
from buddy import Buddy, ShellOwner
+from buddyiconcache import BuddyIconCache
from activity import Activity
from psutils import pubkey_to_keyid
@@ -67,6 +68,8 @@ class PresenceService(ExportedGObject):
self._next_object_id = 0
self._connected = False
+ self._icon_cache = BuddyIconCache()
+
# all Buddy objects
# identifier -> Buddy, GC'd when no more refs exist
self._buddies = WeakValueDictionary()
@@ -98,7 +101,8 @@ class PresenceService(ExportedGObject):
self._registry.LoadManagers()
# Set up the server connection
- self._server_plugin = ServerPlugin(self._registry, self._owner)
+ self._server_plugin = ServerPlugin(self._registry, self._owner,
+ self._icon_cache)
self._handles_buddies[self._server_plugin] = {}
self._server_plugin.connect('status', self._server_status_cb)
diff --git a/src/server_plugin.py b/src/server_plugin.py
index ea51f89..afe3410 100644
--- a/src/server_plugin.py
+++ b/src/server_plugin.py
@@ -48,7 +48,6 @@ from telepathy.constants import (HANDLE_TYPE_CONTACT,
from sugar import util
# Presence Service local modules
-from buddyiconcache import BuddyIconCache
import psutils
@@ -164,7 +163,7 @@ class ServerPlugin(gobject.GObject):
(gobject.SIGNAL_RUN_FIRST, None, [object, object, object, object]),
}
- def __init__(self, registry, owner):
+ def __init__(self, registry, owner, icon_cache):
"""Initialize the ServerPlugin instance
registry -- telepathy.client.ManagerRegistry from the
@@ -176,7 +175,7 @@ class ServerPlugin(gobject.GObject):
gobject.GObject.__init__(self)
self._conn = None
- self._icon_cache = BuddyIconCache()
+ self._icon_cache = icon_cache
self._registry = registry
self._online_contacts = {} # handle -> jid