diff options
author | André Apitzsch <git@apitzsch.eu> | 2020-04-24 12:03:22 +0300 |
---|---|---|
committer | André Apitzsch <git@apitzsch.eu> | 2020-04-24 12:03:22 +0300 |
commit | 48974ece44aac2c444d284a9e821ad74e46e03f4 (patch) | |
tree | a6345d1907b362870787660737eeda4cc953fcae /nbxmpp | |
parent | b70acbc1b363cf5e30bb1a58c057769a547994f6 (diff) |
Fix reset of location/tune pubsub
Diffstat (limited to 'nbxmpp')
-rw-r--r-- | nbxmpp/modules/location.py | 12 | ||||
-rw-r--r-- | nbxmpp/modules/tune.py | 12 |
2 files changed, 10 insertions, 14 deletions
diff --git a/nbxmpp/modules/location.py b/nbxmpp/modules/location.py index debcf2d..9720bdc 100644 --- a/nbxmpp/modules/location.py +++ b/nbxmpp/modules/location.py @@ -64,13 +64,11 @@ class Location(BaseModule): def set_location(self, data): item = Node('geoloc', {'xmlns': Namespace.LOCATION}) - if data is None: - return - - data = data._asdict() - for tag, value in data: - if value is not None: - item.addChild(tag, payload=value) + if data is not None: + data = data._asdict() + for tag, value in data: + if value is not None: + item.addChild(tag, payload=value) jid = self._client.get_bound_jid().getBare() self._client.get_module('PubSub').publish( diff --git a/nbxmpp/modules/tune.py b/nbxmpp/modules/tune.py index 92acc38..8648bde 100644 --- a/nbxmpp/modules/tune.py +++ b/nbxmpp/modules/tune.py @@ -64,13 +64,11 @@ class Tune(BaseModule): def set_tune(self, data): item = Node('tune', {'xmlns': Namespace.TUNE}) - if data is None: - return - - data = data._asdict() - for tag, value in data.items(): - if value is not None: - item.addChild(tag, payload=value) + if data is not None: + data = data._asdict() + for tag, value in data.items(): + if value is not None: + item.addChild(tag, payload=value) jid = self._client.get_bound_jid().getBare() self._client.get_module('PubSub').publish( |