summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-12-07 19:40:37 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-12-07 19:40:37 +0000
commit3f275ebd55c1c26935849787839c73ee0535a359 (patch)
tree60574af0ef9e2f7fd37aca74d2df34cd3779989c /src/fe-common
parentfe8971ac8f9e841e2e33e2532c029eddda589774 (diff)
downloadirssi-3f275ebd55c1c26935849787839c73ee0535a359.zip
Added support for 326 and 327 whois numerics in OPN.
Removed keeping track of ban exceptions and invite list. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2212 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/irc/fe-events-numeric.c21
-rw-r--r--src/fe-common/irc/fe-irc-commands.c46
-rw-r--r--src/fe-common/irc/module-formats.c2
3 files changed, 21 insertions, 48 deletions
diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c
index bda9004b..90514138 100644
--- a/src/fe-common/irc/fe-events-numeric.c
+++ b/src/fe-common/irc/fe-events-numeric.c
@@ -455,7 +455,7 @@ static void event_whois_realhost(IRC_SERVER_REC *server, const char *data)
if (hostname != NULL) {
printformat(server, nick, MSGLEVEL_CRAP,
- IRCTXT_WHOIS_REALHOST, nick, hostname);
+ IRCTXT_WHOIS_REALHOST, nick, hostname, "");
} else {
/* OPN's dancer uses for end of /MAP */
g_free(params);
@@ -465,6 +465,19 @@ static void event_whois_realhost(IRC_SERVER_REC *server, const char *data)
g_free(params);
}
+static void event_whois_usermode326(IRC_SERVER_REC *server, const char *data)
+{
+ char *params, *nick, *usermode;
+
+ g_return_if_fail(data != NULL);
+
+ /* <yournick> <nick> :has oper privs: <mode> */
+ params = event_get_params(data, 3, NULL, &nick, &usermode);
+ printformat(server, nick, MSGLEVEL_CRAP,
+ IRCTXT_WHOIS_USERMODE, nick, usermode);
+ g_free(params);
+}
+
static void event_whois_realhost327(IRC_SERVER_REC *server, const char *data)
{
char *params, *nick, *hostname, *ip, *text;
@@ -480,7 +493,7 @@ static void event_whois_realhost327(IRC_SERVER_REC *server, const char *data)
printtext(server, NULL, MSGLEVEL_CRAP, "%s", text);
} else {
printformat(server, nick, MSGLEVEL_CRAP,
- IRCTXT_WHOIS_REALHOST, nick, hostname);
+ IRCTXT_WHOIS_REALHOST, nick, hostname, ip);
}
g_free(params);
}
@@ -813,6 +826,8 @@ void fe_events_numeric_init(void)
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 326", (SIGNAL_FUNC) event_whois_usermode326);
+ signal_add("event 327", (SIGNAL_FUNC) event_whois_realhost327);
signal_add("event 379", (SIGNAL_FUNC) event_whois_modes);
signal_add("event 378", (SIGNAL_FUNC) event_whois_realhost);
signal_add("event 377", (SIGNAL_FUNC) event_whois_usermode);
@@ -891,6 +906,8 @@ void fe_events_numeric_deinit(void)
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 326", (SIGNAL_FUNC) event_whois_usermode326);
+ signal_remove("event 327", (SIGNAL_FUNC) event_whois_realhost327);
signal_remove("event 379", (SIGNAL_FUNC) event_whois_modes);
signal_remove("event 378", (SIGNAL_FUNC) event_whois_realhost);
signal_remove("event 377", (SIGNAL_FUNC) event_whois_usermode);
diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c
index 2c94c76d..cc8f8a65 100644
--- a/src/fe-common/irc/fe-irc-commands.c
+++ b/src/fe-common/irc/fe-irc-commands.c
@@ -227,7 +227,7 @@ static void bans_show_channel(IRC_CHANNEL_REC *channel, IRC_SERVER_REC *server)
if (!channel->synced)
cmd_return_error(CMDERR_CHAN_NOT_SYNCED);
- if (channel->banlist == NULL && channel->ebanlist == NULL) {
+ if (channel->banlist == NULL) {
printformat(server, channel->name, MSGLEVEL_CLIENTNOTICE,
IRCTXT_NO_BANS, channel->name);
return;
@@ -245,17 +245,6 @@ static void bans_show_channel(IRC_CHANNEL_REC *channel, IRC_SERVER_REC *server)
(int) (time(NULL)-rec->time));
counter++;
}
-
- /* ..and show ban exceptions.. */
- for (tmp = channel->ebanlist; tmp != NULL; tmp = tmp->next) {
- BAN_REC *rec = tmp->data;
-
- printformat(server, channel->name, MSGLEVEL_CRAP,
- (rec->setby == NULL || *rec->setby == '\0') ?
- IRCTXT_EBANLIST : IRCTXT_EBANLIST_LONG,
- channel->name, rec->ban, rec->setby,
- (int) (time(NULL)-rec->time));
- }
}
/* SYNTAX: BAN [<channel>] [<nicks>] */
@@ -300,37 +289,6 @@ static void cmd_ban(const char *data, IRC_SERVER_REC *server,
}
/* SYNTAX: INVITELIST [<channel>] */
-static void cmd_invitelist(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
-{
- IRC_CHANNEL_REC *channel, *cur_channel;
- GSList *tmp;
-
- CMD_IRC_SERVER(server);
-
- cur_channel = IRC_CHANNEL(item);
- if (cur_channel == NULL) cmd_return_error(CMDERR_NOT_JOINED);
-
- if (strcmp(data, "*") == 0 || *data == '\0')
- channel = cur_channel;
- else
- channel = irc_channel_find(server, data);
- if (channel == NULL) cmd_return_error(CMDERR_CHAN_NOT_FOUND);
-
- if (!channel->synced)
- cmd_return_error(CMDERR_CHAN_NOT_SYNCED);
-
- if (channel->invitelist == NULL) {
- printformat(server, channel->name, MSGLEVEL_CLIENTNOTICE,
- IRCTXT_NO_INVITELIST, channel->name);
- } else {
- for (tmp = channel->invitelist; tmp != NULL; tmp = tmp->next) {
- printformat(server, channel->name, MSGLEVEL_CRAP,
- IRCTXT_INVITELIST,
- channel->name, tmp->data);
- }
- }
-}
-
/* SYNTAX: VER [<target>] */
static void cmd_ver(gchar *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
{
@@ -464,7 +422,6 @@ void fe_irc_commands_init(void)
command_bind_irc("wall", NULL, (SIGNAL_FUNC) cmd_wall);
command_bind_irc("wallchops", NULL, (SIGNAL_FUNC) cmd_wallchops);
command_bind_irc("ban", NULL, (SIGNAL_FUNC) cmd_ban);
- command_bind_irc("invitelist", NULL, (SIGNAL_FUNC) cmd_invitelist);
command_bind_irc("ver", NULL, (SIGNAL_FUNC) cmd_ver);
command_bind_irc("topic", NULL, (SIGNAL_FUNC) cmd_topic);
command_bind_irc("ts", NULL, (SIGNAL_FUNC) cmd_ts);
@@ -482,7 +439,6 @@ void fe_irc_commands_deinit(void)
command_unbind("wall", (SIGNAL_FUNC) cmd_wall);
command_unbind("wallchops", (SIGNAL_FUNC) cmd_wallchops);
command_unbind("ban", (SIGNAL_FUNC) cmd_ban);
- command_unbind("invitelist", (SIGNAL_FUNC) cmd_invitelist);
command_unbind("ver", (SIGNAL_FUNC) cmd_ver);
command_unbind("topic", (SIGNAL_FUNC) cmd_topic);
command_unbind("ts", (SIGNAL_FUNC) cmd_ts);
diff --git a/src/fe-common/irc/module-formats.c b/src/fe-common/irc/module-formats.c
index 9685afc5..452f18d6 100644
--- a/src/fe-common/irc/module-formats.c
+++ b/src/fe-common/irc/module-formats.c
@@ -102,7 +102,7 @@ FORMAT_REC fecommon_irc_formats[] = {
{ "whois_registered", "{whois has registered this nick}", 1, { 0 } },
{ "whois_help", "{whois is available for help}", 1, { 0 } },
{ "whois_modes", " {whois modes $1}", 2, { 0, 0 } },
- { "whois_realhost", "{whois hostname $1}", 2, { 0, 0 } },
+ { "whois_realhost", "{whois hostname $1-}", 3, { 0, 0, 0 } },
{ "whois_usermode", "{whois usermode $1}", 2, { 0, 0 } },
{ "whois_channels", "{whois channels %|$1}", 2, { 0, 0 } },
{ "whois_away", "{whois away %|$1}", 2, { 0, 0 } },