summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorNei <ailin.nemui@gmail.com>2017-01-02 17:03:31 +0000
committerailin-nemui <ailin-nemui@users.noreply.github.com>2017-01-03 13:30:39 +0100
commit7a112e021724af582a06eed8f92fafb772438c13 (patch)
tree733934527ce98cb4c9ecdd7fb20001650fabcd53 /src/irc
parent1b99299ed2af2ae459edbeb96f2a7b7886cc22c9 (diff)
parent01163710e71318c6c2fd3f797f6b878f92b7f97b (diff)
downloadirssi-7a112e021724af582a06eed8f92fafb772438c13.zip
Merge branch 'master' into 'security'
Sync to master See merge request !6
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/core/irc-queries.c16
-rw-r--r--src/irc/core/irc-servers.h1
-rw-r--r--src/irc/core/sasl.c7
3 files changed, 8 insertions, 16 deletions
diff --git a/src/irc/core/irc-queries.c b/src/irc/core/irc-queries.c
index 77a5289d..64995ead 100644
--- a/src/irc/core/irc-queries.c
+++ b/src/irc/core/irc-queries.c
@@ -81,20 +81,6 @@ static void check_query_changes(IRC_SERVER_REC *server, const char *nick,
}
}
-static void event_privmsg(IRC_SERVER_REC *server, const char *data,
- const char *nick, const char *address)
-{
- char *params, *target, *msg;
-
- g_return_if_fail(data != NULL);
- if (nick == NULL)
- return;
-
- params = event_get_params(data, 2 | PARAM_FLAG_GETREST, &target, &msg);
- check_query_changes(server, nick, address, target);
- g_free(params);
-}
-
static void ctcp_action(IRC_SERVER_REC *server, const char *msg,
const char *nick, const char *address,
const char *target)
@@ -119,14 +105,12 @@ static void event_nick(SERVER_REC *server, const char *data,
void irc_queries_init(void)
{
- signal_add_last("event privmsg", (SIGNAL_FUNC) event_privmsg);
signal_add_last("ctcp action", (SIGNAL_FUNC) ctcp_action);
signal_add("event nick", (SIGNAL_FUNC) event_nick);
}
void irc_queries_deinit(void)
{
- signal_remove("event privmsg", (SIGNAL_FUNC) event_privmsg);
signal_remove("ctcp action", (SIGNAL_FUNC) ctcp_action);
signal_remove("event nick", (SIGNAL_FUNC) event_nick);
}
diff --git a/src/irc/core/irc-servers.h b/src/irc/core/irc-servers.h
index bb100f86..09f3f81d 100644
--- a/src/irc/core/irc-servers.h
+++ b/src/irc/core/irc-servers.h
@@ -68,6 +68,7 @@ struct _IRC_SERVER_REC {
unsigned int motd_got:1; /* We've received MOTD */
unsigned int isupport_sent:1; /* Server has sent us an isupport reply */
unsigned int cap_complete:1; /* We've done the initial CAP negotiation */
+ unsigned int sasl_success:1; /* Did we authenticate successfully ? */
int max_kicks_in_cmd; /* max. number of people to kick with one /KICK command */
int max_modes_in_cmd; /* max. number of mode changes in one /MODE command */
diff --git a/src/irc/core/sasl.c b/src/irc/core/sasl.c
index a1c16cdd..1021bea4 100644
--- a/src/irc/core/sasl.c
+++ b/src/irc/core/sasl.c
@@ -48,6 +48,7 @@ static gboolean sasl_timeout(IRC_SERVER_REC *server)
cap_finish_negotiation(server);
server->sasl_timeout = 0;
+ server->sasl_success = FALSE;
signal_emit("server sasl failure", 2, server, "The authentication timed out");
@@ -84,6 +85,8 @@ static void sasl_fail(IRC_SERVER_REC *server, const char *data, const char *from
params = event_get_params(data, 2, NULL, &error);
+ server->sasl_success = FALSE;
+
signal_emit("server sasl failure", 2, server, error);
/* Terminate the negotiation */
@@ -99,6 +102,8 @@ static void sasl_already(IRC_SERVER_REC *server, const char *data, const char *f
server->sasl_timeout = 0;
}
+ server->sasl_success = TRUE;
+
signal_emit("server sasl success", 1, server);
/* We're already authenticated, do nothing */
@@ -112,6 +117,8 @@ static void sasl_success(IRC_SERVER_REC *server, const char *data, const char *f
server->sasl_timeout = 0;
}
+ server->sasl_success = TRUE;
+
signal_emit("server sasl success", 1, server);
/* The authentication succeeded, time to finish the CAP negotiation */