+
+ // XXX: Make ModeParser clear LastParse
+ Modes::ChangeList emptychangelist;
+ ServerInstance->Modes->ProcessSingle(ServerInstance->FakeClient, NULL, ServerInstance->FakeClient, emptychangelist);
+
+ logged = false;
+ this->active = true;
+ ServerInstance->Parser.CallHandler("MODE", parameters, user);
+ this->active = false;
+
+ if (!logged)
+ {
+ // If we haven't logged anything yet then the client queried the list of a listmode
+ // (e.g. /SAMODE #chan b), which was handled internally by the MODE command handler.
+ //
+ // Viewing the modes of a user or a channel could also result in this, but
+ // that is not possible with /SAMODE because we require at least 2 parameters.
+ LogUsage(user, stdalgo::string::join(parameters));
+ }
+
+ return CMD_SUCCESS;
+ }
+
+ void LogUsage(const User* user, const std::string& text)
+ {
+ logged = true;
+ ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SAMODE: " + text);