]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/users.h
Move more stuff into userrec
[user/henk/code/inspircd.git] / include / users.h
index a660623831dba56892c7670f6ef98000858852e8..1d8e918aa2b88dd11915a2951b900cad0dc44574 100644 (file)
@@ -66,6 +66,8 @@ class Invited : public classbase
 
 
 
+class InspIRCd;
+
 /** Derived from Resolver, and performs user forward/reverse lookups.
  */
 class UserResolver : public Resolver
@@ -77,7 +79,7 @@ class UserResolver : public Resolver
        int bound_fd;
        bool fwd;
  public:
-       UserResolver(userrec* user, std::string to_resolve, bool forward);
+       UserResolver(InspIRCd* Instance, userrec* user, std::string to_resolve, bool forward);
 
        void OnLookupComplete(const std::string &result);
        void OnError(ResolverError e, const std::string &errormessage);
@@ -156,6 +158,9 @@ typedef std::vector<ucrec*> UserChanList;
 class userrec : public connection
 {
  private:
+       /** Pointer to creator
+        */
+       InspIRCd* ServerInstance;
 
        /** A list of channels the user has a pending invite to.
         */
@@ -324,7 +329,7 @@ class userrec : public connection
        /** Default constructor
         * @throw Nothing at present
         */
-       userrec();
+       userrec(InspIRCd* Instance);
        
        /** Returns the full displayed host of the user
         * This member function returns the hostname of the user as seen by other users
@@ -500,7 +505,7 @@ class userrec : public connection
         * @param user The user to remove
         * @param r The quit reason
         */
-       static void QuitUser(userrec *user, const std::string &r);
+       static void QuitUser(InspIRCd* Instance, userrec *user, const std::string &r);
 
        /** Add the user to WHOWAS system
         */
@@ -542,7 +547,7 @@ class userrec : public connection
         * This will create a new userrec, insert it into the user_hash,
         * initialize it as not yet registered, and add it to the socket engine.
         */
-       static void AddClient(int socket, int port, bool iscached, insp_inaddr ip);
+       static void AddClient(InspIRCd* Instance, int socket, int port, bool iscached, insp_inaddr ip);
 
        /** Oper down.
         * This will clear the +o usermode and unset the user's oper type
@@ -614,19 +619,37 @@ class userrec : public connection
         * @param text The format string for text to send to the users
         * @param ... POD-type format arguments
         */
-       void WriteCommon(char* text, ...);
+       void WriteCommon(const char* text, ...);
 
        /** Write to all users that can see this user (not including this user in the list), appending CR/LF
         * @param text The format string for text to send to the users
         * @param ... POD-type format arguments
         */
-       void WriteCommonExcept(char* text, ...);
+       void WriteCommonExcept(const char* text, ...);
 
        /** Write to all users that can see this user (not including this user in the list), appending CR/LF
         * @param text A std::string to send to the users
         */
        void WriteCommonExcept(const std::string &text);
 
+       void WriteWallOps(const char* text, ...);
+
+       void WriteWallOps(const std::string &text);
+
+       bool SharesChannelWith(userrec *other);
+
+       bool ChangeDisplayedHost(const char* host);
+
+       bool ChangeName(const char* gecos);
+
+       int CountChannels();
+
+       void NoticeAll(char* text, ...);
+
+       std::string ChannelList(userrec* source);
+
+       void SplitChanList(userrec* dest, const std::string &cl);
+
        /** Default destructor
         */
        virtual ~userrec();
@@ -687,10 +710,11 @@ namespace irc
 };
 
 /* Configuration callbacks */
-bool InitTypes(const char* tag);
-bool InitClasses(const char* tag);
-bool DoType(const char* tag, char** entries, void** values, int* types);
-bool DoClass(const char* tag, char** entries, void** values, int* types);
-bool DoneClassesAndTypes(const char* tag);
+class ServerConfig;
+bool InitTypes(ServerConfig* conf, const char* tag);
+bool InitClasses(ServerConfig* conf, const char* tag);
+bool DoType(ServerConfig* conf, const char* tag, char** entries, void** values, int* types);
+bool DoClass(ServerConfig* conf, const char* tag, char** entries, void** values, int* types);
+bool DoneClassesAndTypes(ServerConfig* conf, const char* tag);
 
 #endif