aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2014-11-03 14:57:53 -0800
committerRyan Huber <rhuber@gmail.com>2014-11-03 14:57:53 -0800
commitb0786b5ccba507961df683dd1bd086d4916d7fd2 (patch)
tree34224eab7f6f7f5a47dcc458d558f64df6b8e072 /wee_slack.py
parent15b3cf008e6e46b698c252ac060b39eaa5b963a7 (diff)
downloadwee-slack-b0786b5ccba507961df683dd1bd086d4916d7fd2.tar.gz
don't repeat overlapped message bits + open buffer
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 06227ee..219599f 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -414,6 +414,8 @@ class Channel(SlackThing):
else:
name = user
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])
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
@@ -426,7 +428,7 @@ class Channel(SlackThing):
if set_read_marker:
self.mark_read(False)
else:
- dbg("failed to print something..")
+ self.open(False)
def get_history(self):
if self.active:
t = time.time()
@@ -650,6 +652,7 @@ def slack_websocket_cb(data, fd):
function_name = "unknown"
try:
proc[function_name](message_json)
+ dbg(function_name)
except KeyError:
pass
if function_name: