Commit 225bfb59 authored by Philipp Hörist's avatar Philipp Hörist

UserNickame: Add option to make node public

parent fda964ed
Pipeline #6745 passed with stages
in 1 minute and 12 seconds
......@@ -91,13 +91,24 @@ class Nickname(BaseModule):
return nickname.getData() or None
def set_nickname(self, nickname):
def set_nickname(self, nickname, public=False):
task = yield
access_model = 'open' if public else 'presence'
options = {
'pubsub#persist_items': 'true',
'pubsub#access_model': access_model,
item = Node('nick', {'xmlns': Namespace.NICK})
if nickname is not None:
result = yield self.publish(Namespace.NICK, item, id_='current')
result = yield self.publish(Namespace.NICK,
yield finalize(task, result)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment