degesch: parse RPL_CHANNELMODEIS
This commit is contained in:
parent
7c2fe522ba
commit
e1aa27c90b
27
degesch.c
27
degesch.c
|
@ -4815,6 +4815,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
|
static void
|
||||||
irc_handle_isupport_prefix (struct server *s, char *value)
|
irc_handle_isupport_prefix (struct server *s, char *value)
|
||||||
{
|
{
|
||||||
|
@ -5004,6 +5029,8 @@ irc_process_numeric (struct server *s,
|
||||||
irc_handle_rpl_endofnames (s, msg); buffer = NULL; break;
|
irc_handle_rpl_endofnames (s, msg); buffer = NULL; break;
|
||||||
case IRC_RPL_TOPIC:
|
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:
|
case IRC_ERR_NICKNAMEINUSE:
|
||||||
// TODO: if (state == IRC_CONNECTED), use a different nick;
|
// TODO: if (state == IRC_CONNECTED), use a different nick;
|
||||||
|
|
Loading…
Reference in New Issue