+ if (parameters[0].c_str()[0] != '#')
+ {
+ User* target = ServerInstance->FindNickOnly(parameters[0]);
+ if ((!target) || (target->registered != REG_ALL))
+ {
+ user->WriteNumeric(Numerics::NoSuchNick(parameters[0]));
+ return CMD_FAILURE;
+ }
+
+ // Changing the modes of another user requires a special permission
+ if ((target != user) && (!user->HasPrivPermission("users/samode-usermodes")))
+ {
+ user->WriteNotice("*** You are not allowed to /SAMODE other users (the privilege users/samode-usermodes is needed to /SAMODE others).");
+ return CMD_FAILURE;
+ }
+ }
+
+ // XXX: Make ModeParser clear LastParse
+ Modes::ChangeList emptychangelist;
+ ServerInstance->Modes->ProcessSingle(ServerInstance->FakeClient, NULL, ServerInstance->FakeClient, emptychangelist);
+
+ logged = false;