degesch: make auto-away less spammy

This commit is contained in:
Přemysl Eric Janouch 2015-11-23 08:33:58 +01:00
parent 4d11be0b85
commit 79140c3abc
1 changed files with 10 additions and 24 deletions

View File

@ -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);
}
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
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 (&copy, msg->params.vector + !!msg->params.len);
struct buffer *buffer = s->buffer;
int flags = BUFFER_LINE_STATUS;
switch (numeric)
{
case IRC_RPL_WELCOME:
@ -6742,14 +6725,18 @@ irc_process_numeric (struct server *s,
irc_handle_rpl_topicwhotime (s, msg); buffer = NULL; break;
case IRC_RPL_INVITING:
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:
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_WHOREPLY:
case IRC_RPL_ENDOFWHO:
@ -6777,8 +6764,7 @@ irc_process_numeric (struct server *s,
if (buffer)
{
// Join the parameter vector back and send it to the server buffer
log_server (s, buffer, BUFFER_LINE_STATUS,
"#&m", join_str_vector (&copy, ' '));
log_server (s, buffer, flags, "#&m", join_str_vector (&copy, ' '));
}
str_vector_free (&copy);