From 815c3955dbd9ff7e1a427cf4bc66da38b581b178 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 21 May 2025 18:01:42 +0800 Subject: feat: join and leave message internal: refactored messaging management, use instnace pointer for verification of session --- src/inputManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/inputManager.cpp') diff --git a/src/inputManager.cpp b/src/inputManager.cpp index cc3880b..d392081 100644 --- a/src/inputManager.cpp +++ b/src/inputManager.cpp @@ -25,7 +25,7 @@ CInputManager::CInputManager() })) , logComponent(ftxui::Renderer([] { std::vector messages; - for (const auto &[chat, log] : g_pIOManager->getIO()) { + for (const auto &[chat, log, custom] : g_pIOManager->getIO()) { if (chat && !chat->msg.empty()) { std::string username = chat->username; if (username.back() == '\n') @@ -33,6 +33,8 @@ CInputManager::CInputManager() messages.push_back(ftxui::window(ftxui::text(username), ftxui::paragraph(chat->msg))); } else if (log && !log->log.empty()) messages.push_back(ftxui::window(ftxui::text(NFormatter::fmt(log->type, "")), ftxui::paragraph(log->log))); + else if (custom) + messages.push_back(ftxui::window(ftxui::text(custom->first), ftxui::paragraph(custom->second))); } return ftxui::vbox(messages); -- cgit v1.2.3