mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
"/whois x x" - if x isn't found irssi now prints "there's no such nick x"
instead of complaining about unknown server x. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@755 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
76a6b9a931
commit
bd19c4a7d7
@ -391,7 +391,19 @@ static void event_ban_type_changed(const char *bantype)
|
||||
}
|
||||
}
|
||||
|
||||
static void sig_whowas_event_end(const char *data, IRC_SERVER_REC *server, const char *sender, const char *addr)
|
||||
static void sig_whois_event_no_server(const char *data, IRC_SERVER_REC *server)
|
||||
{
|
||||
char *params, *nick;
|
||||
|
||||
g_return_if_fail(data != NULL);
|
||||
|
||||
params = event_get_params(data, 2, NULL, &nick);
|
||||
printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_WHOIS_NOT_FOUND, nick);
|
||||
g_free(params);
|
||||
}
|
||||
|
||||
static void sig_whowas_event_end(const char *data, IRC_SERVER_REC *server,
|
||||
const char *sender, const char *addr)
|
||||
{
|
||||
char *params, *nick;
|
||||
|
||||
@ -455,6 +467,7 @@ void fe_events_init(void)
|
||||
signal_add("event connected", (SIGNAL_FUNC) event_connected);
|
||||
signal_add("nickfind event whois", (SIGNAL_FUNC) event_nickfind_whois);
|
||||
signal_add("ban type changed", (SIGNAL_FUNC) event_ban_type_changed);
|
||||
signal_add("whois event noserver", (SIGNAL_FUNC) sig_whois_event_no_server);
|
||||
signal_add("whowas event end", (SIGNAL_FUNC) sig_whowas_event_end);
|
||||
}
|
||||
|
||||
@ -483,5 +496,6 @@ void fe_events_deinit(void)
|
||||
signal_remove("event connected", (SIGNAL_FUNC) event_connected);
|
||||
signal_remove("nickfind event whois", (SIGNAL_FUNC) event_nickfind_whois);
|
||||
signal_remove("ban type changed", (SIGNAL_FUNC) event_ban_type_changed);
|
||||
signal_remove("whois event noserver", (SIGNAL_FUNC) sig_whois_event_no_server);
|
||||
signal_remove("whowas event end", (SIGNAL_FUNC) sig_whowas_event_end);
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ static void cmd_whois(const char *data, IRC_SERVER_REC *server,
|
||||
WI_ITEM_REC *item)
|
||||
{
|
||||
GHashTable *optlist;
|
||||
char *qserver, *query;
|
||||
char *qserver, *query, *event_402;
|
||||
void *free_arg;
|
||||
int free_nick;
|
||||
|
||||
@ -437,10 +437,14 @@ static void cmd_whois(const char *data, IRC_SERVER_REC *server,
|
||||
g_hash_table_lookup(optlist, "yes") == NULL)
|
||||
cmd_param_error(CMDERR_NOT_GOOD_IDEA);
|
||||
|
||||
event_402 = "event 402";
|
||||
if (*qserver == '\0')
|
||||
g_string_sprintf(tmpstr, "WHOIS %s", query);
|
||||
else
|
||||
else {
|
||||
g_string_sprintf(tmpstr, "WHOIS %s %s", qserver, query);
|
||||
if (g_strcasecmp(qserver, query) == 0)
|
||||
event_402 = "whois event noserver";
|
||||
}
|
||||
|
||||
server->whois_found = FALSE;
|
||||
irc_send_cmd_split(server, tmpstr->str, 2, server->max_whois_in_cmd);
|
||||
@ -450,7 +454,7 @@ static void cmd_whois(const char *data, IRC_SERVER_REC *server,
|
||||
|
||||
server_redirect_event((SERVER_REC *) server, query, 2,
|
||||
"event 318", "event 318", 1,
|
||||
"event 402", "event 402", -1,
|
||||
"event 402", event_402, -1,
|
||||
"event 311", "whois event", 1,
|
||||
"event 401", "whois not found", 1, NULL);
|
||||
if (free_nick) g_free(query);
|
||||
|
Loading…
Reference in New Issue
Block a user