aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-11-23 08:33:58 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2015-11-23 08:33:58 +0100
commit79140c3abc9a96ae1884b0b1433b18eb5d50ca3e (patch)
tree7947cd751f4bf853b2d2f7271019244962850a21
parent4d11be0b85b623a06aca0b8e2ed5a97da57a85e0 (diff)
downloadxK-79140c3abc9a96ae1884b0b1433b18eb5d50ca3e.tar.gz
xK-79140c3abc9a96ae1884b0b1433b18eb5d50ca3e.tar.xz
xK-79140c3abc9a96ae1884b0b1433b18eb5d50ca3e.zip
degesch: make auto-away less spammy
-rw-r--r--degesch.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/degesch.c b/degesch.c
index dc16c93..21be937 100644
--- a/degesch.c
+++ b/degesch.c
@@ -6504,24 +6504,6 @@ irc_handle_rpl_inviting (struct server *s, const struct irc_message *msg)
}
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)
{
if (msg->params.len < 2)
@@ -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);