Permalink
Browse files

m_timedbans Notice halfops and above when a timed ban is placed

Fixes #415 reported by @killerrabbit
  • Loading branch information...
attilamolnar committed Mar 24, 2013
1 parent 6b2d45c commit 5513496d5f01278221d7de5e3bf6b3f25b66c0d0
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/modules/m_timedbans.cpp
@@ -99,7 +99,12 @@ class CommandTban : public Command
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;
}

0 comments on commit 5513496

Please sign in to comment.