degesch: make auto-away less spammy
This commit is contained in:
parent
4d11be0b85
commit
79140c3abc
34
degesch.c
34
degesch.c
|
@ -6503,24 +6503,6 @@ irc_handle_rpl_inviting (struct server *s, const struct irc_message *msg)
|
||||||
"You have invited #n to #S", nickname, channel_name);
|
"You have invited #n to #S", nickname, channel_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
irc_handle_rpl_nowaway (struct server *s, const struct irc_message *msg)
|
|
||||||
{
|
|
||||||
(void) msg;
|
|
||||||
|
|
||||||
if (s->irc_user)
|
|
||||||
s->irc_user->away = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
irc_handle_rpl_unaway (struct server *s, const struct irc_message *msg)
|
|
||||||
{
|
|
||||||
(void) msg;
|
|
||||||
|
|
||||||
if (s->irc_user)
|
|
||||||
s->irc_user->away = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
irc_handle_err_nicknameinuse (struct server *s, const struct irc_message *msg)
|
irc_handle_err_nicknameinuse (struct server *s, const struct irc_message *msg)
|
||||||
{
|
{
|
||||||
|
@ -6712,6 +6694,7 @@ irc_process_numeric (struct server *s,
|
||||||
str_vector_add_vector (©, msg->params.vector + !!msg->params.len);
|
str_vector_add_vector (©, msg->params.vector + !!msg->params.len);
|
||||||
|
|
||||||
struct buffer *buffer = s->buffer;
|
struct buffer *buffer = s->buffer;
|
||||||
|
int flags = BUFFER_LINE_STATUS;
|
||||||
switch (numeric)
|
switch (numeric)
|
||||||
{
|
{
|
||||||
case IRC_RPL_WELCOME:
|
case IRC_RPL_WELCOME:
|
||||||
|
@ -6742,14 +6725,18 @@ irc_process_numeric (struct server *s,
|
||||||
irc_handle_rpl_topicwhotime (s, msg); buffer = NULL; break;
|
irc_handle_rpl_topicwhotime (s, msg); buffer = NULL; break;
|
||||||
case IRC_RPL_INVITING:
|
case IRC_RPL_INVITING:
|
||||||
irc_handle_rpl_inviting (s, msg); buffer = NULL; break;
|
irc_handle_rpl_inviting (s, msg); buffer = NULL; break;
|
||||||
case IRC_RPL_NOWAWAY:
|
|
||||||
irc_handle_rpl_nowaway (s, msg); break;
|
|
||||||
case IRC_RPL_UNAWAY:
|
|
||||||
irc_handle_rpl_unaway (s, msg); break;
|
|
||||||
|
|
||||||
case IRC_ERR_NICKNAMEINUSE:
|
case IRC_ERR_NICKNAMEINUSE:
|
||||||
irc_handle_err_nicknameinuse (s, msg); buffer = NULL; break;
|
irc_handle_err_nicknameinuse (s, msg); buffer = NULL; break;
|
||||||
|
|
||||||
|
// Auto-away spams server buffers with activity
|
||||||
|
case IRC_RPL_NOWAWAY:
|
||||||
|
flags |= BUFFER_LINE_UNIMPORTANT;
|
||||||
|
if (s->irc_user) s->irc_user->away = true; break;
|
||||||
|
case IRC_RPL_UNAWAY:
|
||||||
|
flags |= BUFFER_LINE_UNIMPORTANT;
|
||||||
|
if (s->irc_user) s->irc_user->away = false; break;
|
||||||
|
|
||||||
case IRC_RPL_LIST:
|
case IRC_RPL_LIST:
|
||||||
case IRC_RPL_WHOREPLY:
|
case IRC_RPL_WHOREPLY:
|
||||||
case IRC_RPL_ENDOFWHO:
|
case IRC_RPL_ENDOFWHO:
|
||||||
|
@ -6777,8 +6764,7 @@ irc_process_numeric (struct server *s,
|
||||||
if (buffer)
|
if (buffer)
|
||||||
{
|
{
|
||||||
// Join the parameter vector back and send it to the server buffer
|
// Join the parameter vector back and send it to the server buffer
|
||||||
log_server (s, buffer, BUFFER_LINE_STATUS,
|
log_server (s, buffer, flags, "#&m", join_str_vector (©, ' '));
|
||||||
"#&m", join_str_vector (©, ' '));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
str_vector_free (©);
|
str_vector_free (©);
|
||||||
|
|
Loading…
Reference in New Issue