mirror of
https://github.com/znc/znc.git
synced 2026-08-07 01:13:25 +02:00
Call modules for /MODE done by not-in-channel nicks
When ChanServ ops someone in a channel without joining first, znc didn't call modules for this event, because it couldn't figure out a CNick* instance to use Instead, the module hooks are now executed with a temporary CNick instance which is created by CIRCSock anyway. Big thanks to Robby for reporting this and helping me test it! Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
@@ -220,12 +220,20 @@ void CChan::OnWho(const CString& sNick, const CString& sIdent, const CString& sH
|
||||
}
|
||||
}
|
||||
|
||||
void CChan::ModeChange(const CString& sModes, const CString& sOpNick) {
|
||||
void CChan::ModeChange(const CString& sModes, const CNick* pOpNick) {
|
||||
CString sModeArg = sModes.Token(0);
|
||||
CString sArgs = sModes.Token(1, true);
|
||||
bool bAdd = true;
|
||||
|
||||
CNick* pOpNick = FindNick(sOpNick);
|
||||
/* Try to find a CNick* from this channel so that pOpNick->HasPerm()
|
||||
* works as expected. */
|
||||
if (pOpNick) {
|
||||
CNick* OpNick = FindNick(pOpNick->GetNick());
|
||||
/* If nothing was found, use the original pOpNick, else use the
|
||||
* CNick* from FindNick() */
|
||||
if (OpNick)
|
||||
pOpNick = OpNick;
|
||||
}
|
||||
|
||||
if (pOpNick) {
|
||||
MODULECALL(OnRawMode(*pOpNick, *this, sModeArg, sArgs), m_pUser, NULL, NOTHING);
|
||||
|
||||
Reference in New Issue
Block a user