Fix retracting UserTune/UserActivity
This commit is contained in:
parent
bbf3a544e8
commit
31d6235881
|
@ -87,8 +87,10 @@ class UserActivity(AbstractPEPModule):
|
||||||
return activity_dict or None
|
return activity_dict or None
|
||||||
|
|
||||||
def _build_node(self, data):
|
def _build_node(self, data):
|
||||||
activity, subactivity, message = data
|
|
||||||
item = nbxmpp.Node('activity', {'xmlns': self.namespace})
|
item = nbxmpp.Node('activity', {'xmlns': self.namespace})
|
||||||
|
if data is None:
|
||||||
|
return
|
||||||
|
activity, subactivity, message = data
|
||||||
if activity:
|
if activity:
|
||||||
i = item.addChild(activity)
|
i = item.addChild(activity)
|
||||||
if subactivity:
|
if subactivity:
|
||||||
|
|
|
@ -81,8 +81,10 @@ class UserTune(AbstractPEPModule):
|
||||||
return tune_dict or None
|
return tune_dict or None
|
||||||
|
|
||||||
def _build_node(self, data):
|
def _build_node(self, data):
|
||||||
artist, title, source, track, length = data
|
|
||||||
item = nbxmpp.Node('tune', {'xmlns': nbxmpp.NS_TUNE})
|
item = nbxmpp.Node('tune', {'xmlns': nbxmpp.NS_TUNE})
|
||||||
|
if data is None:
|
||||||
|
return item
|
||||||
|
artist, title, source, track, length = data
|
||||||
if artist:
|
if artist:
|
||||||
item.addChild('artist', payload=artist)
|
item.addChild('artist', payload=artist)
|
||||||
if title:
|
if title:
|
||||||
|
|
Loading…
Reference in New Issue