diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-03-24 19:11:36 +0100 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-03-24 19:11:36 +0100 |
commit | 5513496d5f01278221d7de5e3bf6b3f25b66c0d0 (patch) | |
tree | 659909576e57748ebdd3367eb7a027ffc3883b7a /src/modules/m_timedbans.cpp | |
parent | 6b2d45c154ddbd5ea4381156f5b763c8d0c29e07 (diff) |
m_timedbans Notice halfops and above when a timed ban is placed
Fixes #415 reported by @killerrabbit
Diffstat (limited to 'src/modules/m_timedbans.cpp')
-rw-r--r-- | src/modules/m_timedbans.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index a622fd4e2..497ac2569 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -99,7 +99,12 @@ found: T.mask = mask; T.expire = expire + (IS_REMOTE(user) ? 5 : 0); TimedBanList.push_back(T); - channel->WriteAllExcept(ServerInstance->FakeClient, true, '@', tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name.c_str(), user->nick.c_str(), mask.c_str(), duration); + + // If halfop is loaded, send notice to halfops and above, otherwise send to ops and above + ModeHandler* mh = ServerInstance->Modes->FindMode('h', MODETYPE_CHANNEL); + char pfxchar = (mh && mh->name == "halfop") ? '%' : '@'; + + channel->WriteAllExcept(ServerInstance->FakeClient, true, pfxchar, tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name.c_str(), user->nick.c_str(), mask.c_str(), duration); return CMD_SUCCESS; } |