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

Move send stanza function

This commit is contained in:
James Booth 2016-05-06 01:51:58 +01:00
parent b6c4a2029f
commit 579d062063
6 changed files with 15 additions and 16 deletions

View File

@ -150,7 +150,7 @@ cmd_execute_default(ProfWin *window, const char *inp)
}
case WIN_XML:
{
session_send_stanza(inp);
connection_send_stanza(inp);
break;
}
default:

View File

@ -381,7 +381,7 @@ api_win_show_themed(const char *tag, const char *const group, const char *const
int
api_send_stanza(const char *const stanza)
{
return session_send_stanza(stanza);
return connection_send_stanza(stanza);
}
gboolean

View File

@ -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)

View File

@ -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)
{

View File

@ -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);

View File

@ -77,7 +77,7 @@ GList * session_get_available_resources(void)
}
gboolean
session_send_stanza(const char *const stanza)
connection_send_stanza(const char *const stanza)
{
return TRUE;
}