Add and remove activities to/from Buddy objects at appropriate times
This commit is contained in:
parent
38e85f3987
commit
9ce768ca39
@ -453,10 +453,8 @@ class PresenceService(object):
|
|||||||
|
|
||||||
# Add the activity to its buddy
|
# Add the activity to its buddy
|
||||||
# FIXME: use something other than name to attribute to buddy
|
# FIXME: use something other than name to attribute to buddy
|
||||||
name = service.get_name()
|
|
||||||
buddy = None
|
|
||||||
try:
|
try:
|
||||||
buddy = self._buddies[name]
|
buddy = self._buddies[service.get_name()]
|
||||||
buddy.add_activity(activity)
|
buddy.add_activity(activity)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
@ -473,18 +471,16 @@ class PresenceService(object):
|
|||||||
|
|
||||||
activity = self._activities[actid]
|
activity = self._activities[actid]
|
||||||
|
|
||||||
|
activity.remove_service(service)
|
||||||
|
if len(activity.get_services()) == 0:
|
||||||
# Remove the activity from its buddy
|
# Remove the activity from its buddy
|
||||||
# FIXME: use something other than name to attribute to buddy
|
# FIXME: use something other than name to attribute to buddy
|
||||||
name = service.get_name()
|
|
||||||
buddy = None
|
|
||||||
try:
|
try:
|
||||||
buddy = self._buddies[name]
|
buddy = self._buddies[service.get_name()]
|
||||||
buddy.remove_activity(activity)
|
buddy.remove_activity(activity)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
activity.remove_service(service)
|
|
||||||
if len(activity.get_services()) == 0:
|
|
||||||
# Kill the activity
|
# Kill the activity
|
||||||
self._dbus_helper.ActivityDisappeared(activity.object_path())
|
self._dbus_helper.ActivityDisappeared(activity.object_path())
|
||||||
del self._activities[actid]
|
del self._activities[actid]
|
||||||
|
Loading…
Reference in New Issue
Block a user