Preserve the last seen timestamp
So that we can mark posts from bots as read. Otherwise we could end up sending empty messages until another human posts. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
49d5be8a76
commit
a88669d5e4
|
@ -57,6 +57,9 @@ class Message:
|
|||
links = []
|
||||
count = 0
|
||||
for line in self.__text:
|
||||
if len(line) == 0:
|
||||
continue
|
||||
|
||||
line, link = _text_parse_tags(line)
|
||||
while line.count("[#####]") > 0:
|
||||
line = line.replace("[#####]", "[%s]" % count, 1)
|
||||
|
@ -65,6 +68,8 @@ class Message:
|
|||
lines += [ "" ] + textwrap.wrap(line)
|
||||
links += link
|
||||
|
||||
if len(lines) == 0:
|
||||
return ""
|
||||
text = "\n ".join(lines)
|
||||
if len(links) > 0:
|
||||
text += "\n __________"
|
||||
|
|
|
@ -51,11 +51,11 @@ class Thread:
|
|||
self.fetch_info()
|
||||
|
||||
# Read original message list
|
||||
o_list = []
|
||||
for message in self.do_fetch_messages(self.__last_ts):
|
||||
if message["text"] != None and len(message["text"]) > 0:
|
||||
o_list += [ chat.Message(message) ]
|
||||
messages = self.do_fetch_messages(self.__last_ts)
|
||||
o_list = [ chat.Message(msg) for msg in messages ]
|
||||
o_list.sort()
|
||||
if len(o_list) == 0:
|
||||
return o_list
|
||||
|
||||
# Merge together messages from the same user
|
||||
m_list = [ o_list[0] ]
|
||||
|
|
Loading…
Reference in New Issue