diff options
author | Timo Sirainen <cras@irssi.org> | 2001-12-09 17:13:48 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-12-09 17:13:48 +0000 |
commit | 15e815e8d3ff84683c2429f59738f6625d3e4f9b (patch) | |
tree | d09ad892780db823466c9a36b102fe2de3882154 /src/irc/core | |
parent | a8419ed5b93af2c063ca90a4f34ffe36d88458a2 (diff) | |
download | irssi-15e815e8d3ff84683c2429f59738f6625d3e4f9b.zip |
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
Diffstat (limited to 'src/irc/core')
-rw-r--r-- | src/irc/core/irc-nicklist.c | 8 | ||||
-rw-r--r-- | src/irc/core/irc-nicklist.h | 2 | ||||
-rw-r--r-- | src/irc/core/irc-session.c | 6 | ||||
-rw-r--r-- | src/irc/core/massjoin.c | 2 |
4 files changed, 10 insertions, 8 deletions
diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c index 5614c7d0..9de3febc 100644 --- a/src/irc/core/irc-nicklist.c +++ b/src/irc/core/irc-nicklist.c @@ -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; diff --git a/src/irc/core/irc-nicklist.h b/src/irc/core/irc-nicklist.h index 7d0ae2f4..0b392c77 100644 --- a/src/irc/core/irc-nicklist.h +++ b/src/irc/core/irc-nicklist.h @@ -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); diff --git a/src/irc/core/irc-session.c b/src/irc/core/irc-session.c index 01fa6fba..c72a6165 100644 --- a/src/irc/core/irc-session.c +++ b/src/irc/core/irc-session.c @@ -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) diff --git a/src/irc/core/massjoin.c b/src/irc/core/massjoin.c index 07ea8fbd..71a46edc 100644 --- a/src/irc/core/massjoin.c +++ b/src/irc/core/massjoin.c @@ -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) { |