Introduce get_kick_reason() and switch all kick commands to use it

get_reason() is then used only for the implementation of get_kick_reason()
and for the $getreason() scripting function.  Add current nick as an
explicit argument for get_reason(), which pushes all use of from_server
out of the ransom reason functions.

Also switch a few instances of send_to_server() to my_send_to_server() where
the current server has been returned by prepare_command().
This commit is contained in:
Kevin Easton
2015-06-28 00:35:50 +10:00
parent ff251080da
commit 498631e74a
5 changed files with 51 additions and 30 deletions

View File

@@ -5081,9 +5081,9 @@ char *blah;
BUILT_IN_FUNCTION(function_getreason, word)
{
char *nick = NULL;
char *nick = NULL;
GET_STR_ARG(nick, word);
RETURN_STR(get_reason(nick, word));
RETURN_STR(get_reason(nick, get_server_nickname(from_server), word));
}
BUILT_IN_FUNCTION(function_chmod, words)