X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fusers.h;h=dc7da40fe2a7e2adb817fcba8894f4b185ffa3d7;hb=2cd6efcc64458c7b5c33529eb58fe00b7bc5e4ef;hp=4aed944eee63267b7f4812760484560aef4ca713;hpb=98a80a730e21c6711d8ac14b16aaf6aad50da6c7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/users.h b/include/users.h index 4aed944ee..dc7da40fe 100644 --- a/include/users.h +++ b/include/users.h @@ -380,9 +380,9 @@ class CoreExport User : public Extensible /** Sets the client IP for this user * @return true if the conversion was successful */ - virtual bool SetClientIP(const std::string& address, bool recheck_eline = true); + virtual bool SetClientIP(const std::string& address); - virtual void SetClientIP(const irc::sockets::sockaddrs& sa, bool recheck_eline = true); + virtual void SetClientIP(const irc::sockets::sockaddrs& sa); /** Constructor * @throw CoreException if the UID allocated to the user already exists @@ -456,17 +456,16 @@ class CoreExport User : public Extensible * @param command A command (should be all CAPS) * @return True if this user can execute the command */ - virtual bool HasPermission(const std::string &command); + virtual bool HasCommandPermission(const std::string& command); /** Returns true if a user has a given permission. * This is used to check whether or not users may perform certain actions which admins may not wish to give to * all operators, yet are not commands. An example might be oper override, mass messaging (/notice $*), etc. * * @param privstr The priv to chec, e.g. "users/override/topic". These are loaded free-form from the config file. - * @param noisy If set to true, the user is notified that they do not have the specified permission where applicable. If false, no notification is sent. * @return True if this user has the permission in question. */ - virtual bool HasPrivPermission(const std::string &privstr, bool noisy = false); + virtual bool HasPrivPermission(const std::string& privstr); /** Returns true or false if a user can set a privileged user or channel mode. * This is done by looking up their oper type from User::oper, then referencing @@ -681,11 +680,18 @@ class CoreExport User : public Extensible class CoreExport UserIOHandler : public StreamSocket { + private: + size_t checked_until; public: LocalUser* const user; - UserIOHandler(LocalUser* me) : user(me) {} + UserIOHandler(LocalUser* me) + : StreamSocket(StreamSocket::SS_USER) + , checked_until(0) + , user(me) + { + } void OnDataReady() CXX11_OVERRIDE; - void OnSetEndPoint(const irc::sockets::sockaddrs& local, const irc::sockets::sockaddrs& remote) CXX11_OVERRIDE; + bool OnSetEndPoint(const irc::sockets::sockaddrs& local, const irc::sockets::sockaddrs& remote) CXX11_OVERRIDE; void OnError(BufferedSocketError error) CXX11_OVERRIDE; /** Adds to the user's write buffer. @@ -765,11 +771,6 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_nodeGetId()] = value; + if (mh && mh->GetId() != ModeParser::MODEID_MAX) + modes[mh->GetId()] = value; }