Tweaked signature warning display

This commit is contained in:
Mark Qvist 2023-10-31 22:29:07 +01:00
parent 5f74ac590c
commit 6b12bc7982
3 changed files with 10 additions and 5 deletions

View File

@ -681,7 +681,7 @@ class SidebandCore():
try:
if app_data == None:
app_data = b""
RNS.log("Received "+str(dest_type)+" announce for "+RNS.prettyhexrep(dest)+" with data: "+app_data.decode("utf-8"))
RNS.log("Received "+str(dest_type)+" announce for "+RNS.prettyhexrep(dest)+" with data: "+app_data.decode("utf-8"), RNS.LOG_DEBUG)
self._db_save_announce(dest, app_data, dest_type)
self.setstate("app.flags.new_announces", True)

View File

@ -39,8 +39,6 @@ class Conversations():
self.ids = None
if not self.app.root.ids.screen_manager.has_screen("conversations_screen"):
# TODO: Remove
RNS.log("Adding conversations screen", RNS.LOG_WARNING)
self.screen = Builder.load_string(conv_screen_kv)
self.screen.app = self.app
self.ids = self.screen.ids

View File

@ -293,8 +293,15 @@ class Messages():
heading_str += rcvd_d_str
pre_content = ""
force_markup = False
if not signature_valid:
pre_content += "[b]Warning![/b] The signature for this message could not be validated. Check that you have received an announce from this sender. If you already have, or other messages from the sender do not display this warning, [b]this message is likely to be fake[/b].\n\n"
identity_known = False
if RNS.Identity.recall(m["hash"]) != None:
identity_known = True
if identity_known == True:
pre_content += "[b]Warning![/b] The signature for this message could not be validated. [b]This message is likely to be fake[/b].\n\n"
force_markup = True
item = ListLXMessageCard(
text=pre_content+m["content"].decode("utf-8")+extra_content,
@ -312,7 +319,7 @@ class Messages():
item.ids.content_text.text_color = mt_color
item.ids.msg_submenu.theme_text_color = "Custom"
item.ids.msg_submenu.text_color = mt_color
item.ids.content_text.markup = self.is_trusted
item.ids.content_text.markup = self.is_trusted or force_markup
def gen_del(mhash, item):
def x():