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-09-20 12:54:23 (GMT)
committer Simon McVittie <simon.mcvittie@collabora.co.uk>2007-09-20 12:54:23 (GMT)
commit421433db5a24b5ff25a51f38e7c2299370c61854 (patch)
tree745b78ca9d2474e1e080d0e206fc57d6e0f25d66
parent594333b333ed58887228ac7c69fdd4dc59c148e4 (diff)
Don't keep invite-only activities in the mesh view after we leave them (#3465)
-rw-r--r--NEWS3
-rw-r--r--src/activity.py15
2 files changed, 18 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 16f1c57..1e71da1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+* #3465: don't keep invite-only activities in the mesh view after we leave
+ them (smcv)
+
Snapshot 6df1f3eca5
* #3506: LL and server plugins are mutually exclusive for trial-3 (dcbw)
diff --git a/src/activity.py b/src/activity.py
index 23c4356..d841552 100644
--- a/src/activity.py
+++ b/src/activity.py
@@ -149,6 +149,9 @@ class Activity(ExportedGObject):
# this is kept in sync with reality. If _joined is False this is
# based on buddies' claimed activities.
self._buddies = set()
+ # The buddies claiming to be in the channel. If _joined is False
+ # this is the same as _buddies.
+ self._claimed_buddies = set()
# Equal to (self._self_handle in self._handle_to_buddy.keys())
self._joined = False
@@ -653,6 +656,7 @@ class Activity(ExportedGObject):
This method is called by the PresenceService on the local machine.
"""
+ self._claimed_buddies.add(buddy)
if self._joined:
_logger.debug("Ignoring alleged join to activity %s that I'm in: "
"I can already see who's there", self._id)
@@ -707,6 +711,7 @@ class Activity(ExportedGObject):
If this activity is "valid", a BuddyLeft signal is also sent.
This method is called by the PresenceService on the local machine.
"""
+ self._claimed_buddies.discard(buddy)
if not self._joined:
self._remove_buddies((buddy,))
@@ -1039,6 +1044,16 @@ class Activity(ExportedGObject):
This callback is set up in the _handle_share_join method.
"""
self._joined = False
+
+ # Remove people who claim not to be in the activity, and add people
+ # who were not in the activity but claimed to be. The first part
+ # fixes a bug where invite-only activities would still appear after
+ # we joined and left them, even if everyone else subsequently left too.
+ old_buddies = self._buddies - self._claimed_buddies
+ new_buddies = self._claimed_buddies - self._buddies
+ self._remove_buddies(old_buddies)
+ self._add_buddies(new_buddies)
+
self._handle_to_buddy = {}
self._self_handle = None
self._text_channel = None