]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/users.h
Convert LocalUserList to an intrusively linked list
[user/henk/code/inspircd.git] / include / users.h
index aaf9b5cda3b22d9de0696c51c8aff10957f6cb75..db2d538785c9378a6367642f5adf22a680ea5c27 100644 (file)
@@ -133,7 +133,7 @@ struct CoreExport ConnectClass : public refcountbase
 
        /** If set to true, no user DNS lookups are to be performed
         */
-       bool nouserdns;
+       bool resolvehostnames;
 
        /** Create a new connect class with no settings.
         */
@@ -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.
@@ -328,10 +328,6 @@ class CoreExport User : public Extensible
         */
        unsigned int registered:3;
 
-       /** Whether or not to send an snotice about this user's quitting
-        */
-       unsigned int quietquit:1;
-
        /** If this is set to true, then all socket operations for the user
         * are dropped into the bit-bucket.
         * This value is set by QuitUser, and is not needed seperately from that call.
@@ -361,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
@@ -659,7 +655,7 @@ class CoreExport UserIOHandler : public StreamSocket
 
 typedef unsigned int already_sent_t;
 
-class CoreExport LocalUser : public User, public InviteBase
+class CoreExport LocalUser : public User, public InviteBase, public intrusive_list_node<LocalUser>
 {
  public:
        LocalUser(int fd, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server);
@@ -667,10 +663,6 @@ class CoreExport LocalUser : public User, public InviteBase
 
        UserIOHandler eh;
 
-       /** Position in UserManager::local_users
-        */
-       LocalUserList::iterator localuseriter;
-
        /** Stats counter for bytes inbound
         */
        unsigned int bytes_in;
@@ -822,7 +814,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);
@@ -831,9 +823,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->GetName();
+       }
+
+       FakeUser(const std::string& uid, const std::string& sname, const std::string& sdesc)
+               : User(uid, new Server(sname, sdesc), USERTYPE_SERVER)
        {
-               nick = srv;
+               nick = sname;
        }
 
        virtual CullResult cull();