Fix retracting UserTune/UserActivity

This commit is contained in:
Philipp Hörist 2018-07-05 19:21:58 +02:00
parent bbf3a544e8
commit 31d6235881
2 changed files with 6 additions and 2 deletions

View File

@ -87,8 +87,10 @@ class UserActivity(AbstractPEPModule):
return activity_dict or None
def _build_node(self, data):
activity, subactivity, message = data
item = nbxmpp.Node('activity', {'xmlns': self.namespace})
if data is None:
return
activity, subactivity, message = data
if activity:
i = item.addChild(activity)
if subactivity:

View File

@ -81,8 +81,10 @@ class UserTune(AbstractPEPModule):
return tune_dict or None
def _build_node(self, data):
artist, title, source, track, length = data
item = nbxmpp.Node('tune', {'xmlns': nbxmpp.NS_TUNE})
if data is None:
return item
artist, title, source, track, length = data
if artist:
item.addChild('artist', payload=artist)
if title: