1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Removed --disable-tls command line option

This commit is contained in:
James Booth 2015-10-18 00:17:45 +01:00
parent 31ecd41c8f
commit 9d2745e462
7 changed files with 11 additions and 22 deletions

View File

@ -3,7 +3,7 @@
Profanity \- a simple console based XMPP chat client.
.SH SYNOPSIS
.B profanity
[\-vhd] [\-l level] [\-a account]
[\-vh] [\-l level] [\-a account]
.SH DESCRIPTION
.B Profanity
is a simple lightweight console based XMPP chat client. Its emphasis is
@ -25,10 +25,6 @@ Auto connect to an account on startup,
.I ACCOUNT
must be an existing account.
.TP
.BI "\-d, \-\-disable\-tls"
Disable TLS for servers that either don't support it, or claim to but do not
complete the handshake.
.TP
.BI "\-l, \-\-log "LEVEL
Set the logging level,
.I LEVEL

View File

@ -42,7 +42,6 @@
#include "profanity.h"
#include "command/command.h"
static gboolean disable_tls = FALSE;
static gboolean version = FALSE;
static char *log = "INFO";
static char *account_name = NULL;
@ -58,7 +57,6 @@ main(int argc, char **argv)
static GOptionEntry entries[] =
{
{ "version", 'v', 0, G_OPTION_ARG_NONE, &version, "Show version information", NULL },
{ "disable-tls", 'd', 0, G_OPTION_ARG_NONE, &disable_tls, "Disable TLS", NULL },
{ "account", 'a', 0, G_OPTION_ARG_STRING, &account_name, "Auto connect to an account on startup" },
{ "log",'l', 0, G_OPTION_ARG_STRING, &log, "Set logging levels, DEBUG, INFO (default), WARN, ERROR", "LEVEL" },
{ NULL }
@ -137,7 +135,7 @@ main(int argc, char **argv)
return 0;
}
prof_run(disable_tls, log, account_name);
prof_run(log, account_name);
return 0;
}

View File

@ -73,7 +73,7 @@
#include "config/tlscerts.h"
static void _check_autoaway(void);
static void _init(const int disable_tls, char *log_level);
static void _init(char *log_level);
static void _shutdown(void);
static void _create_directories(void);
static void _connect_default(const char * const account);
@ -92,9 +92,9 @@ char *saved_status;
static gboolean cont = TRUE;
void
prof_run(const int disable_tls, char *log_level, char *account_name)
prof_run(char *log_level, char *account_name)
{
_init(disable_tls, log_level);
_init(log_level);
_connect_default(account_name);
ui_update();
@ -297,7 +297,7 @@ _check_autoaway()
}
static void
_init(const int disable_tls, char *log_level)
_init(char *log_level)
{
setlocale(LC_ALL, "");
// ignore SIGPIPE
@ -326,7 +326,7 @@ _init(const int disable_tls, char *log_level)
theme_init(theme);
prefs_free_string(theme);
ui_init();
jabber_init(disable_tls);
jabber_init();
cmd_init();
log_info("Initialising contact list");
roster_init();

View File

@ -38,7 +38,7 @@
#include "resource.h"
#include "xmpp/xmpp.h"
void prof_run(const int disable_tls, char *log_level, char *account_name);
void prof_run(char *log_level, char *account_name);
void prof_handle_idle(void);
void prof_handle_activity(void);

View File

@ -70,7 +70,6 @@ static struct _jabber_conn_t {
jabber_conn_status_t conn_status;
char *presence_message;
int priority;
int tls_disabled;
char *domain;
} jabber_conn;
@ -115,14 +114,13 @@ void _connection_free_saved_details(void);
void _connection_free_session_data(void);
void
jabber_init(const int disable_tls)
jabber_init(void)
{
log_info("Initialising XMPP");
jabber_conn.conn_status = JABBER_STARTED;
jabber_conn.presence_message = NULL;
jabber_conn.conn = NULL;
jabber_conn.ctx = NULL;
jabber_conn.tls_disabled = disable_tls;
jabber_conn.domain = NULL;
presence_sub_requests_init();
caps_init();
@ -430,9 +428,6 @@ _jabber_connect(const char * const fulljid, const char * const passwd,
}
xmpp_conn_set_jid(jabber_conn.conn, fulljid);
xmpp_conn_set_pass(jabber_conn.conn, passwd);
if (jabber_conn.tls_disabled) {
xmpp_conn_disable_tls(jabber_conn.conn);
}
#ifdef HAVE_LIBMESODE
char *cert_path = prefs_get_string(PREF_TLS_CERTPATH);

View File

@ -137,7 +137,7 @@ typedef struct data_form_t {
} DataForm;
// connection functions
void jabber_init(const int disable_tls);
void jabber_init(void);
jabber_conn_status_t jabber_connect_with_details(const char * const jid,
const char * const passwd, const char * const altdomain, const int port);
jabber_conn_status_t jabber_connect_with_account(const ProfAccount * const account);

View File

@ -6,7 +6,7 @@
#include "xmpp/xmpp.h"
// connection functions
void jabber_init(const int disable_tls) {}
void jabber_init(void) {}
jabber_conn_status_t jabber_connect_with_details(const char * const jid,
const char * const passwd, const char * const altdomain, const int port)