*/
#include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
/* $ModDesc: Allows opers to set +W to see when a user uses WHOIS on them */
public:
SeeWhois(InspIRCd* Instance) : ModeHandler(Instance, 'W', 0, 0, false, MODETYPE_USER, true) { }
- ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
{
/* Only opers can change other users modes */
if (source != dest)
{
sw = new SeeWhois(ServerInstance);
- if (!ServerInstance->AddMode(sw, 'W'))
+ if (!ServerInstance->AddMode(sw))
throw ModuleException("Could not add new modes!");
+ Implementation eventlist[] = { I_OnWhois };
+ ServerInstance->Modules->Attach(eventlist, this, 1);
}
~ModuleShowwhois()
return Version(1,1,0,3,VF_COMMON|VF_VENDOR,API_VERSION);
}
- virtual void OnWhois(userrec* source, userrec* dest)
+ virtual void OnWhois(User* source, User* dest)
{
if ((dest->IsModeSet('W')) && (source != dest))
{