summaryrefslogtreecommitdiff
path: root/modules/commands/os_svsnick.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-11-22 00:50:33 -0500
committerAdam <Adam@anope.org>2012-11-22 00:50:33 -0500
commitd33a0f75a5c0c584fbb7cc0076da36d494f39494 (patch)
tree7b2274cc833c793c0f5595660cbd4d715de52ffd /modules/commands/os_svsnick.cpp
parent368d469631763e9c8bf399980d0ac7c5b5664d39 (diff)
Pretty large coding style cleanup, in source doc
cleanup, and allow protocol mods to depend on each other
Diffstat (limited to 'modules/commands/os_svsnick.cpp')
-rw-r--r--modules/commands/os_svsnick.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/modules/commands/os_svsnick.cpp b/modules/commands/os_svsnick.cpp
index 4c6329acb..e08d5d3aa 100644
--- a/modules/commands/os_svsnick.cpp
+++ b/modules/commands/os_svsnick.cpp
@@ -36,28 +36,22 @@ class CommandOSSVSNick : public Command
}
/* Check for valid characters */
- if (newnick[0] == '-' || isdigit(newnick[0]))
+ if (!IRCD->IsNickValid(newnick))
{
source.Reply(_("Nick \002%s\002 is an illegal nickname and cannot be used."), newnick.c_str());
return;
}
- for (unsigned i = 0, end = newnick.length(); i < end; ++i)
- if (!isvalidnick(newnick[i]))
- {
- source.Reply(_("Nick \002%s\002 is an illegal nickname and cannot be used."), newnick.c_str());
- return;
- }
/* Check for a nick in use or a forbidden/suspended nick */
- if (!(u2 = finduser(nick)))
+ if (!(u2 = User::Find(nick, true)))
source.Reply(NICK_X_NOT_IN_USE, nick.c_str());
- else if (!nick.equals_ci(newnick) && finduser(newnick))
+ else if (!nick.equals_ci(newnick) && User::Find(newnick))
source.Reply(_("Nick \002%s\002 is currently in use."), newnick.c_str());
else
{
source.Reply(_("The nick \002%s\002 is now being changed to \002%s\002."), nick.c_str(), newnick.c_str());
Log(LOG_ADMIN, source, this) << "to change " << nick << " to " << newnick;
- ircdproto->SendForceNickChange(u2, newnick, Anope::CurTime);
+ IRCD->SendForceNickChange(u2, newnick, Anope::CurTime);
}
return;
}
@@ -81,7 +75,7 @@ class OSSVSNick : public Module
{
this->SetAuthor("Anope");
- if (!ircdproto || !ircdproto->CanSVSNick)
+ if (!IRCD || !IRCD->CanSVSNick)
throw ModuleException("Your IRCd does not support SVSNICK");
}