mirror of
https://github.com/znc/znc.git
synced 2026-08-07 01:13:25 +02:00
Remove the CClient* argument to all module calls
OnUnknownUserRaw() and OnClientCapRequest() were both getting a CClient* as their first argument, but the proper way to pass a CClient* argument to a module is via GetClient(). Since recently, all the places where this module hooks are called do this properly, so we can remove this bogus argument. No module that is part of znc is affected by this change. Let's see how many external ones break. ;) git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2077 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+2
-2
@@ -67,7 +67,7 @@ void CClient::ReadLine(const CString& sData) {
|
||||
if (IsAttached()) {
|
||||
MODULECALL(OnUserRaw(sLine), m_pUser, this, return);
|
||||
} else {
|
||||
GLOBALMODULECALL(OnUnknownUserRaw(this, sLine), m_pUser, this, return);
|
||||
GLOBALMODULECALL(OnUnknownUserRaw(sLine), m_pUser, this, return);
|
||||
}
|
||||
|
||||
CString sCommand = sLine.Token(0);
|
||||
@@ -826,7 +826,7 @@ void CClient::HandleCap(const CString& sLine)
|
||||
} else if ("userhost-in-names" == *it) {
|
||||
m_bUHNames = bVal;
|
||||
} else {
|
||||
GLOBALMODULECALL(OnClientCapRequest(this, *it, bVal), m_pUser, this, );
|
||||
GLOBALMODULECALL(OnClientCapRequest(*it, bVal), m_pUser, this, );
|
||||
}
|
||||
|
||||
if (bVal) {
|
||||
|
||||
+6
-6
@@ -502,10 +502,10 @@ CModule::EModRet CGlobalModule::OnDeleteUser(CUser& User) { return CONTINUE; }
|
||||
void CGlobalModule::OnClientConnect(CZNCSock* pClient, const CString& sHost, unsigned short uPort) {}
|
||||
CModule::EModRet CGlobalModule::OnLoginAttempt(CSmartPtr<CAuthBase> Auth) { return CONTINUE; }
|
||||
void CGlobalModule::OnFailedLogin(const CString& sUsername, const CString& sRemoteIP) {}
|
||||
CModule::EModRet CGlobalModule::OnUnknownUserRaw(CClient* pClient, CString& sLine) { return CONTINUE; }
|
||||
CModule::EModRet CGlobalModule::OnUnknownUserRaw(CString& sLine) { return CONTINUE; }
|
||||
void CGlobalModule::OnClientCapLs(SCString& ssCaps) {}
|
||||
bool CGlobalModule::IsClientCapSupported(const CString& sCap, bool bState) { return false; }
|
||||
void CGlobalModule::OnClientCapRequest(CClient* pClient, const CString& sCap, bool bState) {}
|
||||
void CGlobalModule::OnClientCapRequest(const CString& sCap, bool bState) {}
|
||||
|
||||
|
||||
CModules::CModules() {
|
||||
@@ -628,8 +628,8 @@ bool CGlobalModules::OnFailedLogin(const CString& sUsername, const CString& sRem
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CGlobalModules::OnUnknownUserRaw(CClient* pClient, CString& sLine) {
|
||||
GLOBALMODHALTCHK(OnUnknownUserRaw(pClient, sLine));
|
||||
bool CGlobalModules::OnUnknownUserRaw(CString& sLine) {
|
||||
GLOBALMODHALTCHK(OnUnknownUserRaw(sLine));
|
||||
}
|
||||
|
||||
bool CGlobalModules::OnClientCapLs(SCString& ssCaps) {
|
||||
@@ -664,8 +664,8 @@ bool CGlobalModules::IsClientCapSupported(const CString& sCap, bool bState) {
|
||||
return bResult;
|
||||
}
|
||||
|
||||
bool CGlobalModules::OnClientCapRequest(CClient* pClient, const CString& sCap, bool bState) {
|
||||
GLOBALMODCALL(OnClientCapRequest(pClient, sCap, bState));
|
||||
bool CGlobalModules::OnClientCapRequest(const CString& sCap, bool bState) {
|
||||
GLOBALMODCALL(OnClientCapRequest(sCap, bState));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -953,12 +953,11 @@ public:
|
||||
/** This function behaves like CModule::OnRaw(), but is also called
|
||||
* before the client successfully logged in to ZNC. You should always
|
||||
* prefer to use CModule::OnRaw() if possible.
|
||||
* @param pClient The client.
|
||||
* @param sLine The raw traffic line which the client sent.
|
||||
* @todo Why doesn't this use m_pUser and m_pClient?
|
||||
* (Well, ok, m_pUser isn't known yet...)
|
||||
*/
|
||||
virtual EModRet OnUnknownUserRaw(CClient* pClient, CString& sLine);
|
||||
virtual EModRet OnUnknownUserRaw(CString& sLine);
|
||||
|
||||
/** Called when a client told us CAP LS. Use ssCaps.insert("cap-name")
|
||||
* for announcing capabilities which your module supports.
|
||||
@@ -972,11 +971,10 @@ public:
|
||||
*/
|
||||
virtual bool IsClientCapSupported(const CString& sCap, bool bState);
|
||||
/** Called when we actually need to turn a capability on or off for a client.
|
||||
* @param pClient client which requested this.
|
||||
* @param sCap name of wanted capability.
|
||||
* @param bState On or off, depending on which case client needs.
|
||||
*/
|
||||
virtual void OnClientCapRequest(CClient* pClient, const CString& sCap, bool bState);
|
||||
virtual void OnClientCapRequest(const CString& sCap, bool bState);
|
||||
private:
|
||||
};
|
||||
|
||||
@@ -991,10 +989,10 @@ public:
|
||||
bool OnClientConnect(CZNCSock* pSock, const CString& sHost, unsigned short uPort);
|
||||
bool OnLoginAttempt(CSmartPtr<CAuthBase> Auth);
|
||||
bool OnFailedLogin(const CString& sUsername, const CString& sRemoteIP);
|
||||
bool OnUnknownUserRaw(CClient* pClient, CString& sLine);
|
||||
bool OnUnknownUserRaw(CString& sLine);
|
||||
bool OnClientCapLs(SCString& ssCaps);
|
||||
bool IsClientCapSupported(const CString& sCap, bool bState);
|
||||
bool OnClientCapRequest(CClient* pClient, const CString& sCap, bool bState);
|
||||
bool OnClientCapRequest(const CString& sCap, bool bState);
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user