Hook up Buddy.add_activity() and Buddy.remove_activity()

master
Dan Williams 18 years ago
parent fa31b7c0bd
commit 31c69ed167

@ -451,6 +451,16 @@ class PresenceService(object):
if activity:
activity.add_service(service)
# Add the activity to its buddy
# FIXME: use something other than name to attribute to buddy
name = service.get_name()
buddy = None
try:
buddy = self._buddies[name]
buddy.add_activity(activity)
except KeyError:
pass
if not was_valid and activity.is_valid():
self._dbus_helper.ActivityAppeared(activity.object_path())
@ -460,7 +470,19 @@ class PresenceService(object):
return
if not self._activities.has_key(actid):
return
activity = self._activities[actid]
# Remove the activity from its buddy
# FIXME: use something other than name to attribute to buddy
name = service.get_name()
buddy = None
try:
buddy = self._buddies[name]
buddy.remove_activity(activity)
except KeyError:
pass
activity.remove_service(service)
if len(activity.get_services()) == 0:
# Kill the activity

Loading…
Cancel
Save