From eaa4315857a3e9266aa1f3e93aaf80f762c56698 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 20 Oct 2023 03:02:14 +0200 Subject: [PATCH] Added sorting by trusted status --- sbapp/ui/conversations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbapp/ui/conversations.py b/sbapp/ui/conversations.py index b9c12e3..8f82605 100644 --- a/sbapp/ui/conversations.py +++ b/sbapp/ui/conversations.py @@ -280,6 +280,8 @@ class Conversations(): item.iconr.bind(on_release=callback_factory(item, context_dest)) item.add_widget(item.iconr) + + item.trusted = self.app.sideband.is_trusted(context_dest) self.added_item_dests.append(context_dest) self.list.add_widget(item) @@ -296,7 +298,7 @@ class Conversations(): if w.text != disp_name: w.text = disp_name - self.list.children.sort(key=lambda w: w.last_activity) + self.list.children.sort(key=lambda w: (w.trusted, w.last_activity)) RNS.log("Updated conversation list widgets in "+RNS.prettytime(time.time()-us), RNS.LOG_DEBUG)