1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

Support for several unrealircd WHOIS replies, patch by Mark Glines

<paranoid@deathsdoor.com>


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1275 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-02-21 18:32:15 +00:00 committed by cras
parent db4e159870
commit 4a35a41c85
3 changed files with 81 additions and 3 deletions

View File

@ -345,12 +345,19 @@ static void event_whois_server(IRC_SERVER_REC *server, const char *data)
static void event_whois_oper(IRC_SERVER_REC *server, const char *data)
{
char *params, *nick;
char *params, *nick, *type;
g_return_if_fail(data != NULL);
params = event_get_params(data, 2, NULL, &nick);
printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_WHOIS_OPER, nick);
params = event_get_params(data, 3, NULL, &nick, &type);
if (strlen(type) > 5) {
type += 5;
if (*type == ' ') type++;
}
printformat(server, nick, MSGLEVEL_CRAP,
*type == '\0' ? IRCTXT_WHOIS_OPER :
IRCTXT_WHOIS_OPER_TYPE, nick, type);
g_free(params);
}
@ -365,6 +372,59 @@ static void event_whois_registered(IRC_SERVER_REC *server, const char *data)
g_free(params);
}
static void event_whois_help(IRC_SERVER_REC *server, const char *data)
{
char *params, *nick;
g_return_if_fail(data != NULL);
params = event_get_params(data, 2, NULL, &nick);
printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_WHOIS_HELP, nick);
g_free(params);
}
static void event_whois_modes(IRC_SERVER_REC *server, const char *data)
{
char *params, *nick, *modes;
g_return_if_fail(data != NULL);
params = event_get_params(data, 6, NULL, &nick,
NULL, NULL, NULL, &modes);
printformat(server, nick, MSGLEVEL_CRAP,
IRCTXT_WHOIS_MODES, nick, modes);
g_free(params);
}
static void event_whois_realhost(IRC_SERVER_REC *server, const char *data)
{
char *params, *nick, *str, *from;
g_return_if_fail(data != NULL);
params = event_get_params(data, 3, NULL, &nick, &str);
from = strstr(str, "from ");
if (from == NULL) from = str; else from += 5;
printformat(server, nick, MSGLEVEL_CRAP,
IRCTXT_WHOIS_REALHOST, nick, from);
g_free(params);
}
static void event_whois_special(IRC_SERVER_REC *server, const char *data)
{
char *params, *nick, *str;
g_return_if_fail(data != NULL);
params = event_get_params(data, 3, NULL, &nick, &str);
printformat(server, nick, MSGLEVEL_CRAP,
IRCTXT_WHOIS_SPECIAL, nick, str);
g_free(params);
}
static void event_whowas(IRC_SERVER_REC *server, const char *data)
{
char *params, *nick, *user, *host, *realname;
@ -639,6 +699,10 @@ void fe_events_numeric_init(void)
signal_add("event 312", (SIGNAL_FUNC) event_whois_server);
signal_add("event 313", (SIGNAL_FUNC) event_whois_oper);
signal_add("event 307", (SIGNAL_FUNC) event_whois_registered);
signal_add("event 310", (SIGNAL_FUNC) event_whois_help);
signal_add("event 379", (SIGNAL_FUNC) event_whois_modes);
signal_add("event 378", (SIGNAL_FUNC) event_whois_realhost);
signal_add("event 320", (SIGNAL_FUNC) event_whois_special);
signal_add("event 314", (SIGNAL_FUNC) event_whowas);
signal_add("event 317", (SIGNAL_FUNC) event_whois_idle);
signal_add("event 318", (SIGNAL_FUNC) event_end_of_whois);
@ -703,6 +767,10 @@ void fe_events_numeric_deinit(void)
signal_remove("event 312", (SIGNAL_FUNC) event_whois_server);
signal_remove("event 313", (SIGNAL_FUNC) event_whois_oper);
signal_remove("event 307", (SIGNAL_FUNC) event_whois_registered);
signal_remove("event 310", (SIGNAL_FUNC) event_whois_help);
signal_remove("event 379", (SIGNAL_FUNC) event_whois_modes);
signal_remove("event 378", (SIGNAL_FUNC) event_whois_realhost);
signal_remove("event 320", (SIGNAL_FUNC) event_whois_special);
signal_remove("event 314", (SIGNAL_FUNC) event_whowas);
signal_remove("event 317", (SIGNAL_FUNC) event_whois_idle);
signal_remove("event 318", (SIGNAL_FUNC) event_end_of_whois);

View File

@ -100,9 +100,14 @@ FORMAT_REC fecommon_irc_formats[] = {
{ "whois_idle_signon", " idle : $1 days $2 hours $3 mins $4 secs {comment signon: $5}", 6, { 0, 1, 1, 1, 1, 0 } },
{ "whois_server", " server : $1 {comment $2}", 3, { 0, 0, 0 } },
{ "whois_oper", " : {hilight IRC operator}", 1, { 0 } },
{ "whois_oper_type", " : {hilight $1}", 2, { 0, 0 } },
{ "whois_registered", " : has registered this nick", 1, { 0 } },
{ "whois_help", " : is available for help", 1, { 0 } },
{ "whois_modes", " modes : $1", 2, { 0, 0 } },
{ "whois_realhost", " hostname : $1", 2, { 0, 0 } },
{ "whois_channels", " channels : $1", 2, { 0, 0 } },
{ "whois_away", " away : $1", 2, { 0, 0 } },
{ "whois_special", " : $1", 2, { 0, 0 } },
{ "end_of_whois", "End of WHOIS", 1, { 0 } },
{ "end_of_whowas", "End of WHOWAS", 1, { 0 } },
{ "whois_not_found", "There is no such nick $0", 1, { 0 } },

View File

@ -75,9 +75,14 @@ enum {
IRCTXT_WHOIS_IDLE_SIGNON,
IRCTXT_WHOIS_SERVER,
IRCTXT_WHOIS_OPER,
IRCTXT_WHOIS_OPER_TYPE,
IRCTXT_WHOIS_REGISTERED,
IRCTXT_WHOIS_HELP,
IRCTXT_WHOIS_MODES,
IRCTXT_WHOIS_REALHOST,
IRCTXT_WHOIS_CHANNELS,
IRCTXT_WHOIS_AWAY,
IRCTXT_WHOIS_SPECIAL,
IRCTXT_END_OF_WHOIS,
IRCTXT_END_OF_WHOWAS,
IRCTXT_WHOIS_NOT_FOUND,