diff options
author | Ryan Huber <rhuber@gmail.com> | 2015-11-17 02:56:46 +0000 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2015-11-17 02:56:46 +0000 |
commit | e1188849323e17de1a348dfb163acdb0028a4b8f (patch) | |
tree | 668782d78a7938575f11460f05c201be8ac73ca6 | |
parent | 03b19fddea92c1108086f4d26e970a624f2b68a1 (diff) | |
download | wee-slack-e1188849323e17de1a348dfb163acdb0028a4b8f.tar.gz |
open channels or users
-rw-r--r-- | wee_slack.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/wee_slack.py b/wee_slack.py index 777bf0c..dffb6e0 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -912,11 +912,13 @@ def me_command_cb(data, current_buffer, args): def join_command_cb(data, current_buffer, args): - user = args.split()[1] - servers.find(current_domain_name()).users.find(user).open() + server = servers.find(current_domain_name()) if channels.find(current_buffer) or servers.find(current_buffer): - channel = args.split()[1] - channel = servers.find(current_domain_name()).channels.find(channel) + arg = args.split()[1] + if server.channels.find(arg): + channel = server.channels.find(arg) + elif server.users.find(arg): + channel = server.users.find(arg) channel.open() if w.config_get_plugin('switch_buffer_on_join') != '0': w.buffer_set(channel.channel_buffer, "display", "1") |