diff options
Diffstat (limited to 'src/session.cpp')
| -rw-r--r-- | src/session.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/session.cpp b/src/session.cpp index 116c9bc..aa6147c 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -10,6 +10,7 @@ #include <cerrno> #include <cstring> #include <memory> +#include <optional> #include <sys/socket.h> CSession::CSession() { @@ -90,7 +91,7 @@ void CSession::recvLoop() { if (isCommand) g_pCommandHandler->handleCommand(recvData->data, this); - g_pChatManager->newMessage({.msg = recvData->data, .username = m_name, .sender = (uintptr_t)this, .admin = isCommand}); + g_pChatManager->newMessage({.msg = recvData->data, .username = m_name, .sender = self->second, .admin = isCommand}); } } @@ -246,7 +247,7 @@ bool CSession::write(const std::string &msg) { } bool CSession::writeChat(const CChatManager::SMessage &msg) { - if (msg.sender ? (uintptr_t)this != *msg.sender : msg.username != m_name) { + if (msg.sender ? this != msg.sender->get() : msg.username != m_name) { if (msg.admin && !m_isAdmin) return false; |
