comparison src/plugins/plugin_xep_0045.py @ 2028:70bd7b242a9e

plugin XEP-0045: fixed options parameter handling in bridge callback
author Goffi <goffi@goffi.org>
date Mon, 08 Aug 2016 00:50:01 +0200
parents 6c51e8f17c92
children b99bd02ea643
comparison
equal deleted inserted replaced
2027:666b42c957b5 2028:70bd7b242a9e
386 386
387 @return: unicode 387 @return: unicode
388 """ 388 """
389 return self.host.memory.getConfig(CONFIG_SECTION, 'default_muc', default_conf['default_muc']) 389 return self.host.memory.getConfig(CONFIG_SECTION, 'default_muc', default_conf['default_muc'])
390 390
391 def _join(self, room_jid_s, nick, options=None, profile_key=C.PROF_KEY_NONE): 391 def _join(self, room_jid_s, nick, options, profile_key=C.PROF_KEY_NONE):
392 """join method used by bridge 392 """join method used by bridge
393 393
394 @return: unicode (the room bare) 394 @return: unicode (the room bare)
395 """ 395 """
396 client = self.host.getClient(profile_key) 396 client = self.host.getClient(profile_key)
403 if not room_jid.user: 403 if not room_jid.user:
404 room_jid.user, room_jid.host = room_jid.host, muc_service 404 room_jid.user, room_jid.host = room_jid.host, muc_service
405 else: 405 else:
406 room_jid = self.getUniqueName(profile_key=client.profile) 406 room_jid = self.getUniqueName(profile_key=client.profile)
407 # TODO: error management + signal in bridge 407 # TODO: error management + signal in bridge
408 d = self.join(client, room_jid, nick, options) 408 d = self.join(client, room_jid, nick, options or None)
409 return d.addCallback(lambda room: room.roomJID.userhost()) 409 return d.addCallback(lambda room: room.roomJID.userhost())
410 410
411 def join(self, client, room_jid, nick=None, options=None): 411 def join(self, client, room_jid, nick=None, options=None):
412 if not nick: 412 if not nick:
413 nick = client.jid.user 413 nick = client.jid.user