X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2FUserNode.h;h=b43ac996926399e819cc7f71a380a7154f460b48;hb=44436a96352a38631237978c9fd431cef3d85cfb;hp=f905437aae542a80341aafa035dafb29f4d625a4;hpb=0f1dc61921eef1db8e404a5a82372e2d1cd55daa;p=NeonServV5.git diff --git a/src/UserNode.h b/src/UserNode.h index f905437..b43ac99 100644 --- a/src/UserNode.h +++ b/src/UserNode.h @@ -1,3 +1,19 @@ +/* UserNode.h - NeonServ v5.3 + * Copyright (C) 2011 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #ifndef _UserNode_h #define _UserNode_h #include "main.h" @@ -11,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 @@ -25,14 +43,17 @@ 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(); void free_UserNode(); @@ -43,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);