Added sorting by trusted status

This commit is contained in:
Mark Qvist 2023-10-20 03:02:14 +02:00
parent 01f5d33be4
commit eaa4315857
1 changed files with 3 additions and 1 deletions

View File

@ -280,6 +280,8 @@ class Conversations():
item.iconr.bind(on_release=callback_factory(item, context_dest)) item.iconr.bind(on_release=callback_factory(item, context_dest))
item.add_widget(item.iconr) item.add_widget(item.iconr)
item.trusted = self.app.sideband.is_trusted(context_dest)
self.added_item_dests.append(context_dest) self.added_item_dests.append(context_dest)
self.list.add_widget(item) self.list.add_widget(item)
@ -296,7 +298,7 @@ class Conversations():
if w.text != disp_name: if w.text != disp_name:
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) RNS.log("Updated conversation list widgets in "+RNS.prettytime(time.time()-us), RNS.LOG_DEBUG)