- ServerInstance->Log(DEBUG,"SAMODE: Modechange handled");
- result = std::string(user->nick);
- result.append(" used SAMODE");
- for (int n = 0; n < pcnt; n++)
+
+ if (ServerInstance->Modes->GetLastParse().length())
+ {
+ ServerInstance->WriteOpers("*** " + std::string(user->nick) + " used SAMODE: " + ServerInstance->Modes->GetLastParse());
+
+ std::deque<std::string> n;
+ irc::spacesepstream spaced(ServerInstance->Modes->GetLastParse());
+ std::string one = "*";
+ while ((one = spaced.GetToken()) != "")
+ 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);
+
+ /* XXX: Yes, this is right. We dont want to propogate the
+ * actual SAMODE command, just the MODE command generated
+ * by the send_mode
+ */
+ return CMD_LOCALONLY;
+ }
+ else