X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_samode.cpp;h=3dcd48ca5e872260f075a944240b65fab8a60887;hb=8c2d96013084de950e3a63be4ae6ed626c4093ab;hp=fb379310f3dc1bdee95aa62d0e5cf2fd0b699743;hpb=94afde43b086f092bf8128d76d418cb63840e8eb;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index fb379310f..3dcd48ca5 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -20,13 +20,13 @@ class CommandSamode : public Command { public: - CommandSamode (InspIRCd* Instance) : Command(Instance,"SAMODE", 'o', 2, false, 0) + CommandSamode (InspIRCd* Instance) : Command(Instance,"SAMODE", "o", 2, false, 0) { this->source = "m_samode.so"; syntax = " {}"; } - CmdResult Handle (const char** parameters, int pcnt, User *user) + CmdResult Handle (const char* const* parameters, int pcnt, User *user) { /* * Handles an SAMODE request. Notifies all +s users. @@ -35,25 +35,21 @@ class CommandSamode : public Command if (ServerInstance->Modes->GetLastParse().length()) { - ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick) + " used SAMODE: " + ServerInstance->Modes->GetLastParse()); + ServerInstance->SNO->WriteToSnoMask('A', std::string(user->nick) + " used SAMODE: " + ServerInstance->Modes->GetLastParse()); std::deque n; irc::spacesepstream spaced(ServerInstance->Modes->GetLastParse()); - std::string one = "*"; + std::string one; while (spaced.GetToken(one)) n.push_back(one); - Event rmode((char *)&n, NULL, "send_mode"); - rmode.Send(ServerInstance); - - n.clear(); - n.push_back(std::string(user->nick) + " used SAMODE: " + ServerInstance->Modes->GetLastParse()); - Event rmode2((char *)&n, NULL, "send_opers"); - rmode2.Send(ServerInstance); + std::string channel = n[0]; + n.pop_front(); + ServerInstance->PI->SendMode(channel, n); /* XXX: Yes, this is right. We dont want to propagate the * actual SAMODE command, just the MODE command generated - * by the send_mode + * by the Protocol Interface */ return CMD_LOCALONLY; } @@ -85,7 +81,7 @@ class ModuleSaMode : public Module virtual Version GetVersion() { - return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); + return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); } };