Rename new callback, fix build

This commit is contained in:
Alexey Sokolov
2025-02-13 21:22:09 +00:00
parent 22f27b2e88
commit c8266aafda
7 changed files with 12 additions and 12 deletions

View File

@@ -1364,10 +1364,10 @@ class CModule {
virtual void OnClientCapRequest(CClient* pClient, const CString& sCap,
bool bState);
/** Called when a client requests SASL authentication. Use ssMechanisms.insert("mechanism")
* for announcing sASL mechanisms which your module supports.
* for announcing SASL mechanisms which your module supports.
* @param ssMechanisms The set of supported SASL mechanisms to append to.
*/
virtual void OnGetSASLMechanisms(SCString& ssMechanisms);
virtual void OnClientGetSASLMechanisms(SCString& ssMechanisms);
/** Called when a client has selected a SASL mechanism for SASL authentication.
* If implementing a SASL authentication mechanism, set sResponse to specify an initial challenge
* message to send to the client. Otherwise, an empty response will be sent.
@@ -1694,7 +1694,7 @@ class CModules : public std::vector<CModule*>, private CCoreTranslationMixin {
bool IsClientCapSupported(CClient* pClient, const CString& sCap,
bool bState);
bool OnClientCapRequest(CClient* pClient, const CString& sCap, bool bState);
bool OnGetSASLMechanisms(SCString& ssMechanisms);
bool OnClientGetSASLMechanisms(SCString& ssMechanisms);
bool OnSASLServerChallenge(const CString& sMechanism,
CString& sResponse);
bool OnClientSASLAuthenticate(const CString& sMechanism,

View File

@@ -112,7 +112,7 @@ EModRet OnUnknownUserRaw(CClient* pClient, CString& sLine)
EModRet OnUnknownUserRawMessage(CMessage& Message)
bool IsClientCapSupported(CClient* pClient, const CString& sCap, bool bState)
void OnClientCapRequest(CClient* pClient, const CString& sCap, bool bState)
void OnGetSASLMechanisms(SCString& ssMechanisms)
void OnClientGetSASLMechanisms(SCString& ssMechanisms)
EModRet OnSASLServerChallenge(const CString& sMechanism, CString& sResponse)
EModRet OnClientSASLAuthenticate(const CString& sMechanism, const CString& sBuffer, CString& sUser, CString& sMechanismResponse, bool& bAuthenticationSuccess)
EModRet OnModuleLoading(const CString& sModName, const CString& sArgs, CModInfo::EModuleType eType, bool& bSuccess, CString& sRetMsg)

View File

@@ -194,7 +194,7 @@ class ZNC_EXPORT_LIB_EXPORT CPyModule : public CModule {
bool bState) override;
void OnClientCapRequest(CClient* pClient, const CString& sCap,
bool bState) override;
void OnGetSASLMechanisms(SCString& ssMechanisms) override;
void OnClientGetSASLMechanisms(SCString& ssMechanisms) override;
EModRet OnSASLServerChallenge(const CString& sMechanism,
CString& sResponse) override;
EModRet OnClientSASLAuthenticate(const CString& sMechanism,

View File

@@ -478,7 +478,7 @@ class Module:
def OnClientCapRequest(self, pClient, sCap, bState):
pass
def OnGetSASLMechanisms(self, ssMechanisms):
def OnClientGetSASLMechanisms(self, ssMechanisms):
pass
def OnSASLServerChallenge(self, sMechanism, sResponse):

View File

@@ -41,12 +41,12 @@ class CSASLMechanismPlain : public CModule {
return HALTMODS;
}
auto spAuth = std::make_shared<CClientAuth>(this, sAuthcId, sPassword);
auto spAuth = std::make_shared<CClientAuth>(GetClient(), sAuthcId, sPassword);
CZNC::Get().AuthUser(spAuth);
return HALTMODS;
}
void OnGetSASLMechanisms(SCString& ssMechanisms) override {
void OnClientGetSASLMechanisms(SCString& ssMechanisms) override {
ssMechanisms.insert("PLAIN");
}
};

View File

@@ -1210,7 +1210,7 @@ void CClient::OnAuthenticateMessage(CAuthenticateMessage& Message) {
CString CClient::EnumerateSASLMechanisms(SCString& ssMechanisms) {
CString sMechanisms;
GLOBALMODULECALL(OnGetSASLMechanisms(ssMechanisms), NOTHING);
GLOBALMODULECALL(OnClientGetSASLMechanisms(ssMechanisms), NOTHING);
if (ssMechanisms.size()) {
sMechanisms =

View File

@@ -1213,7 +1213,7 @@ CModule::EModRet CModule::OnSASLServerChallenge(const CString& sMechanism,
return CONTINUE;
}
void CModule::OnGetSASLMechanisms(SCString& ssMechanisms) {}
void CModule::OnClientGetSASLMechanisms(SCString& ssMechanisms) {}
CModule::EModRet CModule::OnModuleLoading(const CString& sModName,
const CString& sArgs,
@@ -1774,8 +1774,8 @@ bool CModules::OnSASLServerChallenge(const CString& sMechanism,
MODHALTCHK(OnSASLServerChallenge(sMechanism, sResponse));
}
bool CModules::OnGetSASLMechanisms(SCString& ssMechanisms) {
MODUNLOADCHK(OnGetSASLMechanisms(ssMechanisms));
bool CModules::OnClientGetSASLMechanisms(SCString& ssMechanisms) {
MODUNLOADCHK(OnClientGetSASLMechanisms(ssMechanisms));
return false;
}