mirror of
https://github.com/profanity-im/profanity.git
synced 2024-09-01 19:24:15 -04:00
Move conn is secure function
This commit is contained in:
parent
8950dbb768
commit
b6c4a2029f
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user