diff --git a/Changelog b/Changelog index d59f7bf..cc50e72 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,7 @@ [Changes 1.2c01] +* Fix up /WILN, /WILC and /WILCR. (caf). + * Backport changes from epic5 to make recv_nick, sent_nick and sent_body per-server, and apply new version of do_oops from flewid. This means that /oops, "/query .", "/query ,", "/msg ." and "/msg ," are per-server, diff --git a/include/misc.h b/include/misc.h index df68d65..7adedc8 100644 --- a/include/misc.h +++ b/include/misc.h @@ -63,6 +63,7 @@ extern LastMsg last_topic[2]; extern LastMsg last_wall[MAX_LAST_MSG+1]; extern LastMsg last_invite_channel[2]; extern LastMsg last_ctcp[2]; +extern LastMsg last_ctcp_reply[2]; extern LastMsg last_sent_ctcp[2]; diff --git a/source/commands.c b/source/commands.c index 905916b..e9b86b7 100644 --- a/source/commands.c +++ b/source/commands.c @@ -1634,13 +1634,13 @@ BUILT_IN_COMMAND(my_whois) if (!strcmp(command, "WILM")) nick = get_server_recv_nick(from_server); else if (!strcmp(command, "WILN")) - nick = last_notice[0].to; + nick = last_notice[0].from; else if (!strcmp(command, "WILC")) nick = last_sent_ctcp[0].to; else if (!strcmp(command, "WILCR")) - nick = last_ctcp[0].to; + nick = last_ctcp[0].from; if (nick) - send_to_server("WHOIS %s", nick); + send_to_server("WHOIS %s %s", nick, nick); else bitchsay("You have no friends"); return; @@ -1652,7 +1652,7 @@ BUILT_IN_COMMAND(my_whois) send_to_server("WHOIS %s %s", channel, channel); } else if ((nick = get_target_by_refnum(0)) && !is_channel(nick)) - send_to_server("WHOIS %s", nick); + send_to_server("WHOIS %s %s", nick, nick); else { send_to_server("WHOIS %s %s", get_server_nickname(from_server), diff --git a/source/ctcp.c b/source/ctcp.c index 4080106..6597901 100644 --- a/source/ctcp.c +++ b/source/ctcp.c @@ -1246,9 +1246,9 @@ extern char *do_ctcp (char *from, char *to, char *str) continue; #endif - if (do_hook(CTCP_LIST, "%s %s %s %s", from, to, ctcp_command, ctcp_argument)) + if (do_hook(CTCP_LIST, "%s %s %s %s", from, to, ctcp_command, ctcp_argument) && allow_ctcp_reply) { - if (allow_ctcp_reply && get_int_var(CTCP_VERBOSE_VAR)) + if (get_int_var(CTCP_VERBOSE_VAR)) { #ifdef WANT_USERLIST if (lookup_userlevelc("*", FromUserHost, "*", NULL)) @@ -1259,6 +1259,8 @@ extern char *do_ctcp (char *from, char *to, char *str) put_it("%s", convert_output_format(fget_string_var(get_int_var(CLOAK_VAR)? FORMAT_CTCP_CLOAK_UNKNOWN_FSET:FORMAT_CTCP_UNKNOWN_FSET), "%s %s %s %s %s %s",update_clock(GET_TIME), from, FromUserHost, to, ctcp_command, *ctcp_argument? ctcp_argument : empty_string)); } + + add_last_type(&last_ctcp[0], 1, from, FromUserHost, to, ctcp_command); } allow_ctcp_reply = 0; continue; @@ -1315,6 +1317,7 @@ extern char *do_ctcp (char *from, char *to, char *str) put_it("%s", convert_output_format(fget_string_var((get_int_var(CLOAK_VAR)?FORMAT_CTCP_CLOAK_FSET:FORMAT_CTCP_FSET)), "%s %s %s %s %s %s", update_clock(GET_TIME), from, FromUserHost, to, ctcp_command, *ctcp_argument? ctcp_argument : empty_string)); #endif + add_last_type(&last_ctcp[0], 1, from, FromUserHost, to, ctcp_command); } } @@ -1445,7 +1448,7 @@ extern char *do_notice_ctcp (char *from, char *to, char *str) if (do_hook(CTCP_REPLY_LIST, "%s %s %s", from, ctcp_command, ctcp_argument)) { put_it("%s", convert_output_format(fget_string_var(FORMAT_CTCP_REPLY_FSET),"%s %s %s %s %s", update_clock(GET_TIME), from, FromUserHost, ctcp_command, ctcp_argument)); - add_last_type(&last_ctcp[0], 1, from, FromUserHost, ctcp_command, ctcp_argument); + add_last_type(&last_ctcp_reply[0], 1, from, FromUserHost, ctcp_command, ctcp_argument); } allow_ctcp_reply = 0; diff --git a/source/misc.c b/source/misc.c index c74eced..fa27431 100644 --- a/source/misc.c +++ b/source/misc.c @@ -92,6 +92,7 @@ LastMsg last_topic[2] = {{ NULL }}; LastMsg last_wall[MAX_LAST_MSG+1] = {{ NULL }}; LastMsg last_invite_channel[2] = {{ NULL }}; LastMsg last_ctcp[2] = {{ NULL }}; +LastMsg last_ctcp_reply[2] = {{ NULL }}; LastMsg last_sent_ctcp[2] = {{ NULL }}; LastMsg last_sent_dcc[MAX_LAST_MSG+1] = {{ NULL }}; @@ -1360,7 +1361,7 @@ BUILT_IN_COMMAND(do_dirlasttype) if (!my_strnicmp(command, "RELCR", 5)) { - t = &last_ctcp[0]; + t = &last_ctcp_reply[0]; form = fget_string_var(FORMAT_CTCP_REPLY_FSET); sform = "%s %s %s %s %s"; if (len == 6 && command[len-1] == 'T')