aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2014-11-23 10:20:52 -0800
committerRyan Huber <rhuber@gmail.com>2014-11-23 10:20:52 -0800
commitc3c339c9ef9d968d6f8f7e310b12efb7bbc2d4ac (patch)
tree9e92a753a20e0179a2d556447530d5dc038ab318 /wee_slack.py
parent1f773560d3881c61cca496b6c2d6a13e66c207c7 (diff)
downloadwee-slack-c3c339c9ef9d968d6f8f7e310b12efb7bbc2d4ac.tar.gz
fix html entities in message text
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 676e8e8..102211f 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -7,6 +7,7 @@ import sha
import re
import urllib
import urlparse
+import HTMLParser
from websocket import create_connection
#hack to make tests possible.. better way?
@@ -430,7 +431,7 @@ class Channel(SlackThing):
if message != self.previous_prnt_message:
if message.startswith(self.previous_prnt_message):
message = message[len(self.previous_prnt_message):]
- #dbg([message, self.previous_prnt_message])
+ message = HTMLParser.HTMLParser().unescape(message)
w.prnt_date_tags(self.channel_buffer, time, tags, "%s\t%s" % (name, message))
#eventually maybe - doesn't reprint name if next message is same user
#if name != self.previous_prnt_name:
@@ -969,7 +970,7 @@ def slack_ping_cb(data, remaining):
def slack_connection_persistence_cb(data, remaining_calls):
for server in servers:
if not server.connected:
- w.prnt("", "%s disconnected from slack, trying to reconnect.." % (server.token))
+ server.buffer_prnt("Disconnected from slack, trying to reconnect..")
if server.ws_hook != None:
w.unhook(server.ws_hook)
server.connect_to_slack()