aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2016-02-12 08:12:59 -0800
committerRyan Huber <rhuber@gmail.com>2016-02-12 08:12:59 -0800
commita9d75a8a6d7cec37b29a5614385190763ec1ed58 (patch)
tree14f622a87eee61b0ae3e27a4f41275d7cc80da24 /wee_slack.py
parentc7adeb8362f4252232e76b44fa14459772f9e970 (diff)
parenta0473896fb913de327dd1394f5211faf8eb84918 (diff)
downloadwee-slack-a9d75a8a6d7cec37b29a5614385190763ec1ed58.tar.gz
Merge pull request #156 from odknt/fix-encoding-bug
Fix bug that fail to modify previous message if contain non-ascii characters
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 4257d5b..a2397a2 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -331,7 +331,7 @@ def buffer_input_cb(b, buffer, data):
elif data.count('/') == 3:
old, new = data.split('/')[1:3]
channel = channels.find(buffer)
- channel.change_previous_message(old, new)
+ channel.change_previous_message(old.decode("utf-8"), new.decode("utf-8"))
channel.mark_read(True)
return w.WEECHAT_RC_ERROR
@@ -700,7 +700,7 @@ class Channel(object):
async_slack_api_request(self.server.domain, self.server.token, 'chat.delete', {"channel": self.identifier, "ts": message['ts']})
else:
new_message = message["text"].replace(old, new)
- async_slack_api_request(self.server.domain, self.server.token, 'chat.update', {"channel": self.identifier, "ts": message['ts'], "text": new_message})
+ async_slack_api_request(self.server.domain, self.server.token, 'chat.update', {"channel": self.identifier, "ts": message['ts'], "text": new_message.encode("utf-8")})
def my_last_message(self):
for message in reversed(self.messages):