mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 12:53:42 +02:00
Autoignore fixes by fuchs (not tested, hope it works ;)
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1281 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
a2a6c7e293
commit
fc17069cec
8 changed files with 125 additions and 313 deletions
|
|
@ -24,38 +24,38 @@
|
|||
#include "levels.h"
|
||||
|
||||
#include "irc-servers.h"
|
||||
#include "ignore.h"
|
||||
#include "irc/flood/autoignore.h"
|
||||
|
||||
#include "themes.h"
|
||||
#include "printtext.h"
|
||||
|
||||
static void event_autoignore_new(IRC_SERVER_REC *server, AUTOIGNORE_REC *ignore)
|
||||
static void event_autoignore_new(IGNORE_REC *rec)
|
||||
{
|
||||
g_return_if_fail(ignore != NULL);
|
||||
g_return_if_fail(rec != NULL);
|
||||
|
||||
printformat(server_find_tag(rec->servertag), NULL, MSGLEVEL_CLIENTNOTICE,
|
||||
IRCTXT_AUTOIGNORE, rec->mask, rec->time);
|
||||
}
|
||||
|
||||
printformat(server, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_AUTOIGNORE,
|
||||
ignore->nick, (ignore->timeleft+59)/60);
|
||||
}
|
||||
|
||||
static void event_autoignore_remove(IRC_SERVER_REC *server, AUTOIGNORE_REC *ignore)
|
||||
static void event_autoignore_destroyed(IGNORE_REC *rec)
|
||||
{
|
||||
g_return_if_fail(ignore != NULL);
|
||||
|
||||
printformat(server, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_AUTOUNIGNORE, ignore->nick);
|
||||
}
|
||||
|
||||
g_return_if_fail(rec != NULL);
|
||||
|
||||
printformat(server_find_tag(rec->servertag), NULL, MSGLEVEL_CLIENTNOTICE,
|
||||
IRCTXT_AUTOUNIGNORE, rec->mask, rec->time);
|
||||
}
|
||||
void fe_irc_flood_init(void)
|
||||
{
|
||||
signal_add("autoignore new", (SIGNAL_FUNC) event_autoignore_new);
|
||||
signal_add("autoignore remove", (SIGNAL_FUNC) event_autoignore_remove);
|
||||
signal_add("autoignore new", (SIGNAL_FUNC) event_autoignore_new);
|
||||
signal_add("autoignore destroyed", (SIGNAL_FUNC) event_autoignore_destroyed);
|
||||
|
||||
theme_register(fecommon_irc_flood_formats);
|
||||
theme_register(fecommon_irc_flood_formats);
|
||||
}
|
||||
|
||||
void fe_irc_flood_deinit(void)
|
||||
{
|
||||
theme_unregister();
|
||||
|
||||
signal_remove("autoignore new", (SIGNAL_FUNC) event_autoignore_new);
|
||||
signal_remove("autoignore remove", (SIGNAL_FUNC) event_autoignore_remove);
|
||||
signal_remove("autoignore destroyed", (SIGNAL_FUNC) event_autoignore_destroyed);
|
||||
theme_unregister();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ FORMAT_REC fecommon_irc_flood_formats[] =
|
|||
/* ---- */
|
||||
{ NULL, "Autoignore", 0 },
|
||||
|
||||
{ "autoignore", "Flood detected from {nick $0}, autoignoring for {hilight $1} minutes", 2, { 0, 1 } },
|
||||
{ "autoignore", "Flood detected from {nick $0}, autoignoring for {hilight $1} seconds", 2, { 0, 1 } },
|
||||
{ "autounignore", "Removed autoignore from {nick $0}", 1, { 0 } },
|
||||
|
||||
{ NULL, NULL, 0 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue