From e11d3380409edc3b218c7945226f9ead4cc1d8f9 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Thu, 20 Oct 2011 23:41:36 +0000 Subject: [PATCH] Pass the nick who send an invite with the OnInvite hook --- include/znc/Modules.h | 5 +++-- src/IRCSock.cpp | 2 +- src/Modules.cpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/znc/Modules.h b/include/znc/Modules.h index 66fd6b6b..cbae0f60 100644 --- a/include/znc/Modules.h +++ b/include/znc/Modules.h @@ -553,9 +553,10 @@ public: */ 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 @@ public: 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); diff --git a/src/IRCSock.cpp b/src/IRCSock.cpp index c7ed06dd..a856345e 100644 --- a/src/IRCSock.cpp +++ b/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); } } diff --git a/src/Modules.cpp b/src/Modules.cpp index cc545884..e71f7da5 100644 --- a/src/Modules.cpp +++ b/src/Modules.cpp @@ -513,7 +513,7 @@ void CModule::OnNick(const CNick& Nick, const CString& sNewNick, const vector