diff options
author | oda <oda@headjapan.com> | 2016-01-13 17:53:58 +0900 |
---|---|---|
committer | oda <oda@headjapan.com> | 2016-01-13 18:15:27 +0900 |
commit | a0473896fb913de327dd1394f5211faf8eb84918 (patch) | |
tree | ac4dedb69bde1e7710c85b09cf78933a1ba2b3a4 /wee_slack.py | |
parent | 24b5d143282f9d210b4aea8c9b18f3a65029dea1 (diff) | |
download | wee-slack-a0473896fb913de327dd1394f5211faf8eb84918.tar.gz |
Fix bug that fail to modify previous message if contain non-ascii characters
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index c8d24ee..14e4b73 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -328,7 +328,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 @@ -693,7 +693,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): |