From 52b8888c3b3ca1ac5015bbb9e04ee14938545e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Pav=C3=B3n=20Abi=C3=A1n?= Date: Sun, 1 Feb 2026 20:41:43 +0100 Subject: [PATCH] Commit --- src/controller/buffers/blueski/chat.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/controller/buffers/blueski/chat.py b/src/controller/buffers/blueski/chat.py index b7fef7d5..64a58132 100644 --- a/src/controller/buffers/blueski/chat.py +++ b/src/controller/buffers/blueski/chat.py @@ -5,6 +5,7 @@ import output from .base import BaseBuffer from wxUI.buffers.blueski import panels as BlueskiPanels from sessions.blueski import compose +from mysc.thread_utils import call_threaded log = logging.getLogger("controller.buffers.blueski.chat") @@ -96,14 +97,15 @@ class ChatBuffer(BaseBuffer): if dlg.ShowModal() == wx.ID_OK: text = dlg.GetValue() if text: - try: - self.session.send_chat_message(self.convo_id, text) - self.session.sound.play("dm_sent.ogg") - output.speak(_("Message sent.")) - # Refresh - self.start_stream(mandatory=True, play_sound=False) - except: - output.speak(_("Failed to send message.")) + def do_send(): + try: + self.session.send_chat_message(self.convo_id, text) + wx.CallAfter(self.session.sound.play, "dm_sent.ogg") + wx.CallAfter(output.speak, _("Message sent.")) + wx.CallAfter(self.start_stream, True, False) + except Exception: + wx.CallAfter(output.speak, _("Failed to send message."), True) + call_threaded(do_send) dlg.Destroy() def send_message(self, *args, **kwargs):