Coverage Report

Created: 2025-07-11 07:30

/src/irssi/src/fe-common/irc/fe-sasl.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
    fe-sasl.c : irssi
3
4
    Copyright (C) 2015-2017 The Lemon Man
5
6
    This program is free software; you can redistribute it and/or modify
7
    it under the terms of the GNU General Public License as published by
8
    the Free Software Foundation; either version 2 of the License, or
9
    (at your option) any later version.
10
11
    This program is distributed in the hope that it will be useful,
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
    GNU General Public License for more details.
15
16
    You should have received a copy of the GNU General Public License along
17
    with this program; if not, write to the Free Software Foundation, Inc.,
18
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
*/
20
21
#include "module.h"
22
#include <irssi/src/fe-common/irc/module-formats.h>
23
#include <irssi/src/core/signals.h>
24
#include <irssi/src/core/levels.h>
25
#include <irssi/src/core/misc.h>
26
#include <irssi/src/irc/core/sasl.h>
27
28
#include <irssi/src/irc/core/irc-servers.h>
29
#include <irssi/src/core/settings.h>
30
31
#include <irssi/src/fe-common/core/printtext.h>
32
33
static void sig_sasl_success(IRC_SERVER_REC *server)
34
12.2k
{
35
12.2k
  printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_SASL_SUCCESS);
36
12.2k
}
37
38
static void sig_sasl_failure(IRC_SERVER_REC *server, const char *reason)
39
2.68k
{
40
2.68k
  printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_SASL_ERROR, reason);
41
2.68k
}
42
43
void fe_sasl_init(void)
44
2
{
45
2
  signal_add("server sasl success", (SIGNAL_FUNC) sig_sasl_success);
46
2
  signal_add("server sasl failure", (SIGNAL_FUNC) sig_sasl_failure);
47
2
}
48
49
void fe_sasl_deinit(void)
50
0
{
51
0
  signal_remove("server sasl success", (SIGNAL_FUNC) sig_sasl_success);
52
0
  signal_remove("server sasl failure", (SIGNAL_FUNC) sig_sasl_failure);
53
0
}