2013-03-31 23:44:48 +04:00
|
|
|
/* HexChat
|
|
|
|
* Copyright (C) 1998-2010 Peter Zelezny.
|
|
|
|
* Copyright (C) 2009-2013 Berke Viktor.
|
|
|
|
*
|
|
|
|
* 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 2 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2011-02-24 06:14:30 +03:00
|
|
|
#include <time.h>
|
|
|
|
|
2012-10-25 03:33:23 +04:00
|
|
|
#ifndef HEXCHAT_USERLIST_H
|
|
|
|
#define HEXCHAT_USERLIST_H
|
2011-02-24 06:14:30 +03:00
|
|
|
|
|
|
|
struct User
|
|
|
|
{
|
|
|
|
char nick[NICKLEN];
|
|
|
|
char *hostname;
|
|
|
|
char *realname;
|
|
|
|
char *servername;
|
|
|
|
time_t lasttalk;
|
|
|
|
unsigned int access; /* axs bit field */
|
|
|
|
char prefix[2]; /* @ + % */
|
|
|
|
unsigned int op:1;
|
|
|
|
unsigned int hop:1;
|
|
|
|
unsigned int voice:1;
|
|
|
|
unsigned int me:1;
|
|
|
|
unsigned int away:1;
|
|
|
|
unsigned int selected:1;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define USERACCESS_SIZE 12
|
|
|
|
|
|
|
|
int userlist_add_hostname (session *sess, char *nick,
|
|
|
|
char *hostname, char *realname,
|
|
|
|
char *servername, unsigned int away);
|
|
|
|
void userlist_set_away (session *sess, char *nick, unsigned int away);
|
2013-01-03 02:50:26 +04:00
|
|
|
struct User *userlist_find (session *sess, const char *name);
|
2011-02-24 06:14:30 +03:00
|
|
|
struct User *userlist_find_global (server *serv, char *name);
|
|
|
|
void userlist_clear (session *sess);
|
|
|
|
void userlist_free (session *sess);
|
|
|
|
void userlist_add (session *sess, char *name, char *hostname);
|
|
|
|
int userlist_remove (session *sess, char *name);
|
2011-05-30 22:27:08 +04:00
|
|
|
void userlist_remove_user (session *sess, struct User *user);
|
2011-02-24 06:14:30 +03:00
|
|
|
int userlist_change (session *sess, char *oldname, char *newname);
|
|
|
|
void userlist_update_mode (session *sess, char *name, char mode, char sign);
|
|
|
|
GSList *userlist_flat_list (session *sess);
|
|
|
|
GList *userlist_double_list (session *sess);
|
|
|
|
void userlist_rehash (session *sess);
|
|
|
|
|
|
|
|
#endif
|