Run UI-side message cleaning with hub lock

This commit is contained in:
Mark Qvist 2026-05-22 11:48:36 +02:00
parent a1b1aea83d
commit d661ba0531
2 changed files with 19 additions and 16 deletions

View file

@ -815,9 +815,11 @@ class RRCHub:
self._append_history(target_room, msg)
self._clean_history()
def get_messages(self, room):
with self._lock:
buf = list(self.messages.get(room, []))
def get_messages(self, room, take_lock=True):
if take_lock:
with self._lock: buf = list(self.messages.get(room, []))
else: buf = list(self.messages.get(room, []))
return buf
def _on_packet(self, data):