+class InspIRCd;
+
/** Derived from Resolver, and performs user forward/reverse lookups.
*/
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);
class userrec : public connection
{
private:
+ /** Pointer to creator
+ */
+ InspIRCd* ServerInstance;
/** A list of channels the user has a pending invite to.
*/
/** 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
* @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
*/
* 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
* @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();
};
/* 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