Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Pass the nick who send an invite with the OnInvite hook

  • Loading branch information...
commit e11d3380409edc3b218c7945226f9ead4cc1d8f9 1 parent 8cce595
@kylef kylef authored
Showing with 6 additions and 5 deletions.
  1. +3 −2 include/znc/Modules.h
  2. +1 −1  src/IRCSock.cpp
  3. +2 −2 src/Modules.cpp
View
5 include/znc/Modules.h
@@ -553,9 +553,10 @@ class CModule {
*/
virtual void OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage);
/** Called when user is invited into a channel
+ * @param Nick The nick who invited you.
* @param sChan The channel the user got invited into
*/
- virtual void OnInvite(const CString& sChan);
+ virtual void OnInvite(const CNick& Nick, const CString& sChan);
/** Called before a channel buffer is played back to a client.
* @param Chan The channel which will be played back.
@@ -1050,7 +1051,7 @@ class CModules : public vector<CModule*> {
bool OnKick(const CNick& Nick, const CString& sOpNick, CChan& Channel, const CString& sMessage);
bool OnJoin(const CNick& Nick, CChan& Channel);
bool OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage);
- bool OnInvite(const CString& sChan);
+ bool OnInvite(const CNick& Nick, const CString& sChan);
bool OnChanBufferStarting(CChan& Chan, CClient& Client);
bool OnChanBufferEnding(CChan& Chan, CClient& Client);
View
2  src/IRCSock.cpp
@@ -712,7 +712,7 @@ void CIRCSock::ReadLine(const CString& sData) {
// Don't forward any CAP stuff to the client
return;
} else if (sCmd.Equals("INVITE")) {
- NETWORKMODULECALL(OnInvite(sLine.Token(3).TrimPrefix_n(":")), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);
+ NETWORKMODULECALL(OnInvite(Nick, sLine.Token(3).TrimPrefix_n(":")), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);
}
}
View
4 src/Modules.cpp
@@ -513,7 +513,7 @@ void CModule::OnNick(const CNick& Nick, const CString& sNewNick, const vector<CC
void CModule::OnKick(const CNick& Nick, const CString& sKickedNick, CChan& Channel, const CString& sMessage) {}
void CModule::OnJoin(const CNick& Nick, CChan& Channel) {}
void CModule::OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage) {}
-void CModule::OnInvite(const CString& sChan) {}
+void CModule::OnInvite(const CNick& Nick, const CString& sChan) {}
CModule::EModRet CModule::OnChanBufferStarting(CChan& Chan, CClient& Client) { return CONTINUE; }
CModule::EModRet CModule::OnChanBufferEnding(CChan& Chan, CClient& Client) { return CONTINUE; }
@@ -686,7 +686,7 @@ bool CModules::OnNick(const CNick& Nick, const CString& sNewNick, const vector<C
bool CModules::OnKick(const CNick& Nick, const CString& sKickedNick, CChan& Channel, const CString& sMessage) { MODUNLOADCHK(OnKick(Nick, sKickedNick, Channel, sMessage)); return false; }
bool CModules::OnJoin(const CNick& Nick, CChan& Channel) { MODUNLOADCHK(OnJoin(Nick, Channel)); return false; }
bool CModules::OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage) { MODUNLOADCHK(OnPart(Nick, Channel, sMessage)); return false; }
-bool CModules::OnInvite(const CString& sChan) { MODUNLOADCHK(OnInvite(sChan)); return false; }
+bool CModules::OnInvite(const CNick& Nick, const CString& sChan) { MODUNLOADCHK(OnInvite(Nick, sChan)); return false; }
bool CModules::OnChanBufferStarting(CChan& Chan, CClient& Client) { MODHALTCHK(OnChanBufferStarting(Chan, Client)); }
bool CModules::OnChanBufferEnding(CChan& Chan, CClient& Client) { MODHALTCHK(OnChanBufferEnding(Chan, Client)); }
bool CModules::OnChanBufferPlayLine(CChan& Chan, CClient& Client, CString& sLine) { MODHALTCHK(OnChanBufferPlayLine(Chan, Client, sLine)); }
Please sign in to comment.
Something went wrong with that request. Please try again.