mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-29 18:36:22 +00:00
Started work on closing stream on quit
For standards compliance
This commit is contained in:
@@ -494,7 +494,9 @@ _cmd_connect(const char * const inp, struct cmd_help_t help)
|
|||||||
static gboolean
|
static gboolean
|
||||||
_cmd_quit(const char * const inp, struct cmd_help_t help)
|
_cmd_quit(const char * const inp, struct cmd_help_t help)
|
||||||
{
|
{
|
||||||
return FALSE;
|
log_info("Profanity is shutting down.");
|
||||||
|
jabber_disconnect();
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|||||||
27
src/jabber.c
27
src/jabber.c
@@ -162,11 +162,9 @@ jabber_disconnect(void)
|
|||||||
{
|
{
|
||||||
if (jabber_conn.conn_status == JABBER_CONNECTED) {
|
if (jabber_conn.conn_status == JABBER_CONNECTED) {
|
||||||
log_info("Closing connection");
|
log_info("Closing connection");
|
||||||
xmpp_conn_release(jabber_conn.conn);
|
|
||||||
xmpp_ctx_free(jabber_conn.ctx);
|
// attempt closing the XML stream
|
||||||
xmpp_shutdown();
|
xmpp_disconnect(jabber_conn.conn);
|
||||||
jabber_conn.conn_status = JABBER_DISCONNECTED;
|
|
||||||
jabber_conn.presence = PRESENCE_OFFLINE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -382,6 +380,25 @@ _jabber_conn_handler(xmpp_conn_t * const conn,
|
|||||||
jabber_conn.conn_status = JABBER_DISCONNECTED;
|
jabber_conn.conn_status = JABBER_DISCONNECTED;
|
||||||
jabber_conn.presence = PRESENCE_OFFLINE;
|
jabber_conn.presence = PRESENCE_OFFLINE;
|
||||||
}
|
}
|
||||||
|
/* TO DO IF END STREAM
|
||||||
|
|
||||||
|
|
||||||
|
// free memory for connection object and context
|
||||||
|
xmpp_conn_release(jabber_conn.conn);
|
||||||
|
xmpp_ctx_free(jabber_conn.ctx);
|
||||||
|
|
||||||
|
// shutdown libstrophe
|
||||||
|
xmpp_shutdown();
|
||||||
|
|
||||||
|
jabber_conn.conn_status = JABBER_DISCONNECTED;
|
||||||
|
jabber_conn.presence = PRESENCE_OFFLINE;
|
||||||
|
|
||||||
|
gui_close();
|
||||||
|
chat_log_close();
|
||||||
|
prefs_close();
|
||||||
|
log_info("Shutdown complete");
|
||||||
|
log_close();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|||||||
@@ -93,11 +93,6 @@ _profanity_shutdown(void)
|
|||||||
{
|
{
|
||||||
log_info("Profanity is shutting down.");
|
log_info("Profanity is shutting down.");
|
||||||
jabber_disconnect();
|
jabber_disconnect();
|
||||||
gui_close();
|
|
||||||
chat_log_close();
|
|
||||||
prefs_close();
|
|
||||||
log_info("Shutdown complete");
|
|
||||||
log_close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static log_level_t
|
static log_level_t
|
||||||
|
|||||||
Reference in New Issue
Block a user