irc: send before closing dialog and force a post-close refresh; add refreshView helper

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-09-20 02:30:59 +03:00
parent ed22622ecd
commit ef3db25cd0

View File

@@ -427,8 +427,15 @@ function IrcChatView:promptSendMessage()
is_default = true,
callback = function()
local txt = dialog:getInputText()
UIManager:close(dialog)
-- Update buffer/UI before closing dialog to ensure immediate repaint
self:sendMessage(txt)
UIManager:close(dialog)
-- And schedule a focused refresh after the dialog is gone
if UIManager and self._ui_open then
UIManager:nextTick(function()
self:refreshView(self._current_target or "*")
end)
end
end,
},
{
@@ -444,6 +451,22 @@ function IrcChatView:promptSendMessage()
dialog:onShowKeyboard(true)
end
function IrcChatView:refreshView(target)
target = target or self._current_target or "*"
if not self._ui_open then return end
self:preloadHistory(target)
if self.scroll_text_w and self.scroll_text_w.text_widget then
self.scroll_text_w.text_widget:setText(self._buffers[target] or "")
self.scroll_text_w:scrollToBottom()
if self.scroll_text_w.updateScrollBar then
self.scroll_text_w:updateScrollBar(true)
end
end
if UIManager and self.frame and self.frame.dimen then
UIManager:setDirty(self, function() return "ui", self.frame.dimen end)
end
end
function IrcChatView:receiveLoop()
if self._closing then return end
if not self._sock then return end