enum BlockAction { IBLOCK_KILL, IBLOCK_KILLOPERS, IBLOCK_NOTICE, IBLOCK_NOTICEOPERS, IBLOCK_SILENT };
-class BlockedMessage
+class BlockedMessage : public classbase
{
public:
std::string message;
else
action = IBLOCK_KILLOPERS;
- delete Conf;
+ DELETE(Conf);
}
virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
userchans++;
// Check that this message wasn't already sent within a few seconds.
- BlockedMessage* m = (BlockedMessage*)user->GetExt("amsgblock");
+ BlockedMessage* m;
+ user->GetExt("amsgblock", m);
// If the message is identical and within the time.
// We check the target is *not* identical, that'd straying into the realms of flood control. Which isn't what we're doing...
if(target_type == TYPE_USER)
{
userrec* user = (userrec*)item;
- BlockedMessage* m = (BlockedMessage*)user->GetExt("amsgblock");
+ BlockedMessage* m;
+ user->GetExt("amsgblock", m);
if(m)
{
- delete m;
+ DELETE(m);
user->Shrink("amsgblock");
}
}