Beispiel #1
0
static void jabber_logout( struct im_connection *ic )
{
	struct jabber_data *jd = ic->proto_data;
	
	while( jd->filetransfers )
		imcb_file_canceled( ic, ( ( struct jabber_transfer *) jd->filetransfers->data )->ft, "Logging out" );

	while( jd->streamhosts )
	{
		jabber_streamhost_t *sh = jd->streamhosts->data;
		jd->streamhosts = g_slist_remove( jd->streamhosts, sh );
		g_free( sh->jid );
		g_free( sh->host );
		g_free( sh );
	}

	if( jd->fd >= 0 )
		jabber_end_stream( ic );
	
	while( ic->groupchats )
		jabber_chat_free( ic->groupchats->data );
	
	if( jd->r_inpa >= 0 )
		b_event_remove( jd->r_inpa );
	if( jd->w_inpa >= 0 )
		b_event_remove( jd->w_inpa );
	
	if( jd->ssl )
		ssl_disconnect( jd->ssl );
	if( jd->fd >= 0 )
		closesocket( jd->fd );
	
	if( jd->tx_len )
		g_free( jd->txq );
	
	if( jd->node_cache )
		g_hash_table_destroy( jd->node_cache );
	
	jabber_buddy_remove_all( ic );
	
	xt_free( jd->xt );
	
	g_free( jd->oauth2_access_token );
	g_free( jd->away_message );
	g_free( jd->username );
	g_free( jd->me );
	g_free( jd );
	
	jabber_connections = g_slist_remove( jabber_connections, ic );
}
Beispiel #2
0
static void jabber_logout(struct im_connection *ic)
{
	struct jabber_data *jd = ic->proto_data;

	while (jd->filetransfers) {
		imcb_file_canceled(ic, (( struct jabber_transfer *) jd->filetransfers->data)->ft, "Logging out");
	}

	while (jd->streamhosts) {
		jabber_streamhost_t *sh = jd->streamhosts->data;
		jd->streamhosts = g_slist_remove(jd->streamhosts, sh);
		g_free(sh->jid);
		g_free(sh->host);
		g_free(sh);
	}

	if (jd->fd >= 0) {
		jabber_end_stream(ic);
	}

	while (ic->groupchats) {
		jabber_chat_free(ic->groupchats->data);
	}

	if (jd->r_inpa >= 0) {
		b_event_remove(jd->r_inpa);
	}
	if (jd->w_inpa >= 0) {
		b_event_remove(jd->w_inpa);
	}

	if (jd->ssl) {
		ssl_disconnect(jd->ssl);
	}
	if (jd->fd >= 0) {
		proxy_disconnect(jd->fd);
	}

	if (jd->tx_len) {
		g_free(jd->txq);
	}

	if (jd->node_cache) {
		g_hash_table_destroy(jd->node_cache);
	}

	if (jd->buddies) {
		jabber_buddy_remove_all(ic);
	}

	xt_free(jd->xt);

	md5_free(&jd->cached_id_prefix);

	g_free(jd->oauth2_access_token);
	g_free(jd->away_message);
	g_free(jd->internal_jid);
	g_free(jd->gmail_tid);
	g_free(jd->muc_host);
	g_free(jd->username);
	g_free(jd->me);
	g_free(jd);

	jabber_connections = g_slist_remove(jabber_connections, ic);
}