diff options
author | James Booth <boothj5@gmail.com> | 2016-05-06 01:51:58 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-05-06 01:51:58 +0100 |
commit | 579d062063719ebd3a07f6ff0d90fa6de2bb8c1e (patch) | |
tree | 5dd85b46c8c9e485bae91973b147fb0caa5d5cbe /src/xmpp | |
parent | b6c4a2029ff34a8f0824c5241508fbd550044c21 (diff) | |
download | profani-tty-579d062063719ebd3a07f6ff0d90fa6de2bb8c1e.tar.gz |
Move send stanza function
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/connection.c | 11 | ||||
-rw-r--r-- | src/xmpp/session.c | 11 | ||||
-rw-r--r-- | src/xmpp/xmpp.h | 3 |
3 files changed, 12 insertions, 13 deletions
diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c index 377d5238..9f84597b 100644 --- a/src/xmpp/connection.c +++ b/src/xmpp/connection.c @@ -300,6 +300,17 @@ connection_conn_is_secured(void) } } +gboolean +connection_send_stanza(const char *const stanza) +{ + if (conn.conn_status != JABBER_CONNECTED) { + return FALSE; + } else { + xmpp_send_raw_string(conn.conn, "%s", stanza); + return TRUE; + } +} + 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) diff --git a/src/xmpp/session.c b/src/xmpp/session.c index 75c5f20e..6aa27035 100644 --- a/src/xmpp/session.c +++ b/src/xmpp/session.c @@ -401,17 +401,6 @@ session_login_failed(void) } } -gboolean -session_send_stanza(const char *const stanza) -{ - if (connection_get_status() != JABBER_CONNECTED) { - return FALSE; - } else { - xmpp_send_raw_string(connection_get_conn(), "%s", stanza); - return TRUE; - } -} - void session_lost_connection(void) { diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h index 391ec37d..dbea4e40 100644 --- a/src/xmpp/xmpp.h +++ b/src/xmpp/xmpp.h @@ -119,9 +119,7 @@ void session_shutdown(void); void session_process_events(int millis); char* session_get_account_name(void); GList* session_get_available_resources(void); -gboolean session_send_stanza(const char *const stanza); -gboolean session_send_stanza(const char *const stanza); gboolean session_service_supports(const char *const feature); jabber_conn_status_t connection_get_status(void); @@ -133,6 +131,7 @@ void connection_free_uuid(char *uuid); TLSCertificate* connection_get_tls_peer_cert(void); #endif gboolean connection_conn_is_secured(void); +gboolean connection_send_stanza(const char *const stanza); 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); |