/* X-Chat * Copyright (C) 1998 Peter Zelezny. * * 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 */ #include #include #include #include "hexchat.h" #include "modes.h" #include "fe.h" #include "notify.h" #include "tree.h" #include "hexchatc.h" #include "util.h" int nick_cmp_az_ops (server *serv, struct User *user1, struct User *user2) { unsigned int access1 = user1->access; unsigned int access2 = user2->access; int pos; if (access1 != access2) { for (pos = 0; pos < USERACCESS_SIZE; pos++) { if ((access1&(1<p_cmp (user1->nick, user2->nick); } int nick_cmp_alpha (struct User *user1, struct User *user2, server *serv) { return serv->p_cmp (user1->nick, user2->nick); } /* insert name in appropriate place in linked list. Returns row number or: -1: duplicate */ static int userlist_insertname (session *sess, struct User *newuser) { if (!sess->usertree) { sess->usertree = tree_new ((tree_cmp_func *)nick_cmp_alpha, sess->server); } return tree_insert (sess->usertree, newuser); } void userlist_set_away (struct session *sess, char *nick, unsigned int away) { struct User *user; user = userlist_find (sess, nick); if (user) { if (user->away != away) { user->away = away; /* rehash GUI */ fe_userlist_rehash (sess, user); if (away) fe_userlist_update (sess, user); } } } void userlist_set_account (struct session *sess, char *nick, char *account) { struct User *user; user = userlist_find (sess, nick); if (user) { if (strcmp (account, "*") == 0) { g_clear_pointer (&user->account, g_free); } else if (g_strcmp0 (user->account, account)) { g_free (user->account); user->account = g_strdup (account); } /* gui doesnt currently reflect login status, maybe later fe_userlist_rehash (sess, user); */ } } int userlist_add_hostname (struct session *sess, char *nick, char *hostname, char *realname, char *servername, char *account, unsigned int away) { struct User *user; gboolean do_rehash = FALSE; user = userlist_find (sess, nick); if (user) { if (hostname && (!user->hostname || strcmp(user->hostname, hostname))) { if (prefs.hex_gui_ulist_show_hosts) do_rehash = TRUE; g_free (user->hostname); user->hostname = g_strdup (hostname); } if (realname && *realname && g_strcmp0 (user->realname, realname) != 0) { g_free (user->realname); user->realname = g_strdup (realname); } if (!user->servername && servername) user->servername = g_strdup (servername); if (!user->account && account && strcmp (account, "0") != 0) user->account = g_strdup (account); if (away != 0xff) { if (user->away != away) do_rehash = TRUE; user->away = away; } fe_userlist_update (sess, user); if (do_rehash) fe_userlist_rehash (sess, user); return 1; } return 0; } static int free_user (struct User *user, gpointer data) { g_free (user->realname); g_free (user->hostname); g_free (user->servername); g_
DOMAIN = $(PACKAGE)
subdir = po
top_builddir = ..
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
COPYRIGHT_HOLDER = 
MSGID_BUGS_ADDRESS = www.hexchat.org
EXTRA_LOCALE_CATEGORIES =