Skip to content

Commit

Permalink
Merge pull request #578 from mslehto/mucpassword
Browse files Browse the repository at this point in the history
Fixes join when password is set for room.
  • Loading branch information
zoni committed Jan 12, 2016
2 parents 95039a5 + cc3d4d9 commit d984c0d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions errbot/core_plugins/chatRoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ def callback_connect(self):
self.log.exception("Joining room %s failed", repr(room))

def _join_room(self, room):
room_name = compat_str(room)
if room_name is not None:
room, username, password = (room_name, self.bot_config.CHATROOM_FN, None)
if isinstance(room, tuple) or isinstance(room, list):
room_name = compat_str(room[0])
room_password = compat_str(room[1])
room, username, password = (room_name, self.bot_config.CHATROOM_FN, room_password)
self.log.info("Joining room {} with username {} and password".format(room, username))
else:
room, username, password = (room[0], self.bot_config.CHATROOM_FN, room[1])
self.log.info("Joining room {} with username {}".format(room, username))
room_name = compat_str(room)
room, username, password = (room_name, self.bot_config.CHATROOM_FN, None)
self.log.info("Joining room {} with username {}".format(room, username))
try:
self.query_room(room).join(username=self.bot_config.CHATROOM_FN, password=password)
except NotImplementedError:
Expand Down

0 comments on commit d984c0d

Please sign in to comment.