#include "inspircd.h"
-/* $ModDesc: Provides support for unreal-style umode +B */
+/* $ModDesc: Provides user mode +B to mark the user as a bot */
/** Handles user mode +B
*/
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()
+ void init()
{
+ ServerInstance->Modules->AddService(bm);
+ Implementation eventlist[] = { I_OnWhois };
+ ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
virtual Version GetVersion()
{
- return Version("Provides support for unreal-style umode +B",VF_VENDOR);
+ return Version("Provides user mode +B to mark the user as a bot",VF_VENDOR);
}
virtual void OnWhois(User* src, User* dst)
{
if (dst->IsModeSet('B'))
{
- 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, src->nick+" "+dst->nick+" :is a bot on "+ServerInstance->Config->Network);
}
}
-
};
-
MODULE_INIT(ModuleBotMode)