From ab8305ad99d7bb7d2cfe4154b2deb007546d5b70 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 30 Jan 2010 18:40:51 +0000 Subject: Move nick change code out of cmd_nick; fixes double-invocation of hooks and may eliminate bug #911 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12330 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/users.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/users.h') diff --git a/include/users.h b/include/users.h index 51230431a..b71f32748 100644 --- a/include/users.h +++ b/include/users.h @@ -528,7 +528,7 @@ class CoreExport User : public Extensible * @param newnick The nickname to change to * @return True if the nickchange was successful. */ - bool ForceNickChange(const char* newnick); + inline bool ForceNickChange(const char* newnick) { return ChangeNick(newnick, true); } /** Oper down. * This will clear the +o usermode and unset the user's oper type @@ -670,6 +670,13 @@ class CoreExport User : public Extensible */ bool ChangeName(const char* gecos); + /** 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); + /** Send a command to all local users from this user * The command given must be able to send text with the * first parameter as a servermask (e.g. $*), so basically -- cgit v1.2.3