diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c index cac63016..fdad5d6e 100644 --- a/src/irc/core/irc-commands.c +++ b/src/irc/core/irc-commands.c @@ -511,10 +511,13 @@ static void server_send_away(IRC_SERVER_REC *server, const char *reason) if (!IS_IRC_SERVER(server)) return; - g_free_not_null(server->away_reason); - server->away_reason = g_strdup(reason); + if (*reason != '\0' || server->usermode_away) { + g_free_and_null(server->away_reason); + if (*reason != '\0') + server->away_reason = g_strdup(reason); - irc_send_cmdv(server, "AWAY :%s", reason); + irc_send_cmdv(server, "AWAY :%s", reason); + } } /* SYNTAX: AWAY [-one | -all] [] */