Skip to content

Commit

Permalink
fix cdidier#18 - build with irssi 1.0 by darix
Browse files Browse the repository at this point in the history
Signed-off-by: benaryorg <[email protected]>
  • Loading branch information
benaryorg committed Feb 2, 2017
1 parent b12ca69 commit 7312f63
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/core/xmpp-servers.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
#include "rosters-tools.h"
#include "tools.h"

// IRSSI_ABI_VERSION was introduced in 0.8.18
#if !defined(IRSSI_ABI_VERSION) || IRSSI_ABI_VERSION < 6
# define use_tls use_ssl
#endif

static void
channels_join(SERVER_REC *server, const char *data, int automatic)
{
Expand Down Expand Up @@ -151,7 +156,7 @@ xmpp_server_init_connect(SERVER_CONNECT_REC *connrec)
server->connect_pid = -1;

if (server->connrec->port <= 0)
server->connrec->port = (server->connrec->use_ssl) ?
server->connrec->port = (server->connrec->use_tls) ?
LM_CONNECTION_DEFAULT_PORT_SSL : LM_CONNECTION_DEFAULT_PORT;

if (conn->real_jid == NULL)
Expand Down Expand Up @@ -335,7 +340,7 @@ lm_open_cb(LmConnection *connection, gboolean success,
g_free(host);
} else
signal_emit("server connecting", 1, server);
if (server->connrec->use_ssl)
if (server->connrec->use_tls)
signal_emit("xmpp server status", 2, server,
"Using SSL encryption.");
else if (lm_ssl_get_use_starttls(lm_connection_get_ssl(server->lmconn)))
Expand Down Expand Up @@ -470,7 +475,7 @@ xmpp_server_connect(XMPP_SERVER_REC *server)
return;
error = NULL;
err_msg = NULL;
if (server->connrec->use_ssl) {
if (server->connrec->use_tls) {
if (!set_ssl(server->lmconn, &error, server, FALSE)) {
err_msg = "Cannot init ssl";
goto err;
Expand Down

0 comments on commit 7312f63

Please sign in to comment.