CClient: Use CUser's IRC Socket pointer

CUser already saves the pointer to the IRC socket, so why would CClient's have
to do the same?


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1725 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-01-28 19:44:37 +00:00
parent b50d944bb9
commit f99e5190cd
4 changed files with 11 additions and 27 deletions

View File

@@ -568,6 +568,14 @@ void CClient::SetNick(const CString& s) {
m_sNick = s;
}
const CIRCSock* CClient::GetIRCSock() const {
return m_pUser->GetIRCSock();
}
CIRCSock* CClient::GetIRCSock() {
return m_pUser->GetIRCSock();
}
void CClient::StatusCTCP(const CString& sLine) {
CString sCommand = sLine.Token(0);
@@ -689,7 +697,6 @@ void CClient::AcceptLogin(CUser& User) {
SetSockName("USR::" + m_pUser->GetUserName());
m_pIRCSock = (CIRCSock*) CZNC::Get().FindSockByName("IRC::" + m_pUser->GetUserName());
m_pUser->UserConnected(this);
SendMotd();
@@ -715,8 +722,6 @@ void CClient::Disconnected() {
m_pUser->UserDisconnected(this);
}
m_pIRCSock = NULL;
MODULECALL(OnClientDisconnect(), m_pUser, this, );
}
@@ -728,20 +733,11 @@ void CClient::ReachedMaxBuffer() {
Close();
}
void CClient::IRCConnected(CIRCSock* pIRCSock) {
m_pIRCSock = pIRCSock;
}
void CClient::BouncedOff() {
PutStatusNotice("You are being disconnected because another user just authenticated as you.");
m_pIRCSock = NULL;
Close(Csock::CLT_AFTERWRITE);
}
void CClient::IRCDisconnected() {
m_pIRCSock = NULL;
}
void CClient::PutIRC(const CString& sLine) {
if (GetIRCSock()) {
GetIRCSock()->PutIRC(sLine);