]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_timedbans.cpp
Update wiki links to use HTTPS and point to the correct pages.
[user/henk/code/inspircd.git] / src / modules / m_timedbans.cpp
index 754b4c3a0b2528626a497862ad6d7e9a3bc020f9..61095d6ebae2f2ed70ce316ff21c1f1f66fc2024 100644 (file)
@@ -96,6 +96,13 @@ class CommandTban : public Command
                        user->WriteServ("NOTICE "+user->nick+" :Invalid ban mask");
                        return CMD_FAILURE;
                }
+
+               if (IsBanSet(channel, mask))
+               {
+                       user->WriteServ("NOTICE %s :Ban already set", user->nick.c_str());
+                       return CMD_FAILURE;
+               }
+
                setban.push_back(mask);
                // use CallHandler to make it so that the user sets the mode
                // themselves
@@ -112,7 +119,7 @@ class CommandTban : public Command
 
                // 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") ? '%' : '@';
+               char pfxchar = (mh && mh->name == "halfop") ? mh->GetPrefix() : '@';
 
                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;