diff --git a/Changelog b/Changelog index ed6b16c..a4c24a3 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,7 @@ [Changes 1.2.2] +* Fix SHOW_AWAY_ONCE so it shows away message if the nick has changed. (caf) + * Handle 301 numeric with missing message argument. Reported by trn. (caf) * Display "Servers exhausted. Restarting." message at the right time. (caf) diff --git a/source/numbers.c b/source/numbers.c index 0303943..741fca9 100644 --- a/source/numbers.c +++ b/source/numbers.c @@ -732,17 +732,14 @@ void numbered_command(char *from, int comm, char **ArgList) away_msg = ArgList[1]; } - if (get_int_var(SHOW_AWAY_ONCE_VAR)) + if (!get_int_var(SHOW_AWAY_ONCE_VAR) || !last_away_msg || strcmp(last_away_nick, ArgList[0]) || strcmp(last_away_msg, away_msg)) { - if (!last_away_msg || strcmp(last_away_nick, from) || strcmp(last_away_msg, away_msg)) - { - malloc_strcpy(&last_away_nick, from); - malloc_strcpy(&last_away_msg, away_msg); - } - else break; + malloc_strcpy(&last_away_nick, ArgList[0]); + malloc_strcpy(&last_away_msg, away_msg); + + if (do_hook(current_numeric, "%s %s", ArgList[0], away_msg)) + put_it("%s", convert_output_format(fget_string_var(FORMAT_WHOIS_AWAY_FSET),"%s %s", ArgList[0], away_msg)); } - if (do_hook(current_numeric, "%s %s", ArgList[0], away_msg)) - put_it("%s", convert_output_format(fget_string_var(FORMAT_WHOIS_AWAY_FSET),"%s %s", ArgList[0], away_msg)); break; } case 302: /* #define RPL_USERHOST 302 */