mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Some more fun with tabs
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1966 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
74
Client.cpp
74
Client.cpp
@@ -14,36 +14,36 @@
|
||||
#include "znc.h"
|
||||
#include "WebModules.h"
|
||||
|
||||
#define CALLMOD(MOD, CLIENT, USER, FUNC) { \
|
||||
CModule* pModule = CZNC::Get().GetModules().FindModule(MOD); \
|
||||
if (pModule) { \
|
||||
try { \
|
||||
pModule->SetClient(CLIENT); \
|
||||
pModule->SetUser(USER); \
|
||||
pModule->FUNC; \
|
||||
pModule->SetClient(NULL); \
|
||||
pModule->SetUser(NULL); \
|
||||
} catch (CModule::EModException e) { \
|
||||
if (e == CModule::UNLOAD) { \
|
||||
CZNC::Get().GetModules().UnloadModule(MOD); \
|
||||
} \
|
||||
} \
|
||||
} else { \
|
||||
pModule = (USER)->GetModules().FindModule(MOD); \
|
||||
if (pModule) { \
|
||||
try { \
|
||||
pModule->SetClient(CLIENT); \
|
||||
pModule->FUNC; \
|
||||
pModule->SetClient(NULL); \
|
||||
} catch (CModule::EModException e) { \
|
||||
if (e == CModule::UNLOAD) { \
|
||||
(USER)->GetModules().UnloadModule(MOD); \
|
||||
} \
|
||||
} \
|
||||
} else { \
|
||||
PutStatus("No such module [" + MOD + "]"); \
|
||||
} \
|
||||
} \
|
||||
#define CALLMOD(MOD, CLIENT, USER, FUNC) { \
|
||||
CModule* pModule = CZNC::Get().GetModules().FindModule(MOD); \
|
||||
if (pModule) { \
|
||||
try { \
|
||||
pModule->SetClient(CLIENT); \
|
||||
pModule->SetUser(USER); \
|
||||
pModule->FUNC; \
|
||||
pModule->SetClient(NULL); \
|
||||
pModule->SetUser(NULL); \
|
||||
} catch (CModule::EModException e) { \
|
||||
if (e == CModule::UNLOAD) { \
|
||||
CZNC::Get().GetModules().UnloadModule(MOD); \
|
||||
} \
|
||||
} \
|
||||
} else { \
|
||||
pModule = (USER)->GetModules().FindModule(MOD); \
|
||||
if (pModule) { \
|
||||
try { \
|
||||
pModule->SetClient(CLIENT); \
|
||||
pModule->FUNC; \
|
||||
pModule->SetClient(NULL); \
|
||||
} catch (CModule::EModException e) { \
|
||||
if (e == CModule::UNLOAD) { \
|
||||
(USER)->GetModules().UnloadModule(MOD); \
|
||||
} \
|
||||
} \
|
||||
} else { \
|
||||
PutStatus("No such module [" + MOD + "]"); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
CClient::~CClient() {
|
||||
@@ -96,7 +96,7 @@ void CClient::ReadLine(const CString& sData) {
|
||||
AuthUser();
|
||||
}
|
||||
|
||||
return; // Don't forward this msg. ZNC has already registered us.
|
||||
return; // Don't forward this msg. ZNC has already registered us.
|
||||
}
|
||||
} else if (sCommand.Equals("NICK")) {
|
||||
CString sNick = sLine.Token(1);
|
||||
@@ -111,7 +111,7 @@ void CClient::ReadLine(const CString& sData) {
|
||||
if ((m_bGotPass) && (m_bGotUser)) {
|
||||
AuthUser();
|
||||
}
|
||||
return; // Don't forward this msg. ZNC will handle nick changes until auth is complete
|
||||
return; // Don't forward this msg. ZNC will handle nick changes until auth is complete
|
||||
}
|
||||
} else if (sCommand.Equals("USER")) {
|
||||
if (!IsAttached()) {
|
||||
@@ -129,7 +129,7 @@ void CClient::ReadLine(const CString& sData) {
|
||||
"Try /quote PASS <username>:<password>");
|
||||
}
|
||||
|
||||
return; // Don't forward this msg. ZNC has already registered us.
|
||||
return; // Don't forward this msg. ZNC has already registered us.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ void CClient::ReadLine(const CString& sData) {
|
||||
return;
|
||||
}
|
||||
} else if (sCommand.Equals("PONG")) {
|
||||
return; // Block pong replies, we already responded to the pings
|
||||
return; // Block pong replies, we already responded to the pings
|
||||
} else if (sCommand.Equals("JOIN")) {
|
||||
CString sChans = sLine.Token(1);
|
||||
CString sKey = sLine.Token(2);
|
||||
@@ -287,8 +287,8 @@ void CClient::ReadLine(const CString& sData) {
|
||||
} else if (sCommand.Equals("QUIT")) {
|
||||
m_pUser->UserDisconnected(this);
|
||||
|
||||
Close(Csock::CLT_AFTERWRITE); // Treat a client quit as a detach
|
||||
return; // Don't forward this msg. We don't want the client getting us disconnected.
|
||||
Close(Csock::CLT_AFTERWRITE); // Treat a client quit as a detach
|
||||
return; // Don't forward this msg. We don't want the client getting us disconnected.
|
||||
} else if (sCommand.Equals("PROTOCTL")) {
|
||||
VCString vsTokens;
|
||||
VCString::const_iterator it;
|
||||
@@ -301,7 +301,7 @@ void CClient::ReadLine(const CString& sData) {
|
||||
m_bUHNames = true;
|
||||
}
|
||||
}
|
||||
return; // If the server understands it, we already enabled namesx / uhnames
|
||||
return; // If the server understands it, we already enabled namesx / uhnames
|
||||
} else if (sCommand.Equals("NOTICE")) {
|
||||
CString sTarget = sLine.Token(1);
|
||||
CString sMsg = sLine.Token(2, true);
|
||||
|
||||
Reference in New Issue
Block a user