From 11916574f67962dce1d7a2fdf7ef6a3d2d1fa49f Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sun, 5 Jan 2014 15:04:01 +0100 Subject: Introduce Server class - Replaces std::string server in User - Replaces InspIRCd::ULine() and SilentULine() --- include/users.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'include/users.h') diff --git a/include/users.h b/include/users.h index fa9d97c21..bf4ba4de2 100644 --- a/include/users.h +++ b/include/users.h @@ -306,7 +306,7 @@ class CoreExport User : public Extensible /** The server the user is connected to. */ - const std::string server; + Server* server; /** The user's away message. * If this string is empty, the user is not marked as away. @@ -357,7 +357,7 @@ class CoreExport User : public Extensible /** Constructor * @throw CoreException if the UID allocated to the user already exists */ - User(const std::string &uid, const std::string& srv, int objtype); + User(const std::string& uid, Server* srv, int objtype); /** Returns the full displayed host of the user * This member function returns the hostname of the user as seen by other users @@ -818,7 +818,7 @@ class CoreExport LocalUser : public User, public InviteBase class CoreExport RemoteUser : public User { public: - RemoteUser(const std::string& uid, const std::string& srv) : User(uid, srv, USERTYPE_REMOTE) + RemoteUser(const std::string& uid, Server* srv) : User(uid, srv, USERTYPE_REMOTE) { } virtual void SendText(const std::string& line); @@ -827,9 +827,15 @@ class CoreExport RemoteUser : public User class CoreExport FakeUser : public User { public: - FakeUser(const std::string &uid, const std::string& srv) : User(uid, srv, USERTYPE_SERVER) + FakeUser(const std::string& uid, Server* srv) : User(uid, srv, USERTYPE_SERVER) { - nick = srv; + nick = srv->GetName(); + } + + FakeUser(const std::string& uid, const std::string& sname) + : User(uid, new Server(sname), USERTYPE_SERVER) + { + nick = sname; } virtual CullResult cull(); -- cgit v1.2.3