mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2024-10-01 03:35:38 -04:00
pantalaimon: Only send UI messages if there is a queue.
This commit is contained in:
parent
ad65fbf1a7
commit
b9d518fad8
@ -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…
Reference in New Issue
Block a user