summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS3
-rw-r--r--NEWS5
-rw-r--r--configure.ac2
-rw-r--r--src/core/ignore.c38
-rw-r--r--src/core/ignore.h10
-rw-r--r--src/fe-common/core/command-history.c10
-rw-r--r--src/fe-common/core/fe-ignore.c8
-rw-r--r--src/fe-common/core/window-commands.c4
-rw-r--r--src/fe-text/gui-readline.c15
-rw-r--r--src/irc/core/irc-commands.c202
-rw-r--r--src/irc/flood/autoignore.c2
-rw-r--r--src/irc/proxy/listen.c2
-rw-r--r--src/perl/module.h2
13 files changed, 158 insertions, 145 deletions
diff --git a/AUTHORS b/AUTHORS
index dc8e578c..7ded5017 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -77,7 +77,7 @@ Other patches (grep for "patch" in ChangeLog) by:
Jon Mayo
Johan Kiviniemi
JasonX
- Lukas Mai
+ Lukas Mai (mauke)
Ismael Luceno
Thomas Karpiniec
Svante Kvarnström
@@ -95,6 +95,5 @@ Other patches (grep for "patch" in ChangeLog) by:
Adam-
Robert C Jensen
Paul Johnson
- mauke
KindOne
Fabian Kurz
diff --git a/NEWS b/NEWS
index 6155f7bd..405e8b4c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-v0.8.18-beta1 2015-12-15 The Irssi team <staff@irssi.org>
+v0.8.18-beta2 2016-01-13 The Irssi team <staff@irssi.org>
* Modules will now require to define a
void MODULENAME ## _abicheck(int *version)
method to ensure that they are compiled against the correct Irssi
@@ -9,7 +9,7 @@ v0.8.18-beta1 2015-12-15 The Irssi team <staff@irssi.org>
implement this change if they are using this signal.
* Removing networks will now remove all attached servers and channels
(#45).
- * /proxy command has been renamed to /irssiproxy
+ * The proxy module now has an /irssiproxy command.
* sb_search has been moved to scripts.irssi.org
* WIN32 has been completely removed (it had not been working and is
lacking a maintainer.)
@@ -37,6 +37,7 @@ v0.8.18-beta1 2015-12-15 The Irssi team <staff@irssi.org>
+ Disable SSLv3 due to the POODLE vulnerability.
+ SSL ciphers can now be specified per server.
+ Added SNI support for SSL.
+ - /ignore now respects -pattern on merge (#78).
- irssiproxy (BNC) module now uses correct line endings.
- Fix missing lines on large pastes (FS#905).
- Correctly preserve STATUSMSG prefixes (#291).
diff --git a/configure.ac b/configure.ac
index 92ca04ae..bf39c95f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT(irssi, 0.8.18-beta1)
+AC_INIT(irssi, 0.8.18-beta2)
AC_CONFIG_SRCDIR([src])
AC_CONFIG_AUX_DIR(build-aux)
AC_PREREQ(2.50)
diff --git a/src/core/ignore.c b/src/core/ignore.c
index fd3c8a38..8d5a27c2 100644
--- a/src/core/ignore.c
+++ b/src/core/ignore.c
@@ -186,15 +186,8 @@ int ignore_check(SERVER_REC *server, const char *nick, const char *host,
return ignore_check_replies(chanrec, text, level);
}
-IGNORE_REC *ignore_find(const char *servertag, const char *mask,
- char **channels)
-{
- return ignore_find_noact(servertag, mask, channels, 0);
-}
-
-
-IGNORE_REC *ignore_find_noact(const char *servertag, const char *mask,
- char **channels, int noact)
+IGNORE_REC *ignore_find_full(const char *servertag, const char *mask, const char *pattern,
+ char **channels, const int flags)
{
GSList *tmp;
char **chan;
@@ -216,18 +209,29 @@ IGNORE_REC *ignore_find_noact(const char *servertag, const char *mask,
continue;
}
- if (noact && (rec->level & MSGLEVEL_NO_ACT) == 0)
+ if ((flags & IGNORE_FIND_NOACT) && (rec->level & MSGLEVEL_NO_ACT) == 0)
continue;
- if (!noact && (rec->level & MSGLEVEL_NO_ACT) != 0)
+ if (!(flags & IGNORE_FIND_NOACT) && (rec->level & MSGLEVEL_NO_ACT) != 0)
continue;
if ((rec->mask == NULL && mask != NULL) ||
- (rec->mask != NULL && mask == NULL)) continue;
+ (rec->mask != NULL && mask == NULL))
+ continue;
if (rec->mask != NULL && g_ascii_strcasecmp(rec->mask, mask) != 0)
continue;
+ /* match the pattern too if requested */
+ if (flags & IGNORE_FIND_PATTERN) {
+ if ((rec->pattern == NULL && pattern != NULL) ||
+ (rec->pattern != NULL && pattern == NULL))
+ continue;
+
+ if (rec->pattern != NULL && g_ascii_strcasecmp(rec->pattern, pattern) != 0)
+ continue;
+ }
+
if ((channels == NULL && rec->channels == NULL))
return rec; /* no channels - ok */
@@ -253,6 +257,16 @@ IGNORE_REC *ignore_find_noact(const char *servertag, const char *mask,
return NULL;
}
+IGNORE_REC *ignore_find(const char *servertag, const char *mask, char **channels)
+{
+ return ignore_find_full(servertag, mask, NULL, channels, 0);
+}
+
+IGNORE_REC *ignore_find_noact(const char *servertag, const char *mask, char **channels, int noact)
+{
+ return ignore_find_full(servertag, mask, NULL, channels, IGNORE_FIND_NOACT);
+}
+
static void ignore_set_config(IGNORE_REC *rec)
{
CONFIG_NODE *node;
diff --git a/src/core/ignore.h b/src/core/ignore.h
index 46025d4c..f889740f 100644
--- a/src/core/ignore.h
+++ b/src/core/ignore.h
@@ -31,6 +31,16 @@ extern GSList *ignores;
int ignore_check(SERVER_REC *server, const char *nick, const char *host,
const char *channel, const char *text, int level);
+enum {
+ IGNORE_FIND_PATTERN = 0x01, // Match the pattern
+ IGNORE_FIND_NOACT = 0x02, // Exclude the targets with NOACT level
+};
+
+IGNORE_REC *ignore_find_full (const char *servertag, const char *mask, const char *pattern,
+ char **channels, const int flags);
+
+// Convenience wrappers around ignore_find_full, for compatibility purpose
+
IGNORE_REC *ignore_find(const char *servertag, const char *mask, char **channels);
IGNORE_REC *ignore_find_noact(const char *servertag, const char *mask, char **channels, int noact);
diff --git a/src/fe-common/core/command-history.c b/src/fe-common/core/command-history.c
index 9f46ee99..1060744e 100644
--- a/src/fe-common/core/command-history.c
+++ b/src/fe-common/core/command-history.c
@@ -33,7 +33,6 @@
static HISTORY_REC *global_history;
static int window_history;
static GSList *histories;
-static HISTORY_REC *last_cleared_history;
void command_history_add(HISTORY_REC *history, const char *text)
{
@@ -42,13 +41,6 @@ void command_history_add(HISTORY_REC *history, const char *text)
g_return_if_fail(history != NULL);
g_return_if_fail(text != NULL);
- if (last_cleared_history == history) {
- last_cleared_history = NULL;
- return; /* ignore this history addition, we just
- cleared it */
- }
- last_cleared_history = NULL;
-
link = g_list_last(history->list);
if (link != NULL && g_strcmp0(link->data, text) == 0)
return; /* same as previous entry */
@@ -195,7 +187,6 @@ void command_history_clear(HISTORY_REC *history)
g_list_free(history->list);
history->list = NULL;
history->lines = 0;
- last_cleared_history = history;
}
void command_history_destroy(HISTORY_REC *history)
@@ -207,7 +198,6 @@ void command_history_destroy(HISTORY_REC *history)
histories = g_slist_remove(histories, history);
command_history_clear(history);
- last_cleared_history = NULL; /* was destroyed */
g_free_not_null(history->name);
g_free(history);
diff --git a/src/fe-common/core/fe-ignore.c b/src/fe-common/core/fe-ignore.c
index d2f9de27..a809ac91 100644
--- a/src/fe-common/core/fe-ignore.c
+++ b/src/fe-common/core/fe-ignore.c
@@ -158,8 +158,8 @@ static void cmd_ignore(const char *data)
channels = (chanarg == NULL || *chanarg == '\0') ? NULL :
g_strsplit(chanarg, ",", -1);
- rec = patternarg != NULL ? NULL: ignore_find_noact(servertag, mask, channels,
- (level & MSGLEVEL_NO_ACT));
+ rec = ignore_find_full(servertag, mask, patternarg, channels,
+ IGNORE_FIND_PATTERN | ((level & MSGLEVEL_NO_ACT) ? IGNORE_FIND_NOACT : 0));
new_ignore = rec == NULL;
if (rec == NULL) {
@@ -237,9 +237,9 @@ static void cmd_unignore(const char *data)
chans[0] = mask;
mask = NULL;
}
- rec = ignore_find_noact("*", mask, (char **) chans, 0);
+ rec = ignore_find_full("*", mask, NULL, (char **) chans, 0);
if (rec == NULL) {
- rec = ignore_find_noact("*", mask, (char **) chans, 1);
+ rec = ignore_find_full("*", mask, NULL, (char **) chans, IGNORE_FIND_NOACT);
}
}
diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c
index e5005144..9e4aab3a 100644
--- a/src/fe-common/core/window-commands.c
+++ b/src/fe-common/core/window-commands.c
@@ -620,10 +620,10 @@ static void cmd_window_name(const char *data)
void cmd_window_history(const char *data)
{
GHashTable *optlist;
- char *name;
+ char *name;
void *free_arg;
- if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS,
+ if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS | PARAM_FLAG_STRIP_TRAILING_WS,
"window history", &optlist, &name))
return;
diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c
index fcf152e8..5acfaf60 100644
--- a/src/fe-text/gui-readline.c
+++ b/src/fe-text/gui-readline.c
@@ -456,22 +456,21 @@ static void key_send_line(void)
add_history = *str != '\0';
history = command_history_current(active_win);
+ if (redir != NULL && redir->flags & ENTRY_REDIRECT_FLAG_HIDDEN)
+ add_history = 0;
+
+ if (add_history && history != NULL) {
+ command_history_add(history, str);
+ }
+
if (redir == NULL) {
signal_emit("send command", 3, str,
active_win->active_server,
active_win->active);
} else {
- if (redir->flags & ENTRY_REDIRECT_FLAG_HIDDEN)
- add_history = 0;
handle_entry_redirect(str);
}
- if (add_history) {
- history = command_history_find(history);
- if (history != NULL)
- command_history_add(history, str);
- }
-
if (active_entry != NULL)
gui_entry_set_text(active_entry, "");
command_history_clear_pos(active_win);
diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c
index 3cc105ba..6baf2f6d 100644
--- a/src/irc/core/irc-commands.c
+++ b/src/irc/core/irc-commands.c
@@ -61,16 +61,16 @@ static int knockout_tag;
/* SYNTAX: NOTICE <targets> <message> */
static void cmd_notice(const char *data, IRC_SERVER_REC *server,
- WI_ITEM_REC *item)
+ WI_ITEM_REC *item)
{
const char *target, *msg;
char *recoded;
void *free_arg;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST,
- &target, &msg))
+ &target, &msg))
return;
if (g_strcmp0(target, "*") == 0)
target = item == NULL ? NULL : window_item_get_target(item);
@@ -88,16 +88,16 @@ static void cmd_notice(const char *data, IRC_SERVER_REC *server,
/* SYNTAX: CTCP <targets> <ctcp command> [<ctcp data>] */
static void cmd_ctcp(const char *data, IRC_SERVER_REC *server,
- WI_ITEM_REC *item)
+ WI_ITEM_REC *item)
{
const char *target;
char *ctcpcmd, *ctcpdata;
void *free_arg;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST,
- &target, &ctcpcmd, &ctcpdata))
+ &target, &ctcpcmd, &ctcpdata))
return;
if (g_strcmp0(target, "*") == 0)
target = item == NULL ? NULL : window_item_get_target(item);
@@ -122,16 +122,16 @@ static void cmd_ctcp(const char *data, IRC_SERVER_REC *server,
/* SYNTAX: NCTCP <targets> <ctcp command> [<ctcp data>] */
static void cmd_nctcp(const char *data, IRC_SERVER_REC *server,
- WI_ITEM_REC *item)
+ WI_ITEM_REC *item)
{
const char *target;
char *ctcpcmd, *ctcpdata, *recoded;
void *free_arg;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST,
- &target, &ctcpcmd, &ctcpdata))
+ &target, &ctcpcmd, &ctcpdata))
return;
if (g_strcmp0(target, "*") == 0)
target = item == NULL ? NULL : window_item_get_target(item);
@@ -150,22 +150,22 @@ static void cmd_nctcp(const char *data, IRC_SERVER_REC *server,
/* SYNTAX: PART [<channels>] [<message>] */
static void cmd_part(const char *data, IRC_SERVER_REC *server,
- WI_ITEM_REC *item)
+ WI_ITEM_REC *item)
{
char *channame, *msg;
char *recoded = NULL;
void *free_arg;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST |
- PARAM_FLAG_OPTCHAN, item, &channame, &msg))
+ PARAM_FLAG_OPTCHAN, item, &channame, &msg))
return;
if (*channame == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
if (*msg == '\0') msg = (char *) settings_get_str("part_message");
- if (server->cmdcount > MAX_COMMANDS_ON_PART_UNTIL_PURGE)
+ if (server->cmdcount > MAX_COMMANDS_ON_PART_UNTIL_PURGE)
irc_server_purge_output(server, channame);
if (*msg != '\0')
@@ -186,11 +186,11 @@ static void cmd_kick(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item
char *channame, *nicks, *reason, *recoded;
void *free_arg;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST |
- PARAM_FLAG_OPTCHAN, item,
- &channame, &nicks, &reason))
+ PARAM_FLAG_OPTCHAN, item,
+ &channame, &nicks, &reason))
return;
if (*channame == '\0' || *nicks == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
@@ -213,11 +213,11 @@ static void cmd_topic(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *ite
char *recoded = NULL;
void *free_arg;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTCHAN |
- PARAM_FLAG_OPTIONS | PARAM_FLAG_GETREST,
- item, "topic", &optlist, &channame, &topic))
+ PARAM_FLAG_OPTIONS | PARAM_FLAG_GETREST,
+ item, "topic", &optlist, &channame, &topic))
return;
if (*topic != '\0' || g_hash_table_lookup(optlist, "delete") != NULL)
@@ -239,7 +239,7 @@ static void cmd_invite(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *it
char *nick, *channame;
void *free_arg;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 2, &nick, &channame))
return;
@@ -258,17 +258,17 @@ static void cmd_invite(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *it
/* SYNTAX: LIST [-yes] [<channel>] */
static void cmd_list(const char *data, IRC_SERVER_REC *server,
- WI_ITEM_REC *item)
+ WI_ITEM_REC *item)
{
GHashTable *optlist;
char *str;
void *free_arg;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS |
- PARAM_FLAG_GETREST | PARAM_FLAG_STRIP_TRAILING_WS,
- "list", &optlist, &str))
+ PARAM_FLAG_GETREST | PARAM_FLAG_STRIP_TRAILING_WS,
+ "list", &optlist, &str))
return;
if (*str == '\0' && g_hash_table_lookup(optlist, "yes") == NULL &&
@@ -282,7 +282,7 @@ static void cmd_list(const char *data, IRC_SERVER_REC *server,
/* SYNTAX: WHO [<nicks> | <channels> | **] */
static void cmd_who(const char *data, IRC_SERVER_REC *server,
- WI_ITEM_REC *item)
+ WI_ITEM_REC *item)
{
char *channel, *rest;
void *free_arg;
@@ -290,7 +290,7 @@ static void cmd_who(const char *data, IRC_SERVER_REC *server,
CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST |
- PARAM_FLAG_STRIP_TRAILING_WS, &channel, &rest))
+ PARAM_FLAG_STRIP_TRAILING_WS, &channel, &rest))
return;
if (g_strcmp0(channel, "*") == 0 || *channel == '\0') {
@@ -313,29 +313,29 @@ static void cmd_who(const char *data, IRC_SERVER_REC *server,
}
static void cmd_names(const char *data, IRC_SERVER_REC *server,
- WI_ITEM_REC *item)
+ WI_ITEM_REC *item)
{
- GHashTable *optlist;
+ GHashTable *optlist;
char *channel;
void *free_arg;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS |
- PARAM_FLAG_GETREST | PARAM_FLAG_STRIP_TRAILING_WS,
- "names", &optlist, &channel))
+ PARAM_FLAG_GETREST | PARAM_FLAG_STRIP_TRAILING_WS,
+ "names", &optlist, &channel))
return;
if (g_strcmp0(channel, "*") == 0 || *channel == '\0') {
if (!IS_IRC_CHANNEL(item))
- cmd_param_error(CMDERR_NOT_JOINED);
+ cmd_param_error(CMDERR_NOT_JOINED);
channel = IRC_CHANNEL(item)->name;
}
if (g_strcmp0(channel, "**") == 0) {
/* ** displays all nicks.. */
- irc_send_cmd(server, "NAMES");
+ irc_send_cmd(server, "NAMES");
} else {
irc_send_cmdv(server, "NAMES %s", channel);
}
@@ -346,12 +346,12 @@ static void cmd_names(const char *data, IRC_SERVER_REC *server,
/* SYNTAX: NICK <new nick> */
static void cmd_nick(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
{
- char *nick;
+ char *nick;
void *free_arg;
g_return_if_fail(data != NULL);
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 1, &nick))
return;
@@ -388,23 +388,23 @@ static char *get_redirect_nicklist(const char *nicks, int *free)
/* SYNTAX: WHOIS [-<server tag>] [<server>] [<nicks>] */
static void cmd_whois(const char *data, IRC_SERVER_REC *server,
- WI_ITEM_REC *item)
+ WI_ITEM_REC *item)
{
GHashTable *optlist;
char *qserver, *query, *event_402, *str;
void *free_arg;
int free_nick;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTIONS |
- PARAM_FLAG_UNKNOWN_OPTIONS,
- "whois", &optlist, &qserver, &query))
+ PARAM_FLAG_UNKNOWN_OPTIONS,
+ "whois", &optlist, &qserver, &query))
return;
/* -<server tag> */
server = IRC_SERVER(cmd_options_get_server("whois", optlist,
- SERVER(server)));
+ SERVER(server)));
if (server == NULL) {
cmd_params_free(free_arg);
return;
@@ -439,15 +439,15 @@ static void cmd_whois(const char *data, IRC_SERVER_REC *server,
str = g_strconcat(qserver, " ", query, NULL);
server_redirect_event(server, "whois", 1, str, TRUE,
- NULL,
- "event 318", "whois end",
- "event 402", event_402,
- "event 301", "whois away", /* 301 can come as a reply to /MSG, /WHOIS or /WHOWAS */
- "event 313", "whois oper",
- "event 401", (settings_get_bool("auto_whowas") ? "whois try whowas" : "whois event not found"),
- "event 311", "whois event",
- "", "whois default event", NULL);
- g_free(str);
+ NULL,
+ "event 318", "whois end",
+ "event 402", event_402,
+ "event 301", "whois away", /* 301 can come as a reply to /MSG, /WHOIS or /WHOWAS */
+ "event 313", "whois oper",
+ "event 401", (settings_get_bool("auto_whowas") ? "whois try whowas" : "whois event not found"),
+ "event 311", "whois event",
+ "", "whois default event", NULL);
+ g_free(str);
server->whois_found = FALSE;
irc_send_cmd_split(server, tmpstr->str, 2, server->max_whois_in_cmd);
@@ -457,7 +457,7 @@ static void cmd_whois(const char *data, IRC_SERVER_REC *server,
}
static void event_whois(IRC_SERVER_REC *server, const char *data,
- const char *nick, const char *addr)
+ const char *nick, const char *addr)
{
server->whois_found = TRUE;
signal_emit("event 311", 4, server, data, nick, addr);
@@ -473,23 +473,23 @@ static void sig_whois_try_whowas(IRC_SERVER_REC *server, const char *data)
server->whowas_found = FALSE;
server_redirect_event(server, "whowas", 1, nick, -1, NULL,
- "event 314", "whowas event",
- "event 369", "whowas event end",
- "event 406", "event empty", NULL);
+ "event 314", "whowas event",
+ "event 369", "whowas event end",
+ "event 406", "event empty", NULL);
irc_send_cmdv(server, "WHOWAS %s 1", nick);
g_free(params);
}
static void event_end_of_whois(IRC_SERVER_REC *server, const char *data,
- const char *nick, const char *addr)
+ const char *nick, const char *addr)
{
signal_emit("event 318", 4, server, data, nick, addr);
server->whois_found = FALSE;
}
static void event_whowas(IRC_SERVER_REC *server, const char *data,
- const char *nick, const char *addr)
+ const char *nick, const char *addr)
{
server->whowas_found = TRUE;
signal_emit("event 314", 4, server, data, nick, addr);
@@ -502,17 +502,17 @@ static void cmd_whowas(const char *data, IRC_SERVER_REC *server)
void *free_arg;
int free_nick;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST | PARAM_FLAG_STRIP_TRAILING_WS,
- &nicks, &rest))
+ &nicks, &rest))
return;
if (*nicks == '\0') nicks = server->nick;
nicks_redir = get_redirect_nicklist(nicks, &free_nick);
server_redirect_event(server, "whowas", 1, nicks_redir, -1, NULL,
- "event 301", "whowas away", /* 301 can come as a reply to /MSG, /WHOIS or /WHOWAS */
- "event 314", "whowas event", NULL);
+ "event 301", "whowas away", /* 301 can come as a reply to /MSG, /WHOIS or /WHOWAS */
+ "event 314", "whowas event", NULL);
if (free_nick) g_free(nicks_redir);
server->whowas_found = FALSE;
@@ -529,9 +529,9 @@ static void cmd_whowas(const char *data, IRC_SERVER_REC *server)
static void cmd_ping(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
{
GTimeVal tv;
- char *str;
+ char *str;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (*data == '\0') {
if (!IS_QUERY(item))
@@ -554,7 +554,7 @@ static void cmd_away(const char *data, IRC_SERVER_REC *server)
void *free_arg;
if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS |
- PARAM_FLAG_GETREST, "away", &optlist, &reason)) return;
+ PARAM_FLAG_GETREST, "away", &optlist, &reason)) return;
if (g_hash_table_lookup(optlist, "one") != NULL)
irc_server_send_away(server, reason);
@@ -567,7 +567,7 @@ static void cmd_away(const char *data, IRC_SERVER_REC *server)
/* SYNTAX: SCONNECT <new server> [[<port>] <existing server>] */
static void cmd_sconnect(const char *data, IRC_SERVER_REC *server)
{
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (*data == '\0') cmd_return_error(CMDERR_NOT_ENOUGH_PARAMS);
irc_send_cmdv(server, "CONNECT %s", data);
@@ -600,11 +600,11 @@ static void cmd_wait(const char *data, IRC_SERVER_REC *server)
void *free_arg;
int n;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS |
- PARAM_FLAG_UNKNOWN_OPTIONS | PARAM_FLAG_GETREST,
- NULL, &optlist, &msecs))
+ PARAM_FLAG_UNKNOWN_OPTIONS | PARAM_FLAG_GETREST,
+ NULL, &optlist, &msecs))
return;
if (*msecs == '\0')
@@ -612,7 +612,7 @@ static void cmd_wait(const char *data, IRC_SERVER_REC *server)
/* -<server tag> */
server = IRC_SERVER(cmd_options_get_server(NULL, optlist,
- SERVER(server)));
+ SERVER(server)));
n = atoi(msecs);
if (server != NULL && n > 0) {
@@ -635,10 +635,10 @@ static void cmd_wall(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item
IRC_CHANNEL_REC *chanrec;
GSList *tmp, *nicks;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTCHAN |
- PARAM_FLAG_GETREST, item, &channame, &msg))
+ PARAM_FLAG_GETREST, item, &channame, &msg))
return;
if (*msg == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
@@ -654,11 +654,11 @@ static void cmd_wall(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item
/* Fall back to manually noticing each op */
nicks = NULL;
g_hash_table_foreach(chanrec->nicks,
- (GHFunc) cmd_wall_hash, &nicks);
+ (GHFunc) cmd_wall_hash, &nicks);
args = g_strconcat(chanrec->name, " ", recoded, NULL);
msg = parse_special_string(settings_get_str("wall_format"),
- SERVER(server), item, args, NULL, 0);
+ SERVER(server), item, args, NULL, 0);
g_free(args);
for (tmp = nicks; tmp != NULL; tmp = tmp->next) {
@@ -666,7 +666,7 @@ static void cmd_wall(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item
if (rec != chanrec->ownnick) {
irc_send_cmdv(server, "NOTICE %s :%s",
- rec->nick, msg);
+ rec->nick, msg);
}
}
@@ -680,17 +680,17 @@ static void cmd_wall(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item
/* SYNTAX: KICKBAN [<channel>] <nicks> <reason> */
static void cmd_kickban(const char *data, IRC_SERVER_REC *server,
- WI_ITEM_REC *item)
+ WI_ITEM_REC *item)
{
- IRC_CHANNEL_REC *chanrec;
+ IRC_CHANNEL_REC *chanrec;
char *channel, *nicks, *reason, *kickcmd, *bancmd, *recoded;
- char **nicklist, *spacenicks;
+ char **nicklist, *spacenicks;
void *free_arg;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_OPTCHAN | PARAM_FLAG_GETREST,
- item, &channel, &nicks, &reason))
+ item, &channel, &nicks, &reason))
return;
if (*channel == '\0' || *nicks == '\0')
@@ -701,7 +701,7 @@ static void cmd_kickban(const char *data, IRC_SERVER_REC *server,
cmd_param_error(CMDERR_CHAN_NOT_FOUND);
nicklist = g_strsplit(nicks, ",", -1);
- spacenicks = g_strjoinv(" ", nicklist);
+ spacenicks = g_strjoinv(" ", nicklist);
g_strfreev(nicklist);
recoded = recode_out(SERVER(server), reason, channel);
@@ -709,9 +709,9 @@ static void cmd_kickban(const char *data, IRC_SERVER_REC *server,
g_free(recoded);
bancmd = g_strdup_printf("%s %s", chanrec->name, spacenicks);
- g_free(spacenicks);
+ g_free(spacenicks);
- if (settings_get_bool("kick_first_on_kickban")) {
+ if (settings_get_bool("kick_first_on_kickban")) {
signal_emit("command kick", 3, kickcmd, server, chanrec);
signal_emit("command ban", 3, bancmd, server, chanrec);
} else {
@@ -742,14 +742,14 @@ static void knockout_timeout_server(IRC_SERVER_REC *server)
if (!IS_IRC_SERVER(server))
return;
- now = time(NULL);
+ now = time(NULL);
for (tmp = server->knockoutlist; tmp != NULL; tmp = next) {
KNOCKOUT_REC *rec = tmp->data;
next = tmp->next;
if (rec->unban_time <= now) {
/* timeout, unban. */
- ban_remove(rec->channel, rec->ban);
+ signal_emit("command unban", 3, rec->ban, server, rec->channel);
knockout_destroy(server, rec);
}
}
@@ -763,16 +763,16 @@ static int knockout_timeout(void)
/* SYNTAX: KNOCKOUT [<time>] <nicks> <reason> */
static void cmd_knockout(const char *data, IRC_SERVER_REC *server,
- IRC_CHANNEL_REC *channel)
+ IRC_CHANNEL_REC *channel)
{
KNOCKOUT_REC *rec;
char *nicks, *reason, *timeoutstr, *kickcmd, *bancmd, *recoded;
- char **nicklist, *spacenicks, *banmasks;
+ char **nicklist, *spacenicks, *banmasks;
void *free_arg;
int timeleft;
GSList *ptr;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!IS_IRC_CHANNEL(channel))
cmd_return_error(CMDERR_NOT_JOINED);
@@ -780,14 +780,14 @@ static void cmd_knockout(const char *data, IRC_SERVER_REC *server,
if (i_isdigit(*data)) {
/* first argument is the timeout */
if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST,
- &timeoutstr, &nicks, &reason))
+ &timeoutstr, &nicks, &reason))
return;
if (!parse_time_interval(timeoutstr, &timeleft))
cmd_param_error(CMDERR_INVALID_TIME);
} else {
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST,
- &nicks, &reason))
+ &nicks, &reason))
return;
timeleft = settings_get_time("knockout_time");
}
@@ -795,7 +795,7 @@ static void cmd_knockout(const char *data, IRC_SERVER_REC *server,
if (*nicks == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
nicklist = g_strsplit(nicks, ",", -1);
- spacenicks = g_strjoinv(" ", nicklist);
+ spacenicks = g_strjoinv(" ", nicklist);
g_strfreev(nicklist);
banmasks = ban_get_masks(channel, spacenicks, 0);
@@ -808,7 +808,7 @@ static void cmd_knockout(const char *data, IRC_SERVER_REC *server,
bancmd = *banmasks == '\0'? NULL :
g_strdup_printf("%s %s", channel->name, banmasks);
- if (settings_get_bool("kick_first_on_kickban")) {
+ if (settings_get_bool("kick_first_on_kickban")) {
signal_emit("command kick", 3, kickcmd, server, channel);
if (bancmd != NULL)
signal_emit("command ban", 3, bancmd, server, channel);
@@ -827,7 +827,7 @@ static void cmd_knockout(const char *data, IRC_SERVER_REC *server,
for (ptr = server->knockoutlist; ptr != NULL; ptr = ptr->next) {
rec = ptr->data;
if (channel == rec->channel &&
- !g_strcmp0(rec->ban, banmasks))
+ !g_strcmp0(rec->ban, banmasks))
break;
}
if (ptr == NULL) {
@@ -845,10 +845,10 @@ static void cmd_knockout(const char *data, IRC_SERVER_REC *server,
/* SYNTAX: SERVER PURGE [<target>] */
static void cmd_server_purge(const char *data, IRC_SERVER_REC *server)
{
- char *target;
+ char *target;
void *free_arg;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 1, &target))
return;
@@ -895,12 +895,12 @@ static void cmd_oper(const char *data, IRC_SERVER_REC *server)
char *nick, *password;
void *free_arg;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
- /* asking for password is handled by fe-common */
+ /* asking for password is handled by fe-common */
if (!cmd_get_params(data, &free_arg, 2, &nick, &password))
return;
- if (*password == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
+ if (*password == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
irc_send_cmdv(server, "OPER %s %s", nick, password);
cmd_params_free(free_arg);
@@ -909,7 +909,7 @@ static void cmd_oper(const char *data, IRC_SERVER_REC *server)
/* SYNTAX: ACCEPT [[-]nick,...] */
static void cmd_accept(const char *data, IRC_SERVER_REC *server)
{
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (*data == '\0')
irc_send_cmd(server, "ACCEPT *");
@@ -920,7 +920,7 @@ static void cmd_accept(const char *data, IRC_SERVER_REC *server)
/* SYNTAX: UNSILENCE <nick!user@host> */
static void cmd_unsilence(const char *data, IRC_SERVER_REC *server)
{
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (*data == '\0')
cmd_return_error(CMDERR_NOT_ENOUGH_PARAMS);
@@ -953,7 +953,7 @@ static void command_2self(const char *data, IRC_SERVER_REC *server)
char *target, *text;
void *free_arg;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST, &target, &text))
return;
@@ -998,8 +998,8 @@ void irc_commands_init(void)
command_bind_irc("admin", NULL, (SIGNAL_FUNC) command_self);
/* SYNTAX: INFO [<server>] */
command_bind_irc("info", NULL, (SIGNAL_FUNC) command_self);
- /* SYNTAX: KNOCK <channel> */
- command_bind_irc("knock", NULL, (SIGNAL_FUNC) command_self);
+ /* SYNTAX: KNOCK <channel> */
+ command_bind_irc("knock", NULL, (SIGNAL_FUNC) command_self);
/* SYNTAX: LINKS [[<server>] <mask>] */
command_bind_irc("links", NULL, (SIGNAL_FUNC) command_self);
/* SYNTAX: LUSERS [<server mask> [<remote server>]] */
@@ -1081,7 +1081,7 @@ void irc_commands_deinit(void)
command_unbind("accept", (SIGNAL_FUNC) cmd_accept);
command_unbind("admin", (SIGNAL_FUNC) command_self);
command_unbind("info", (SIGNAL_FUNC) command_self);
- command_unbind("knock", (SIGNAL_FUNC) command_self);
+ command_unbind("knock", (SIGNAL_FUNC) command_self);
command_unbind("links", (SIGNAL_FUNC) command_self);
command_unbind("lusers", (SIGNAL_FUNC) command_self);
command_unbind("map", (SIGNAL_FUNC) command_self);
diff --git a/src/irc/flood/autoignore.c b/src/irc/flood/autoignore.c
index 250a1fe8..86ff3ec5 100644
--- a/src/irc/flood/autoignore.c
+++ b/src/irc/flood/autoignore.c
@@ -66,7 +66,7 @@ static void sig_flood(IRC_SERVER_REC *server, const char *nick, const char *host
mask = g_strdup_printf("%s!%s", nick, host);
if (level & check_level) {
- rec = ignore_find(server->tag, mask, NULL);
+ rec = ignore_find_full(server->tag, mask, NULL, NULL, 0);
if (rec == NULL)
autoignore_add(server, mask, level);
else
diff --git a/src/irc/proxy/listen.c b/src/irc/proxy/listen.c
index dcc94e6b..5dc9a704 100644
--- a/src/irc/proxy/listen.c
+++ b/src/irc/proxy/listen.c
@@ -681,8 +681,8 @@ static void read_settings(void)
while (add_listens != NULL) {
rec = add_listens->data;
add_listen(rec->ircnet, rec->port);
+ add_listens = g_slist_remove(add_listens, rec);
g_free(rec);
- add_listens = g_slist_remove(add_listens, add_listens->data);
}
g_strfreev(ports);
diff --git a/src/perl/module.h b/src/perl/module.h
index 2fd15137..3cbdf3d5 100644
--- a/src/perl/module.h
+++ b/src/perl/module.h
@@ -17,4 +17,4 @@ extern PerlInterpreter *my_perl; /* must be called my_perl or some perl implemen
/* Change this every time when some API changes between irssi's perl module
(or irssi itself) and irssi's perl libraries. */
-#define IRSSI_PERL_API_VERSION 20011214
+#define IRSSI_PERL_API_VERSION (20011214 + IRSSI_ABI_VERSION)