X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fusers.h;h=e7ad4b9d939a8ac6204b7cd31c40bf3071b92b4c;hb=c330b24501fc56516fef098428889a0a526e706a;hp=b56af660636df318328e67b36f88c0998d94e036;hpb=0d6245e271ab0587d9cd1265cd11dafcb6eb6501;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/users.h b/include/users.h index b56af6606..e7ad4b9d9 100644 --- a/include/users.h +++ b/include/users.h @@ -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);