aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2015-11-19 00:30:57 +0000
committerRyan Huber <rhuber@gmail.com>2015-11-19 00:30:57 +0000
commit2c83f6768740eeaebc1cc0e65555b418362411c1 (patch)
tree6ee88689f6d9d762f69d388c50740a149638444f
parent740bc9c125776a15d4b0825db4118867a17ff429 (diff)
downloadwee-slack-2c83f6768740eeaebc1cc0e65555b418362411c1.tar.gz
don't eat query and join!
-rw-r--r--wee_slack.py30
1 files changed, 18 insertions, 12 deletions
diff --git a/wee_slack.py b/wee_slack.py
index fc57867..aac45a8 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -908,8 +908,10 @@ def me_command_cb(data, current_buffer, args):
def join_command_cb(data, current_buffer, args):
- command_talk(current_buffer, args.split()[1])
- return w.WEECHAT_RC_OK_EAT
+ if command_talk(current_buffer, args.split()[1]):
+ return w.WEECHAT_RC_OK_EAT
+ else:
+ return w.WEECHAT_RC_OK
def part_command_cb(data, current_buffer, args):
if channels.find(current_buffer) or servers.find(current_buffer):
@@ -964,17 +966,21 @@ def command_talk(current_buffer, args):
"""
server = servers.find(current_domain_name())
- channel = server.channels.find(args)
- if channel:
- channel.open()
- else:
- user = server.users.find(args)
- if user:
- user.create_dm_channel()
+ if server:
+ channel = server.channels.find(args)
+ if channel:
+ channel.open()
else:
- server.buffer_prnt("User or channel {} not found.".format(args))
- if w.config_get_plugin('switch_buffer_on_join') != '0':
- w.buffer_set(channel.channel_buffer, "display", "1")
+ user = server.users.find(args)
+ if user:
+ user.create_dm_channel()
+ else:
+ server.buffer_prnt("User or channel {} not found.".format(args))
+ if w.config_get_plugin('switch_buffer_on_join') != '0':
+ w.buffer_set(channel.channel_buffer, "display", "1")
+ return True
+ else:
+ return False
def command_join(current_buffer, args):
"""