Fix SHOW_AWAY_ONCE so it shows away message if the nick has changed

This was always the intent of the code, but it was using the server name
instead of the nick.
This commit is contained in:
Kevin Easton committed 2019-06-21 16:24:27 +10:00
1 parent bdd4f624c7
commit 8d4808d744
2 files changed
+8 -9

No files matched your search

+2
View File
@@ -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)
+6 -9
View File
@@ -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 */