X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodules%2Fm_callerid.cpp;h=2a349fdb0f8adc2d926e0e86fd3fef432dbb5c9b;hb=f9ef4ebc9dc4fd46cdafcc76df644b4896251dac;hp=f38c22d79bcb30e64a72af88a18a9575bdcc641d;hpb=68730d4c9701b34c962302e6410908865fb2ba28;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index f38c22d79..2a349fdb0 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -7,7 +7,7 @@ /* $ModDesc: Implementation of callerid (umode +g & /accept, ala hybrid etc) */ -class callerid_data +class callerid_data : public classbase { public: time_t lastnotify; @@ -59,22 +59,12 @@ void RemoveFromAllAccepts(InspIRCd* ServerInstance, User* who) } } -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 @@ -93,9 +83,10 @@ public: * /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 ¶meters, User* user) { - if (pcnt < 1) + if (parameters.size() < 1) { /* Command stuff should've dealt with this already */ return CMD_FAILURE; @@ -103,9 +94,9 @@ public: /* 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))