X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fusers.h;h=e7ad4b9d939a8ac6204b7cd31c40bf3071b92b4c;hb=c330b24501fc56516fef098428889a0a526e706a;hp=631704f99e2a3a8f0f28af228d999956390b77b9;hpb=4927edc5fb5be69ff745044f087b8e3f1fc539d8;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/users.h b/include/users.h index 631704f99..e7ad4b9d9 100644 --- a/include/users.h +++ b/include/users.h @@ -37,7 +37,7 @@ #define CC_ALLOW 0 #define CC_DENY 1 -template inline string ConvToStr(const T &in); +template string ConvToStr(const T &in); /** Holds a channel name to which a user has been invited. */ @@ -150,8 +150,15 @@ class userrec : public connection * an optional + character. */ char modes[54]; + + /** This contains a bitmask of the RFC modes +swi, + * which can be used for fast lookup when iterating all the users. + * It is maintained by the mode parser and matches the character + * modes stored in 'modes'. + */ + char modebits; - std::vector chans; + std::vector chans; /** The server the user is connected to. */ @@ -340,25 +347,32 @@ class userrec : public connection #endif }; -/** A lightweight userrec used by WHOWAS - */ -class WhoWasUser +class WhoWasGroup { public: - char nick[NICKMAX]; - char ident[IDENTMAX+1]; - char dhost[64]; - char host[64]; - char fullname[MAXGECOS+1]; - char server[256]; + char* host; + char* dhost; + char* ident; + char* server; + char* gecos; time_t signon; + + WhoWasGroup(userrec* user); + ~WhoWasGroup(); }; +typedef std::deque whowas_set; +typedef std::map whowas_users; + +/** A lightweight userrec used by WHOWAS + */ + void AddOper(userrec* user); void DeleteOper(userrec* user); void kill_link(userrec *user,const char* r); void kill_link_silent(userrec *user,const char* r); void AddWhoWas(userrec* u); +void MaintainWhoWas(time_t TIME); void AddClient(int socket, int port, bool iscached, in_addr ip4); void FullConnectUser(userrec* user, CullList* Goners); userrec* ReHashNick(char* Old, char* New);