X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fusers.h;h=c699ebab7551cc83ce17521c833c0edc3912b920;hb=e91c34ae364824d0b74c224c13d74534a65f2402;hp=73f1334d2b54cf25db3853fcf7ce8fd75802d36f;hpb=b4542af6b4c69dff7d2c28d9c435304b7d78dc38;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/users.h b/include/users.h index 73f1334d2..c699ebab7 100644 --- a/include/users.h +++ b/include/users.h @@ -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 @@ -505,10 +501,16 @@ class CoreExport User : public Extensible */ void WriteServ(const char* text, ...) CUSTOM_PRINTF(2, 3); + /** Sends a command to this user. + * @param command The command to be sent. + * @param text The message to send. + */ + void WriteCommand(const char* command, const std::string& text); + /** Sends a server notice to this user. * @param text The contents of the message to send. */ - void WriteNotice(const std::string& text); + void WriteNotice(const std::string& text) { this->WriteCommand("NOTICE", ":" + text); } void WriteNumeric(unsigned int numeric, const char* text, ...) CUSTOM_PRINTF(3, 4); @@ -635,11 +637,6 @@ class CoreExport User : public Extensible */ void PurgeEmptyChannels(); - /** Get the connect class which this user belongs to. NULL for remote users. - * @return A pointer to this user's connect class. - */ - virtual ConnectClass* GetClass(); - /** Default destructor */ virtual ~User(); @@ -664,7 +661,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 { public: LocalUser(int fd, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server); @@ -672,10 +669,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; @@ -702,7 +695,10 @@ class CoreExport LocalUser : public User, public InviteBase */ reference MyClass; - ConnectClass* GetClass(); + /** Get the connect class which this user belongs to. + * @return A pointer to this user's connect class. + */ + ConnectClass* GetClass() const { return MyClass; } /** Call this method to find the matching \ for a user, and to check them against it. */ @@ -824,7 +820,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); @@ -833,9 +829,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();