]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_timedbans.cpp
Do not send too much data over SSL in one go
[user/henk/code/inspircd.git] / src / modules / m_timedbans.cpp
index a622fd4e2726dd60256797d0b72615532666c2b6..497ac2569d94ad80528656a1c4a1de345ab339d4 100644 (file)
@@ -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;
        }