aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--degesch.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/degesch.c b/degesch.c
index f87b4f9..a3da97d 100644
--- a/degesch.c
+++ b/degesch.c
@@ -4706,12 +4706,15 @@ irc_handle_cap (struct server *s, const struct irc_message *msg)
struct str_vector v;
str_vector_init (&v);
+ const char *args = "";
if (msg->params.len > 2)
- split_str_ignore_empty (msg->params.vector[2], ' ', &v);
+ split_str_ignore_empty ((args = msg->params.vector[2]), ' ', &v);
const char *subcommand = msg->params.vector[1];
if (!strcasecmp_ascii (subcommand, "ACK"))
{
+ log_server_status (s, s->buffer,
+ "#s: #S", "Capabilities acknowledged", args);
for (size_t i = 0; i < v.len; i++)
{
const char *cap = v.vector[i];
@@ -4727,9 +4730,16 @@ irc_handle_cap (struct server *s, const struct irc_message *msg)
irc_send (s, "CAP END");
}
else if (!strcasecmp_ascii (subcommand, "NAK"))
+ {
+ log_server_error (s, s->buffer,
+ "#s: #S", "Capabilities not acknowledged", args);
irc_send (s, "CAP END");
+ }
else if (!strcasecmp_ascii (subcommand, "LS"))
{
+ log_server_status (s, s->buffer,
+ "#s: #S", "Capabilities supported", args);
+
struct str_vector chosen;
str_vector_init (&chosen);
@@ -4746,6 +4756,8 @@ irc_handle_cap (struct server *s, const struct irc_message *msg)
char *chosen_str = join_str_vector (&chosen, ' ');
str_vector_free (&chosen);
irc_send (s, "CAP REQ :%s", chosen_str);
+ log_server_status (s, s->buffer,
+ "#s: #S", "Capabilities requested", chosen_str);
free (chosen_str);
}