#include "inspircd.h"
-/* $ModDesc: Provides support for unreal-style umode +B */
-
/** Handles user mode +B
*/
class BotMode : public SimpleUserModeHandler
ModuleBotMode()
: bm(this)
{
- if (!ServerInstance->Modes->AddMode(&bm))
- throw ModuleException("Could not add new modes!");
- Implementation eventlist[] = { I_OnWhois };
- ServerInstance->Modules->Attach(eventlist, this, 1);
}
-
- virtual ~ModuleBotMode()
+ Version GetVersion() CXX11_OVERRIDE
{
+ return Version("Provides user mode +B to mark the user as a bot",VF_VENDOR);
}
- virtual Version GetVersion()
+ void OnWhois(User* src, User* dst) CXX11_OVERRIDE
{
- return Version("Provides support for unreal-style umode +B",VF_VENDOR);
- }
-
- virtual void OnWhois(User* src, User* dst)
- {
- if (dst->IsModeSet('B'))
+ if (dst->IsModeSet(bm))
{
- ServerInstance->SendWhoisLine(src, dst, 335, std::string(src->nick)+" "+std::string(dst->nick)+" :is a bot on "+ServerInstance->Config->Network);
+ ServerInstance->SendWhoisLine(src, dst, 335, dst->nick+" :is a bot on "+ServerInstance->Config->Network);
}
}
-
};
-
MODULE_INIT(ModuleBotMode)