aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2017-11-21 18:28:33 +0100
committerGitHub <noreply@github.com>2017-11-21 18:28:33 +0100
commite7cec685235876febdb2b4d6c7918d1d85291ae6 (patch)
treef8320361042c4bd715d3f53dded0ccd47a669555 /wee_slack.py
parent385fdb4efd25a2e173eba62cb787a03cefa0b69e (diff)
parent986b294eb0ae6ec5149accbc39d1de41bb5d4bb5 (diff)
downloadwee-slack-e7cec685235876febdb2b4d6c7918d1d85291ae6.tar.gz
Merge pull request #464 from trygveaa/send-special-messages
Allow sending special messages by escaping them with / or \
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 216c911..3b46bc0 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -644,7 +644,7 @@ def buffer_input_callback(signal, buffer_ptr, data):
if not channel:
return w.WEECHAT_RC_ERROR
- reaction = re.match("^\s*(\d*)(\+|-):(.*):\s*$", data)
+ reaction = re.match("^(\d*)(\+|-):(.*):\s*$", data)
substitute = re.match("^(\d*)s/", data)
if reaction:
if reaction.group(2) == "+":
@@ -664,6 +664,8 @@ def buffer_input_callback(signal, buffer_ptr, data):
old = old.replace(r'\/', '/')
channel.edit_nth_previous_message(msgno, old, new, flags)
else:
+ if data.startswith(('//', ' ')):
+ data = data[1:]
channel.send_message(data)
# this is probably wrong channel.mark_read(update_remote=True, force=True)
return w.WEECHAT_RC_OK