Clear attachments list when switching to a new message in chats

This commit is contained in:
Manuel Cortez 2018-12-10 02:32:57 -06:00
parent 217765254d
commit 7fa35f18e4

View File

@ -613,7 +613,6 @@ class empty(object):
class chatBuffer(baseBuffer):
def insert(self, item, reversed=False):
""" Add a new item to the list. Uses session.composefunc for parsing the dictionary and create a valid result for putting it in the list."""
item_ = getattr(renderers, self.compose_function)(item, self.session)
@ -659,6 +658,7 @@ class chatBuffer(baseBuffer):
if msg.has_key("attachments") and len(msg["attachments"]) > 0:
self.tab.attachments.list.Enable(True)
self.attachments = list()
self.tab.attachments.clear()
self.parse_attachments(msg)
else:
self.tab.attachments.list.Enable(False)