X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_botmode.cpp;h=1d3d225750d6445d4bd57c0f8e1eca977a052102;hb=fea1a27cb96a114f698eedcf90401b78406108fb;hp=7120c36c714e64041cf666c1c2ac3a0a301ddf3e;hpb=e997de794f6671ebda5a58b4452657182a742073;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index 7120c36c7..1d3d22575 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -21,6 +21,7 @@ using namespace std; #include "users.h" #include "channels.h" #include "modules.h" +#include "inspircd.h" /* $ModDesc: Provides support for unreal-style umode +B */ @@ -31,6 +32,10 @@ class BotMode : public ModeHandler ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { + /* Only opers can change other users modes */ + if ((source != dest) && (!*source->oper)) + return MODEACTION_DENY; + if (adding) { if (!dest->IsModeSet('B')) @@ -72,6 +77,7 @@ class ModuleBotMode : public Module virtual ~ModuleBotMode() { + DELETE(bm); } virtual Version GetVersion() @@ -83,7 +89,7 @@ class ModuleBotMode : public Module { if (dst->IsModeSet('B')) { - Srv->SendTo(NULL,src,"335 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is a \2bot\2 on "+Srv->GetNetworkName()); + src->WriteServ("335 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is a \2bot\2 on "+Srv->GetNetworkName()); } }