mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2025-07-16 19:48:50 -04:00
pantalaimon: Only send UI messages if there is a queue.
This commit is contained in:
parent
ad65fbf1a7
commit
b9d518fad8
2 changed files with 4 additions and 2 deletions
|
@ -222,7 +222,8 @@ class PanClient(AsyncClient):
|
|||
|
||||
async def send_message(self, message):
|
||||
"""Send a thread message to the UI thread."""
|
||||
await self.queue.put(message)
|
||||
if self.queue:
|
||||
await self.queue.put(message)
|
||||
|
||||
async def send_update_devices(self, devices):
|
||||
"""Send a dictionary of devices to the UI thread."""
|
||||
|
|
|
@ -259,7 +259,8 @@ class ProxyDaemon:
|
|||
|
||||
async def send_ui_message(self, message):
|
||||
"""Send a thread message to the UI thread."""
|
||||
await self.send_queue.put(message)
|
||||
if self.send_queue:
|
||||
await self.send_queue.put(message)
|
||||
|
||||
async def receive_message(self, message):
|
||||
client = self.pan_clients.get(message.pan_user)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue