From 5513496d5f01278221d7de5e3bf6b3f25b66c0d0 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sun, 24 Mar 2013 19:11:36 +0100 Subject: m_timedbans Notice halfops and above when a timed ban is placed Fixes #415 reported by @killerrabbit --- src/modules/m_timedbans.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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; } -- cgit v1.2.3