*/
void Oper(OperInfo* info);
- /** Force a nickname change.
- * If the nickname change fails (for example, because the nick in question
- * already exists) this function will return false, and you must then either
- * output an error message, or quit the user for nickname collision.
- * @param newnick The nickname to change to
- * @return True if the nickchange was successful.
- */
- bool ForceNickChange(const std::string& newnick, time_t newts = 0) { return ChangeNick(newnick, true, newts); }
-
/** Oper down.
* This will clear the +o usermode and unset the user's oper type
*/
/** Change a user's nick
* @param newnick The new nick
- * @param force True if the change is being forced (should not be blocked by modes like +N)
* @return True if the change succeeded
*/
- bool ChangeNick(const std::string& newnick, bool force = false, time_t newts = 0);
+ bool ChangeNick(const std::string& newnick, time_t newts = 0);
/** Remove this user from all channels they are on, and delete any that are now empty.
* This is used by QUIT, and will not send part messages!
}
}
- if (!user->ChangeNick(newnick, false))
+ if (!user->ChangeNick(newnick))
return CMD_FAILURE;
if (user->registered < REG_NICKUSER)
locked.set(target, 1);
std::string oldnick = target->nick;
- if (target->ForceNickChange(parameters[1]))
+ if (target->ChangeNick(parameters[1]))
ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used NICKLOCK to change and hold "+oldnick+" to "+parameters[1]);
else
{
{
std::string oldnick = user->nick;
std::string newnick = target->nick;
- if (target->ChangeNick(parameters[1], true))
+ if (target->ChangeNick(parameters[1]))
{
ServerInstance->SNO->WriteGlobalSno('a', oldnick+" used SANICK to change "+newnick+" to "+parameters[1]);
}
return CMD_FAILURE;
}
}
- user->ForceNickChange(params[0], newts);
+ user->ChangeNick(params[0], newts);
return CMD_SUCCESS;
}
params.push_back(ConvToStr(u->age));
params.Broadcast();
- u->ForceNickChange(u->uuid);
+ u->ChangeNick(u->uuid);
if (!bChangeRemote)
return 1;
if (remote)
{
/* nick change collide. Force change their nick. */
- remote->ForceNickChange(remoteuid);
+ remote->ChangeNick(remoteuid);
}
if (!bChangeLocal)
if (u->age == ts)
{
- if (!u->ForceNickChange(u->uuid))
+ if (!u->ChangeNick(u->uuid))
{
ServerInstance->Users->QuitUser(u, "Nickname collision");
}
if (NickTS <= 0)
return CMD_FAILURE;
- if (!u->ForceNickChange(nick, NickTS))
+ if (!u->ChangeNick(nick, NickTS))
{
/* buh. UID them */
- if (!u->ForceNickChange(u->uuid))
+ if (!u->ChangeNick(u->uuid))
{
ServerInstance->Users->QuitUser(u, "Nickname collision");
}
cached_fullrealhost.clear();
}
-bool User::ChangeNick(const std::string& newnick, bool force, time_t newts)
+bool User::ChangeNick(const std::string& newnick, time_t newts)
{
if (quitting)
{
void QLine::Apply(User* u)
{
/* Force to uuid on apply of qline, no need to disconnect any more :) */
- u->ForceNickChange(u->uuid);
+ u->ChangeNick(u->uuid);
}