mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
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:
20
Client.cpp
20
Client.cpp
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user