diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-05-21 18:01:42 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-05-21 22:49:45 +0800 |
| commit | 815c3955dbd9ff7e1a427cf4bc66da38b581b178 (patch) | |
| tree | 37b7b20175aeadf789e990fac7bd364792dd7e49 /src/inputManager.cpp | |
| parent | a7cd7d8eb37c50554ae7c75f2ba94db74d293a1b (diff) | |
feat: join and leave message
internal: refactored messaging management, use instnace pointer for
verification of session
Diffstat (limited to 'src/inputManager.cpp')
| -rw-r--r-- | src/inputManager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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<ftxui::Element> 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); |
