summaryrefslogtreecommitdiff
path: root/src/session.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/session.cpp')
-rw-r--r--src/session.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/session.cpp b/src/session.cpp
index d88af2f..e8597e3 100644
--- a/src/session.cpp
+++ b/src/session.cpp
@@ -86,8 +86,8 @@ void CSession::recvLoop() {
}
const auto isCommand = g_pCommandHandler->isCommand(recvData->data);
- if (m_isAdmin && isCommand)
- g_pCommandHandler->handleCommand(recvData->data, m_ip);
+ if (isCommand)
+ g_pCommandHandler->handleCommand(recvData->data, this);
g_pChatManager->newMessage({.msg = recvData->data, .username = m_name, .admin = isCommand});
}
@@ -270,6 +270,10 @@ const std::string &CSession::getIp() const {
return m_ip;
}
+bool CSession::isAdmin() const {
+ return m_isAdmin;
+}
+
void CSession::setSelf(std::pair<std::jthread, std::shared_ptr<CSession>> *self) {
this->self = self;
}