Handle 301 numeric with missing message away message argument

Reported-by: trn
This commit is contained in:
Kevin Easton
2019-06-21 16:04:15 +10:00
parent ae515a2b15
commit bdd4f624c7
2 changed files with 14 additions and 5 deletions

View File

@@ -1,5 +1,7 @@
[Changes 1.2.2]
* Handle 301 numeric with missing message argument. Reported by trn. (caf)
* Display "Servers exhausted. Restarting." message at the right time. (caf)
* Fix bug where the initial server connection was only retried one less than

View File

@@ -723,19 +723,26 @@ void numbered_command(char *from, int comm, char **ArgList)
break;
}
case 301: /* #define RPL_AWAY 301 */
{
const char *away_msg = "";
if (ArgList[1])
{
PasteArgs(ArgList, 1);
away_msg = ArgList[1];
}
if (get_int_var(SHOW_AWAY_ONCE_VAR))
{
if (!last_away_msg || strcmp(last_away_nick, from) || strcmp(last_away_msg, ArgList[1]))
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, ArgList[1]);
malloc_strcpy(&last_away_msg, away_msg);
}
else break;
}
if (do_hook(current_numeric, "%s %s", ArgList[0], ArgList[1]))
put_it("%s", convert_output_format(fget_string_var(FORMAT_WHOIS_AWAY_FSET),"%s %s", ArgList[0], ArgList[1]));
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 */