mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fixed lookup of USR:: socket
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@136 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
10
User.cpp
10
User.cpp
@@ -190,6 +190,16 @@ CZNC* CUser::GetZNC() {
|
||||
|
||||
CUserSock* CUser::GetUserSock() {
|
||||
// Todo: optimize this by saving a pointer to the sock
|
||||
TSocketManager<Csock>& Manager = m_pZNC->GetManager();
|
||||
|
||||
for (unsigned int a = 0; a < Manager.size(); a++) {
|
||||
Csock* pSock = Manager[a];
|
||||
if (strncasecmp(pSock->GetSockName().c_str(), "USR::", 5) == 0) {
|
||||
if (!pSock->isClosed()) {
|
||||
return (CUserSock*) pSock;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (CUserSock*) m_pZNC->GetManager().FindSockByName("USR::" + m_sUserName);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user