Move the list of sessions to a more "public" place

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1806 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-03-04 14:10:45 +00:00
parent 333dd00867
commit c9f26ba05f
2 changed files with 7 additions and 4 deletions

View File

@@ -11,6 +11,8 @@
#include "znc.h"
#include <sstream>
map<CString, CSmartPtr<CWebSession> > CWebSock::m_mspSessions;
CZNCTagHandler::CZNCTagHandler(CWebSock& WebSock) : CTemplateTagHandler(), m_WebSock(WebSock) {
}
@@ -604,16 +606,15 @@ CSmartPtr<CWebSession> CWebSock::GetSession() const {
return m_spSession;
}
static map<CString, CSmartPtr<CWebSession> > mspSessions;
map<CString, CSmartPtr<CWebSession> >::const_iterator it = mspSessions.find(GetCookie("SessionId"));
map<CString, CSmartPtr<CWebSession> >::const_iterator it = m_mspSessions.find(GetCookie("SessionId"));
if (it != mspSessions.end()) {
if (it != m_mspSessions.end()) {
DEBUG("Found existing session from cookie: [" + GetCookie("SessionId") + "] IsLoggedIn(" + CString(it->second->IsLoggedIn() ? "true" : "false") + ")");
return it->second;
}
CSmartPtr<CWebSession> spSession(new CWebSession());
mspSessions.insert(make_pair(spSession->GetId(), spSession));
m_mspSessions.insert(make_pair(spSession->GetId(), spSession));
return spSession;
}