From 78dad04c7b21342c9b6dddc7ea9f1b34f61e6984 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Wed, 31 Oct 2007 22:58:44 +0000 Subject: [PATCH] Remove /notify -idle, it can only work with not-nice automated remote whois. (causes infrequent "server load too heavy" etc) If people really want this, they should write a script. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4632 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- docs/help/in/notify.in | 2 -- docs/manual.txt | 4 +-- src/fe-common/irc/notifylist/fe-notifylist.c | 23 ++------------ src/irc/notifylist/module.h | 3 -- src/irc/notifylist/notify-commands.c | 21 +++---------- src/irc/notifylist/notify-ison.c | 6 ++-- src/irc/notifylist/notify-setup.c | 6 ---- src/irc/notifylist/notify-whois.c | 33 -------------------- src/irc/notifylist/notifylist.c | 25 ++------------- src/irc/notifylist/notifylist.h | 5 +-- src/perl/irc/Notifylist.xs | 6 ++++ 11 files changed, 19 insertions(+), 115 deletions(-) diff --git a/docs/help/in/notify.in b/docs/help/in/notify.in index 5f278e0c..5f56bf4d 100644 --- a/docs/help/in/notify.in +++ b/docs/help/in/notify.in @@ -2,8 +2,6 @@ @SYNTAX:notify@ -away: Notifies about away-status changes - -idle: Notifies if idle time is first larger than - (default is hour) and then it drops down. -list: Lists the notify list entries with all their settings : Either a simple "nick" or "nick!*@*blah.org". The nick can't contain wildcards, but the user/host can. diff --git a/docs/manual.txt b/docs/manual.txt index 3bf39482..8a7532d5 100644 --- a/docs/manual.txt +++ b/docs/manual.txt @@ -828,11 +828,9 @@ are in IRC all the time. So I made a bit more featureful notify list: - /NOTIFY [-list] [-away] [-idle [minutes]] [network [network...]] + /NOTIFY [-list] [-away] [network [network...]] -away: Notifies about away-status changes - -idle: Notifies if idle time is first larger than - (default is hour) and then it drops down. -list: Lists the notify list entries with all their settings : Either a simple "nick" or "nick!*@*blah.org". The nick can't contain wildcards, but the user/host can. diff --git a/src/fe-common/irc/notifylist/fe-notifylist.c b/src/fe-common/irc/notifylist/fe-notifylist.c index ee5c4028..35bed36d 100644 --- a/src/fe-common/irc/notifylist/fe-notifylist.c +++ b/src/fe-common/irc/notifylist/fe-notifylist.c @@ -148,19 +148,14 @@ static void cmd_notify_show(void) static void notifylist_print(NOTIFYLIST_REC *rec) { - char idle[10+MAX_INT_STRLEN], *ircnets; - - if (rec->idle_check_time <= 0) - idle[0] = '\0'; - else - g_snprintf(idle, sizeof(idle), "-idle %d", rec->idle_check_time/60); + char *ircnets; ircnets = rec->ircnets == NULL ? NULL : g_strjoinv(",", rec->ircnets); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_NOTIFY_LIST, rec->mask, ircnets != NULL ? ircnets : "", - rec->away_check ? "-away" : "", idle); + rec->away_check ? "-away" : ""); g_free_not_null(ircnets); } @@ -227,18 +222,6 @@ static void notifylist_away(IRC_SERVER_REC *server, const char *nick, } } -static void notifylist_unidle(IRC_SERVER_REC *server, const char *nick, - const char *username, const char *host, - const char *realname, const char *awaymsg) -{ - g_return_if_fail(nick != NULL); - - printformat(server, nick, MSGLEVEL_CLIENTNOTICE, - IRCTXT_NOTIFY_UNIDLE, nick, username, host, realname, - awaymsg != NULL ? awaymsg : "", - server->connrec->chatnet == NULL ? "IRC" : server->connrec->chatnet); -} - void fe_irc_notifylist_init(void) { theme_register(fecommon_irc_notifylist_formats); @@ -247,7 +230,6 @@ void fe_irc_notifylist_init(void) signal_add("notifylist joined", (SIGNAL_FUNC) notifylist_joined); signal_add("notifylist left", (SIGNAL_FUNC) notifylist_left); signal_add("notifylist away changed", (SIGNAL_FUNC) notifylist_away); - signal_add("notifylist unidle", (SIGNAL_FUNC) notifylist_unidle); command_set_options("notify", "list"); @@ -263,5 +245,4 @@ void fe_irc_notifylist_deinit(void) signal_remove("notifylist joined", (SIGNAL_FUNC) notifylist_joined); signal_remove("notifylist left", (SIGNAL_FUNC) notifylist_left); signal_remove("notifylist away changed", (SIGNAL_FUNC) notifylist_away); - signal_remove("notifylist unidle", (SIGNAL_FUNC) notifylist_unidle); } diff --git a/src/irc/notifylist/module.h b/src/irc/notifylist/module.h index d88058e4..c7239a88 100644 --- a/src/irc/notifylist/module.h +++ b/src/irc/notifylist/module.h @@ -6,15 +6,12 @@ typedef struct { char *nick; char *user, *host, *realname, *awaymsg; - int idle_time; unsigned int host_ok:1; /* host matches the one in notifylist = this is the right person*/ unsigned int away_ok:1; /* not away, or we don't care about it */ - unsigned int idle_ok:1; /* idle time is low enough, or we don't care about it */ unsigned int away:1; /* nick is away */ unsigned int join_announced:1; /* join to IRC has been announced */ - unsigned int idle_changed:1; /* idle time is lower than in last check */ time_t last_whois; } NOTIFY_NICK_REC; diff --git a/src/irc/notifylist/notify-commands.c b/src/irc/notifylist/notify-commands.c index b8fdc4a6..67076106 100644 --- a/src/irc/notifylist/notify-commands.c +++ b/src/irc/notifylist/notify-commands.c @@ -26,13 +26,13 @@ #include "notifylist.h" -/* SYNTAX: NOTIFY [-away] [-idle [