Better support for halfops, patch by yathen@web.de

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2228 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-12-09 17:13:48 +00:00 committed by cras
commit 15e815e8d3
8 changed files with 57 additions and 24 deletions

View file

@ -31,7 +31,7 @@
/* Add new nick to list */
NICK_REC *irc_nicklist_insert(IRC_CHANNEL_REC *channel, const char *nick,
int op, int voice, int send_massjoin)
int op, int halfop, int voice, int send_massjoin)
{
NICK_REC *rec;
@ -42,6 +42,7 @@ NICK_REC *irc_nicklist_insert(IRC_CHANNEL_REC *channel, const char *nick,
rec->nick = g_strdup(nick);
if (op) rec->op = TRUE;
if (halfop) rec->halfop = TRUE;
if (voice) rec->voice = TRUE;
rec->send_massjoin = send_massjoin;
@ -112,7 +113,8 @@ static void event_names_list(IRC_SERVER_REC *server, const char *data)
if (*names != '\0') *names++ = '\0';
irc_nicklist_insert(chanrec, ptr+isnickflag(*ptr),
*ptr == '@', *ptr == '+', FALSE);
*ptr == '@', *ptr == '%', *ptr == '+',
FALSE);
}
g_free(params);
@ -138,7 +140,7 @@ static void event_end_of_names(IRC_SERVER_REC *server, const char *data)
nicks = g_hash_table_size(chanrec->nicks);
ownnick = irc_nicklist_insert(chanrec, server->nick,
nicks == 0, FALSE,
FALSE);
FALSE, FALSE);
}
nicklist_set_own(CHANNEL(chanrec), ownnick);
chanrec->chanop = chanrec->ownnick->op;

View file

@ -5,7 +5,7 @@
/* Add new nick to list */
NICK_REC *irc_nicklist_insert(IRC_CHANNEL_REC *channel, const char *nick,
int op, int voice, int send_massjoin);
int op, int halfop, int voice, int send_massjoin);
/* Remove all "extra" characters from `nick'. Like _nick_ -> nick */
char *irc_nick_strip(const char *nick);

View file

@ -77,7 +77,7 @@ static void sig_session_restore_nick(IRC_CHANNEL_REC *channel,
CONFIG_NODE *node)
{
const char *nick;
int op, voice;
int op, halfop, voice;
NICK_REC *nickrec;
if (!IS_IRC_CHANNEL(channel))
@ -89,8 +89,8 @@ static void sig_session_restore_nick(IRC_CHANNEL_REC *channel,
op = config_node_get_bool(node, "op", FALSE);
voice = config_node_get_bool(node, "voice", FALSE);
nickrec = irc_nicklist_insert(channel, nick, op, voice, FALSE);
nickrec->halfop = config_node_get_bool(node, "halfop", FALSE);
halfop = config_node_get_bool(node, "halfop", FALSE);
nickrec = irc_nicklist_insert(channel, nick, op, halfop, voice, FALSE);
}
static void session_restore_channel(IRC_CHANNEL_REC *channel)

View file

@ -57,7 +57,7 @@ static void event_join(IRC_SERVER_REC *server, const char *data,
if (chanrec == NULL) return;
/* add user to nicklist */
nickrec = irc_nicklist_insert(chanrec, nick, FALSE, FALSE, TRUE);
nickrec = irc_nicklist_insert(chanrec, nick, FALSE, FALSE, FALSE, TRUE);
nicklist_set_host(CHANNEL(chanrec), nickrec, address);
if (chanrec->massjoins == 0) {