summaryrefslogtreecommitdiff
path: root/src/irc/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/irc/core')
-rw-r--r--src/irc/core/servers-redirect.c11
-rw-r--r--src/irc/core/servers-redirect.h7
2 files changed, 13 insertions, 5 deletions
diff --git a/src/irc/core/servers-redirect.c b/src/irc/core/servers-redirect.c
index 6f1ec454..b4e6b433 100644
--- a/src/irc/core/servers-redirect.c
+++ b/src/irc/core/servers-redirect.c
@@ -507,6 +507,7 @@ server_redirect_get(IRC_SERVER_REC *server, const char *event,
if (strncmp(event, "event ", 6) == 0 &&
isdigit(event[6])) {
signal = (*redirect)->default_signal;
+ *match = MATCH_START;
} else {
/* not a numeric, so we've lost the
stop event.. */
@@ -554,12 +555,16 @@ const char *server_redirect_get_signal(IRC_SERVER_REC *server,
const char *server_redirect_peek_signal(IRC_SERVER_REC *server,
const char *event,
- const char *args)
+ const char *args,
+ int *redirected)
{
- REDIRECT_REC *redirect;
+ REDIRECT_REC *redirect;
+ const char *signal;
int match;
- return server_redirect_get(server, event, args, &redirect, &match);
+ signal = server_redirect_get(server, event, args, &redirect, &match);
+ *redirected = match != MATCH_NONE;
+ return signal;
}
static void sig_disconnected(IRC_SERVER_REC *server)
diff --git a/src/irc/core/servers-redirect.h b/src/irc/core/servers-redirect.h
index d477fe93..c9be1613 100644
--- a/src/irc/core/servers-redirect.h
+++ b/src/irc/core/servers-redirect.h
@@ -68,10 +68,13 @@ const char *server_redirect_get_signal(IRC_SERVER_REC *server,
const char *args);
/* Returns the redirection signal for specified event.
Doesn't change the server state in any way, so if you really wish to
- use the signal, call server_redirect_get_signal() after this. */
+ use the signal, call server_redirect_get_signal() after this.
+ `redirected' is set to TRUE, if this event belongs to redirection even
+ while there might be no redirection signal. */
const char *server_redirect_peek_signal(IRC_SERVER_REC *server,
const char *event,
- const char *args);
+ const char *args,
+ int *redirected);
/* Destroy redirection record */
void server_redirect_destroy(REDIRECT_REC *rec);