Added new message indicator.

This commit is contained in:
Mark Qvist 2021-09-05 20:38:10 +02:00
parent 675946e2b7
commit 903c75db0f
4 changed files with 72 additions and 1 deletions

View file

@ -205,6 +205,18 @@ class NomadNetworkApp:
def conversations(self):
return nomadnet.Conversation.conversation_list(self)
def conversation_is_unread(self, source_hash):
if bytes.fromhex(source_hash) in nomadnet.Conversation.unread_conversations:
return True
else:
return False
def mark_conversation_read(self, source_hash):
if bytes.fromhex(source_hash) in nomadnet.Conversation.unread_conversations:
nomadnet.Conversation.unread_conversations.pop(bytes.fromhex(source_hash))
if os.path.isfile(self.conversationpath + "/" + source_hash + "/unread"):
os.unlink(self.conversationpath + "/" + source_hash + "/unread")
def createDefaultConfig(self):
self.config = ConfigObj(__default_nomadnet_config__)
self.config.filename = self.configpath