Work on Conversations UI

This commit is contained in:
Mark Qvist 2021-05-04 15:10:21 +02:00
parent f5d263ee31
commit 0c1108f00e
4 changed files with 57 additions and 12 deletions

View file

@ -13,5 +13,28 @@ class Conversation:
lxmessage.write_to_directory(conversation_path)
def __init__(self):
pass
@staticmethod
def conversation_list(app):
conversations = []
for entry in os.listdir(app.conversationpath):
if os.path.isdir(app.conversationpath + "/" + entry):
try:
conversations.append(Conversation(entry, app))
except Exception as e:
RNS.log("Error while loading conversation "+str(entry)+", skipping it. The contained exception was: "+str(e), RNS.LOG_ERROR)
return conversations
def __init__(self, source_hash, app):
self.source_hash = source_hash
self.message_path = app.conversationpath + "/" + source_hash
self.messages_load_time = None
self.messages = []
self.source_known = False
self.source_trusted = False
self.source_blocked = False
def __str__(self):
return self.source_hash