Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/nbxmpp
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2020-10-11 16:04:57 +0300
committerlovetox <philipp@hoerist.com>2020-10-11 16:04:57 +0300
commitdd866a2751ca90328eacf73a0f8d25dde9deffb1 (patch)
treea87bc23eda96dbb6869bd480132719d0ca8ee1f5 /nbxmpp
parent8e99facd2bbd48c493f9c054c68f24e9665fe083 (diff)
Location: Use tasks
Diffstat (limited to 'nbxmpp')
-rw-r--r--nbxmpp/modules/location.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/nbxmpp/modules/location.py b/nbxmpp/modules/location.py
index 330a75a..1e29c40 100644
--- a/nbxmpp/modules/location.py
+++ b/nbxmpp/modules/location.py
@@ -21,6 +21,8 @@ from nbxmpp.structs import StanzaHandler
from nbxmpp.structs import LocationData
from nbxmpp.const import LOCATION_DATA
from nbxmpp.modules.base import BaseModule
+from nbxmpp.modules.util import finalize
+from nbxmpp.task import iq_request_task
class Location(BaseModule):
@@ -67,7 +69,10 @@ class Location(BaseModule):
properties.pubsub_event = pubsub_event
+ @iq_request_task
def set_location(self, data):
+ task = yield
+
item = Node('geoloc', {'xmlns': Namespace.LOCATION})
if data is not None:
data = data._asdict()
@@ -75,4 +80,6 @@ class Location(BaseModule):
if value is not None:
item.addChild(tag, payload=value)
- self.publish(Namespace.LOCATION, item, id_='current')
+ result = yield self.publish(Namespace.LOCATION, item, id_='current')
+
+ yield finalize(task, result)