Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes join when password is set for room. #578

Merged
merged 2 commits into from
Jan 12, 2016
Merged

Conversation

mslehto
Copy link
Contributor

@mslehto mslehto commented Jan 5, 2016

_join_room() was expecting compat_str() to bail out with None.
That is not the case anymore (commit 4ed92ff).
Therefore room JID was junk and password enabled XMPP MUC rooms could not be joined.

_join_room() was expecting compat_str() to bail out with None.
That is not the case anymore (commit 4ed92ff).
Therefore room JID was junk and password enabled XMPP MUC rooms could not be joined.
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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking for just tuples won't be sufficient here as a user could be using lists as well, which would give the same behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. I saw only tuples in config template so that's what I thought can ever exist:
https://github.com/errbotio/errbot/blob/master/errbot/config-template.py#L149

@zoni
Copy link
Member

zoni commented Jan 5, 2016

Damn, I thought I'd checked all the callers of that function so carefully 😞

Thanks for tracking down the issue and suggesting a fix. Just have a minor comment on it.

@mslehto
Copy link
Contributor Author

mslehto commented Jan 7, 2016

@zoni, is commit cc3d4d9 addressing your minor comment?

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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be written as if isinstance(room, (list, tuple)):

@zoni
Copy link
Member

zoni commented Jan 11, 2016

@mslehto I'm going to merge this when I have time tomorrow (go ahead and poke me again if I fail to).

I left a minor comment but don't worry about it, I'll change it myself when I merge it so you don't have to bother with such a trivial change yourself.

zoni added a commit that referenced this pull request Jan 12, 2016
Fixes join when password is set for room.
@zoni zoni merged commit d984c0d into errbotio:master Jan 12, 2016
@zoni
Copy link
Member

zoni commented Jan 12, 2016

See fd23ab7 😄 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants