1
0
Fork 0

Move conn is secure function

This commit is contained in:
James Booth 2016-05-06 01:49:27 +01:00
parent 8950dbb768
commit b6c4a2029f
5 changed files with 14 additions and 14 deletions

View File

@ -232,7 +232,7 @@ cmd_tls_trust(ProfWin *window, const char *const command, gchar **args)
cons_show("You are not currently connected.");
return TRUE;
}
if (!session_conn_is_secured()) {
if (!connection_conn_is_secured()) {
cons_show("No TLS connection established");
return TRUE;
}
@ -330,7 +330,7 @@ cmd_tls_cert(ProfWin *window, const char *const command, gchar **args)
cons_show("You are not currently connected.");
return TRUE;
}
if (!session_conn_is_secured()) {
if (!connection_conn_is_secured()) {
cons_show("No TLS connection established");
return TRUE;
}

View File

@ -290,6 +290,16 @@ connection_get_tls_peer_cert(void)
}
#endif
gboolean
connection_conn_is_secured(void)
{
if (conn.conn_status == JABBER_CONNECTED) {
return xmpp_conn_is_secured(conn.conn) == 0 ? FALSE : TRUE;
} else {
return FALSE;
}
}
static void
_connection_handler(xmpp_conn_t *const conn, const xmpp_conn_event_t status, const int error,
xmpp_stream_error_t *const stream_error, void *const userdata)

View File

@ -401,16 +401,6 @@ session_login_failed(void)
}
}
gboolean
session_conn_is_secured(void)
{
if (connection_get_status() == JABBER_CONNECTED) {
return xmpp_conn_is_secured(connection_get_conn()) == 0 ? FALSE : TRUE;
} else {
return FALSE;
}
}
gboolean
session_send_stanza(const char *const stanza)
{

View File

@ -121,7 +121,6 @@ char* session_get_account_name(void);
GList* session_get_available_resources(void);
gboolean session_send_stanza(const char *const stanza);
gboolean session_conn_is_secured(void);
gboolean session_send_stanza(const char *const stanza);
gboolean session_service_supports(const char *const feature);
@ -133,6 +132,7 @@ void connection_free_uuid(char *uuid);
#ifdef HAVE_LIBMESODE
TLSCertificate* connection_get_tls_peer_cert(void);
#endif
gboolean connection_conn_is_secured(void);
char* message_send_chat(const char *const barejid, const char *const msg, const char *const oob_url);
char* message_send_chat_otr(const char *const barejid, const char *const msg);

View File

@ -37,7 +37,7 @@ const char * session_get_domain(void)
return NULL;
}
gboolean session_conn_is_secured(void)
gboolean connection_conn_is_secured(void)
{
return 1;
}