diff options
author | Ryan Huber <rhuber@gmail.com> | 2015-11-12 18:28:55 -0800 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2015-11-12 18:28:55 -0800 |
commit | 0fc4e9a959ac7da1b79940b9a633390a7f5a9a7c (patch) | |
tree | 1822567ff9dd288bcf5badcd6d8dc6a4c6c31a96 | |
parent | 9b39ac4e45d935123074db08140155461a947d83 (diff) | |
parent | 5eb0a19aeec23324ccc3a245613eab0a48f5d398 (diff) | |
download | wee-slack-0fc4e9a959ac7da1b79940b9a633390a7f5a9a7c.tar.gz |
Merge pull request #116 from trygveaa/fix/decode-message-error
Only decode messages if they are not already unicode
-rw-r--r-- | wee_slack.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index 39365fb..000562b 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -591,7 +591,8 @@ class Channel(object): name = name.decode('utf-8') #colorize nicks in each line chat_color = w.config_string(w.config_get('weechat.color.chat')) - message = message.decode('UTF-8', 'replace') + if type(message) is not unicode: + message = message.decode('UTF-8', 'replace') for user in self.server.users: if user.name in message: message = user.name_regex.sub( |