Another year is about to end... So we have to update these damn copyright information :P
[NeonServV5.git] / src / UserNode.h
index 051a1539696ad12460cabf4c6c2e4adad485d334..c1c4d800add329ad5987fefc5e1adef9ace59c5c 100644 (file)
@@ -1,5 +1,5 @@
-/* UserNode.h - NeonServ v5.0
- * Copyright (C) 2011  Philipp Kreil (pk910)
+/* UserNode.h - NeonServ v5.3
+ * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,7 +27,9 @@
 #define USERFLAG_LOADED_SETTINGS    0x0040
 #define USERFLAG_REPLY_PRIVMSG      0x0080
 #define USERFLAG_GOD_MODE           0x0100
+#define USERFLAG_HAS_USERID         0x0200
 
+#define USERFLAG_WAS_REGISTRING     0x20000000 /* only set for event_join if the quit reason was Registered */
 #define USERFLAG_SCRIPTFLAG1        0x40000000
 #define USERFLAG_SCRIPTFLAG2        0x80000000
 
@@ -41,14 +43,16 @@ struct UserNode {
     char realname[REALLEN+1];
     char auth[AUTHLEN+1];
     unsigned int flags;
-    time_t created;
+    time_t created, last_who;
     struct ChanUser *channel;
     struct language *language;
     
+    int user_id;
+    
     struct UserNode *next;
 };
 
-#define isNetworkService(USER) (USER->flags & (USERFLAG_ISBOT | USERFLAG_ISIRCOP))
+#define isNetworkService(USER) (USER->flags & (USERFLAG_ISBOT | USERFLAG_ISIRCOP | USERFLAG_ISSERVER))
 #define isBot(USER) (USER->flags & (USERFLAG_ISBOT))
 
 void init_UserNode();
@@ -60,6 +64,7 @@ int countUsersWithHost(char *host);
 char *getAuthFakehost(char *auth);
 struct UserNode* searchUserByNick(const char *nick);
 struct UserNode* getAllUsers(struct UserNode *last);
+struct UserNode* getUsersWithAuth(const char *auth, struct UserNode *last);
 int getUserCount();
 struct UserNode* addUser(const char *nick);
 struct UserNode* addUserMask(const char *mask);