From 2ff4b1e54d54d0bed7ecdcc79a3abf9d160d691a Mon Sep 17 00:00:00 2001 From: Morgan Collett Date: Mon, 15 Oct 2007 15:48:16 +0000 Subject: Revert "Maintain local handle to buddy cache" This reverts commit 64340f33cf322ebcfdbf6349c14b2bd296a6c9d0. --- diff --git a/activity.py b/activity.py index 65379d3..f2156b5 100644 --- a/activity.py +++ b/activity.py @@ -195,7 +195,6 @@ class HelloTube(ExportedGObject): self.entered = False # Have we set up the tube? self.helloworld = False # Trivial "game state" self._get_buddy = get_buddy # Converts handle to Buddy object - self._handle_to_buddy = {} # Cache buddy handles self.tube.watch_participants(self.participant_change_cb) def participant_change_cb(self, added, removed): @@ -206,10 +205,9 @@ class HelloTube(ExportedGObject): for handle, bus_name in added: buddy = self._get_buddy(handle) if buddy is not None: - self._logger.debug('Buddy %s was added', buddy.props.nick) - self._handle_to_buddy[handle] = buddy + self._logger.debug('Buddy %s was added' % buddy.props.nick) for handle in removed: - buddy = self._handle_to_buddy.pop(handle, None) + buddy = self._get_buddy(handle) if buddy is not None: self._logger.debug('Buddy %s was removed', buddy.props.nick) if not self.entered: -- cgit v0.9.1