aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-06-07 00:10:36 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-06-07 00:15:38 +0200
commite1aa27c90ba4ab1931f27371a63cbc2d3e0ea735 (patch)
treefc36a19a309492752f21f2e8eaa5c1c920105c4b
parent7c2fe522baefe170ed4be78e6c6dbda8946247a1 (diff)
downloadxK-e1aa27c90ba4ab1931f27371a63cbc2d3e0ea735.tar.gz
xK-e1aa27c90ba4ab1931f27371a63cbc2d3e0ea735.tar.xz
xK-e1aa27c90ba4ab1931f27371a63cbc2d3e0ea735.zip
degesch: parse RPL_CHANNELMODEIS
-rw-r--r--degesch.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/degesch.c b/degesch.c
index 4dd4779..8e1404a 100644
--- a/degesch.c
+++ b/degesch.c
@@ -4816,6 +4816,31 @@ irc_handle_rpl_topic (struct server *s, const struct irc_message *msg)
}
static void
+irc_handle_rpl_channelmodeis (struct server *s, const struct irc_message *msg)
+{
+ if (msg->params.len < 2)
+ return;
+
+ const char *channel_name = msg->params.vector[1];
+
+ struct channel *channel = str_map_find (&s->irc_channels, channel_name);
+ struct buffer *buffer = str_map_find (&s->irc_buffer_map, channel_name);
+ hard_assert ((channel && buffer) ||
+ (channel && !buffer) || (!channel && !buffer));
+
+ if (channel)
+ {
+ str_reset (&channel->no_param_modes);
+ str_map_clear (&channel->param_modes);
+
+ irc_handle_mode_channel (s, channel, msg->params.vector + 1);
+ }
+
+ // XXX: do we want to log a message?
+ refresh_prompt (s->ctx);
+}
+
+static void
irc_handle_isupport_prefix (struct server *s, char *value)
{
char *modes = value;
@@ -4995,15 +5020,17 @@ irc_process_numeric (struct server *s,
break;
case IRC_RPL_ISUPPORT:
- irc_handle_rpl_isupport (s, msg); break;
+ irc_handle_rpl_isupport (s, msg); break;
case IRC_RPL_USERHOST:
- irc_handle_rpl_userhost (s, msg); break;
+ irc_handle_rpl_userhost (s, msg); break;
case IRC_RPL_NAMREPLY:
- irc_handle_rpl_namreply (s, msg); buffer = NULL; break;
+ irc_handle_rpl_namreply (s, msg); buffer = NULL; break;
case IRC_RPL_ENDOFNAMES:
- irc_handle_rpl_endofnames (s, msg); buffer = NULL; break;
+ irc_handle_rpl_endofnames (s, msg); buffer = NULL; break;
case IRC_RPL_TOPIC:
- irc_handle_rpl_topic (s, msg); buffer = NULL; break;
+ irc_handle_rpl_topic (s, msg); buffer = NULL; break;
+ case IRC_RPL_CHANNELMODEIS:
+ irc_handle_rpl_channelmodeis (s, msg); buffer = NULL; break;
case IRC_ERR_NICKNAMEINUSE:
// TODO: if (state == IRC_CONNECTED), use a different nick;