Fix up /WILN, /WILC and /WILCR. last_ctcp is now the last CTCP request

recieved; last_ctcp_reply is the last reply recieved (used by /RELCR etc.)

All of the /WI* commands now do a /WII style full whois request.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@88 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2010-06-26 14:43:22 +00:00
parent 789ed916cd
commit 223926fdf2
5 changed files with 15 additions and 8 deletions

View File

@@ -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,

View File

@@ -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];

View File

@@ -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),

View File

@@ -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;

View File

@@ -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')