summaryrefslogtreecommitdiff
path: root/src/sessionManager.cpp
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-03-23 12:56:38 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-04-03 18:31:41 +0800
commit50de5f9b80f1859b6eaa3b68c10a3f1cfb994737 (patch)
treebd125b0af19af04776e3740f707a0012555d460f /src/sessionManager.cpp
parentb02e484013ede3ed8d43ad19c177af2afb0bbfc8 (diff)
feat: deaf
necessary for being deaf during registeration
Diffstat (limited to 'src/sessionManager.cpp')
-rw-r--r--src/sessionManager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sessionManager.cpp b/src/sessionManager.cpp
index 3d60db2..d1cf953 100644
--- a/src/sessionManager.cpp
+++ b/src/sessionManager.cpp
@@ -91,8 +91,10 @@ void CSessionManager::kick(std::pair<std::jthread, std::shared_ptr<CSession>> *s
auto it = std::ranges::find_if(m_vSessions, [session](const auto &s) { return s.second.get() == session->second.get(); });
if (it != m_vSessions.end()) {
- if (!reason.empty())
+ if (!reason.empty()) {
+ it->second->setDeaf(false);
it->second->write(reason);
+ }
const auto native_handle = it->first.native_handle();
if (it->first.joinable())
it->first.detach(); // .detach the thread since it's removing itself