diff options
author | Jilles Tjoelker <jilles@irssi.org> | 2007-11-02 22:40:36 +0000 |
---|---|---|
committer | jilles <jilles@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2007-11-02 22:40:36 +0000 |
commit | ffb294ae3f00348bf5f14d1d92fd17b29aeb17e9 (patch) | |
tree | c370ce372d300b3e85c21ab7c17145e39e0c82d6 /src | |
parent | 7a48e35b341d082b2b0ca0d8f2f1376c3fa78473 (diff) | |
download | irssi-ffb294ae3f00348bf5f14d1d92fd17b29aeb17e9.zip |
Add support for RPL_WHOISACTUALLY (338), both ratbox and ircu style.
Note that the ratbox style only shows ip, this appears as
hostname: <ip> which is slightly different from the other
real host numerics.
Bug #428
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4634 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/irc/fe-whois.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/fe-common/irc/fe-whois.c b/src/fe-common/irc/fe-whois.c index 64e11a14..4ecfd77e 100644 --- a/src/fe-common/irc/fe-whois.c +++ b/src/fe-common/irc/fe-whois.c @@ -178,6 +178,31 @@ static void event_whois_realhost327(IRC_SERVER_REC *server, const char *data) g_free(params); } +static void event_whois_realhost338(IRC_SERVER_REC *server, const char *data) +{ + char *params, *nick, *arg1, *arg2, *arg3; + + g_return_if_fail(data != NULL); + + /* + * :<server> 338 <yournick> <nick> <user>@<host> <ip> :Actual user@host, actual IP + * (ircu) or + * :<server> 338 <yournick> <nick> <ip> :actually using host + * (ratbox) + */ + params = event_get_params(data, 5, NULL, &nick, &arg1, &arg2, &arg3); + if (*arg3 != '\0') { + printformat(server, nick, MSGLEVEL_CRAP, + IRCTXT_WHOIS_REALHOST, nick, arg1, arg2); + } else if (*arg2 != '\0') { + printformat(server, nick, MSGLEVEL_CRAP, + IRCTXT_WHOIS_REALHOST, nick, arg1, ""); + } else { + event_whois_special(server, data); + } + g_free(params); +} + static void event_whois_usermode(IRC_SERVER_REC *server, const char *data) { char *params, *txt_usermodes, *nick, *usermode; @@ -340,6 +365,7 @@ static struct whois_event_table events[] = { { 312, event_whois_server }, { 326, event_whois_usermode326 }, { 327, event_whois_realhost327 }, + { 338, event_whois_realhost338 }, { 379, event_whois_modes }, { 378, event_whois_realhost }, { 377, event_whois_usermode }, @@ -381,6 +407,7 @@ void fe_whois_init(void) signal_add("event 379", (SIGNAL_FUNC) event_whois_modes); signal_add("event 327", (SIGNAL_FUNC) event_whois_realhost327); signal_add("event 326", (SIGNAL_FUNC) event_whois_usermode326); + signal_add("event 338", (SIGNAL_FUNC) event_whois_realhost338); signal_add("whois away", (SIGNAL_FUNC) event_whois_away); signal_add("whois oper", (SIGNAL_FUNC) event_whois_oper); signal_add("whowas away", (SIGNAL_FUNC) event_whois_away); @@ -403,6 +430,7 @@ void fe_whois_deinit(void) signal_remove("event 379", (SIGNAL_FUNC) event_whois_modes); signal_remove("event 327", (SIGNAL_FUNC) event_whois_realhost327); signal_remove("event 326", (SIGNAL_FUNC) event_whois_usermode326); + signal_remove("event 338", (SIGNAL_FUNC) event_whois_realhost338); signal_remove("whois away", (SIGNAL_FUNC) event_whois_away); signal_remove("whois oper", (SIGNAL_FUNC) event_whois_oper); signal_remove("whowas away", (SIGNAL_FUNC) event_whois_away); |