/* $ModDesc: Implementation of callerid (umode +g & /accept, ala hybrid etc) */
-class callerid_data
+class callerid_data : public classbase
{
public:
time_t lastnotify;
}
}
-class User_g : public ModeHandler
+class User_g : public SimpleUserModeHandler
{
private:
public:
- User_g(InspIRCd* Instance) : ModeHandler(Instance, 'g', 0, 0, false, MODETYPE_USER, false) { }
-
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool)
- {
- if (adding != dest->IsModeSet('g'))
- {
- dest->SetMode('g', adding);
- return MODEACTION_ALLOW;
- }
- return MODEACTION_DENY;
- }
+ User_g(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'g') { }
};
class CommandAccept : public Command
* /accept nick1,nick2,nick3 *
* to add 3 nicks and then show your list
*/
- CmdResult Handle(const char* const* parameters, int pcnt, User* user)
+
+ CmdResult Handle(const std::vector<std::string> ¶meters, User* user)
{
- if (pcnt < 1)
+ if (parameters.size() < 1)
{
/* Command stuff should've dealt with this already */
return CMD_FAILURE;
/* Even if callerid mode is not set, we let them manage their ACCEPT list so that if they go +g they can
* have a list already setup. */
bool atleastonechange = false;
- for (int i = 0; i < pcnt; ++i)
+ for (int i = 0; i < (int)parameters.size(); ++i)
{
- const char* arg = parameters[i];
+ const char* arg = parameters[i].c_str();
irc::commasepstream css(arg);
std::string tok;
while (css.GetToken(tok))