mirror of
https://github.com/markqvist/NomadNet.git
synced 2026-11-25 09:26:21 -05:00
Run UI-side message cleaning with hub lock
This commit is contained in:
parent
a1b1aea83d
commit
d661ba0531
2 changed files with 19 additions and 16 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue