diff options
Diffstat (limited to 'protocols/jabber')
| -rw-r--r-- | protocols/jabber/io.c | 30 | ||||
| -rw-r--r-- | protocols/jabber/iq.c | 30 | ||||
| -rw-r--r-- | protocols/jabber/jabber.c | 12 | ||||
| -rw-r--r-- | protocols/jabber/jabber_util.c | 4 | ||||
| -rw-r--r-- | protocols/jabber/presence.c | 6 | ||||
| -rw-r--r-- | protocols/jabber/sasl.c | 14 | 
6 files changed, 48 insertions, 48 deletions
| diff --git a/protocols/jabber/io.c b/protocols/jabber/io.c index c64901f7..67deb3a6 100644 --- a/protocols/jabber/io.c +++ b/protocols/jabber/io.c @@ -116,7 +116,7 @@ static gboolean jabber_write_queue( struct im_connection *ic )  		closesocket( jd->fd );	/* Shouldn't be necessary after errors? */  		jd->fd = -1; -		imc_error( ic, "Short write() to server" ); +		imcb_error( ic, "Short write() to server" );  		imc_logout( ic, TRUE );  		return FALSE;  	} @@ -159,7 +159,7 @@ static gboolean jabber_read_callback( gpointer data, gint fd, b_input_condition  		/* Parse. */  		if( xt_feed( jd->xt, buf, st ) < 0 )  		{ -			imc_error( ic, "XML stream error" ); +			imcb_error( ic, "XML stream error" );  			imc_logout( ic, TRUE );  			return FALSE;  		} @@ -202,7 +202,7 @@ static gboolean jabber_read_callback( gpointer data, gint fd, b_input_condition  					   SASL and TLS. */  					if( set_getbool( &ic->acc->set, "tls" ) )  					{ -						imc_error( ic, "TLS is turned on for this " +						imcb_error( ic, "TLS is turned on for this "  						          "account, but is not supported by this server" );  						imc_logout( ic, FALSE );  						return FALSE; @@ -215,7 +215,7 @@ static gboolean jabber_read_callback( gpointer data, gint fd, b_input_condition  			}  			else  			{ -				imc_error( ic, "XML stream error" ); +				imcb_error( ic, "XML stream error" );  				imc_logout( ic, TRUE );  				return FALSE;  			} @@ -226,7 +226,7 @@ static gboolean jabber_read_callback( gpointer data, gint fd, b_input_condition  		closesocket( jd->fd );  		jd->fd = -1; -		imc_error( ic, "Error while reading from server" ); +		imcb_error( ic, "Error while reading from server" );  		imc_logout( ic, TRUE );  		return FALSE;  	} @@ -241,12 +241,12 @@ gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition c  	if( source == -1 )  	{ -		imc_error( ic, "Could not connect to server" ); +		imcb_error( ic, "Could not connect to server" );  		imc_logout( ic, TRUE );  		return FALSE;  	} -	imc_log( ic, "Connected to server, logging in" ); +	imcb_log( ic, "Connected to server, logging in" );  	return jabber_start_stream( ic );  } @@ -262,12 +262,12 @@ gboolean jabber_connected_ssl( gpointer data, void *source, b_input_condition co  		   already, set it to NULL here to prevent a double cleanup: */  		jd->ssl = NULL; -		imc_error( ic, "Could not connect to server" ); +		imcb_error( ic, "Could not connect to server" );  		imc_logout( ic, TRUE );  		return FALSE;  	} -	imc_log( ic, "Connected to server, logging in" ); +	imcb_log( ic, "Connected to server, logging in" );  	return jabber_start_stream( ic );  } @@ -296,7 +296,7 @@ static xt_status jabber_pkt_features( struct xt_node *node, gpointer data )  		if( c && ( !trytls && !set_getbool( &ic->acc->set, "tls" ) ) )  		{ -			imc_error( ic, "Server requires TLS connections, but TLS is turned off for this account" ); +			imcb_error( ic, "Server requires TLS connections, but TLS is turned off for this account" );  			imc_logout( ic, FALSE );  			return XT_ABORT; @@ -326,7 +326,7 @@ static xt_status jabber_pkt_features( struct xt_node *node, gpointer data )  		if( !trytls && set_getbool( &ic->acc->set, "tls" ) )  		{ -			imc_error( ic, "TLS is turned on for this account, but is not supported by this server" ); +			imcb_error( ic, "TLS is turned on for this account, but is not supported by this server" );  			imc_logout( ic, FALSE );  			return XT_ABORT; @@ -416,7 +416,7 @@ static xt_status jabber_pkt_proceed_tls( struct xt_node *node, gpointer data )  	}  	jd->w_inpa = jd->r_inpa = 0; -	imc_log( ic, "Converting stream to TLS" ); +	imcb_log( ic, "Converting stream to TLS" );  	jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic ); @@ -452,7 +452,7 @@ static xt_status jabber_pkt_stream_error( struct xt_node *node, gpointer data )  	/* Tssk... */  	if( type == NULL )  	{ -		imc_error( ic, "Unknown stream error reported by server" ); +		imcb_error( ic, "Unknown stream error reported by server" );  		imc_logout( ic, allow_reconnect );  		return XT_ABORT;  	} @@ -462,12 +462,12 @@ static xt_status jabber_pkt_stream_error( struct xt_node *node, gpointer data )  	   infinite loop! */  	if( strcmp( type, "conflict" ) == 0 )  	{ -		imc_error( ic, "Account and resource used from a different location" ); +		imcb_error( ic, "Account and resource used from a different location" );  		allow_reconnect = FALSE;  	}  	else  	{ -		imc_error( ic, "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" ); +		imcb_error( ic, "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" );  	}  	imc_logout( ic, allow_reconnect ); diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c index fc6f223d..53be819e 100644 --- a/protocols/jabber/iq.c +++ b/protocols/jabber/iq.c @@ -38,7 +38,7 @@ xt_status jabber_pkt_iq( struct xt_node *node, gpointer data )  	if( !type )  	{ -		imc_error( ic, "Received IQ packet without type." ); +		imcb_error( ic, "Received IQ packet without type." );  		imc_logout( ic, TRUE );  		return XT_ABORT;  	} @@ -59,7 +59,7 @@ xt_status jabber_pkt_iq( struct xt_node *node, gpointer data )  		entry = g_hash_table_lookup( jd->node_cache, s );  		if( entry == NULL ) -			imc_log( ic, "WARNING: Received IQ-%s packet with unknown/expired ID %s!", type, s ); +			imcb_log( ic, "WARNING: Received IQ-%s packet with unknown/expired ID %s!", type, s );  		else if( entry->func )  			return entry->func( ic, node, entry->node );  	} @@ -68,7 +68,7 @@ xt_status jabber_pkt_iq( struct xt_node *node, gpointer data )  		if( !( c = xt_find_node( node->children, "query" ) ) ||  		    !( s = xt_find_attr( c, "xmlns" ) ) )  		{ -			imc_log( ic, "WARNING: Received incomplete IQ-%s packet", type ); +			imcb_log( ic, "WARNING: Received incomplete IQ-%s packet", type );  			return XT_HANDLED;  		} @@ -131,7 +131,7 @@ xt_status jabber_pkt_iq( struct xt_node *node, gpointer data )  		if( !( c = xt_find_node( node->children, "query" ) ) ||  		    !( s = xt_find_attr( c, "xmlns" ) ) )  		{ -			imc_log( ic, "WARNING: Received incomplete IQ-%s packet", type ); +			imcb_log( ic, "WARNING: Received incomplete IQ-%s packet", type );  			return XT_HANDLED;  		} @@ -153,7 +153,7 @@ xt_status jabber_pkt_iq( struct xt_node *node, gpointer data )  			}  			else  			{ -				imc_log( ic, "WARNING: %s tried to fake a roster push!", s ? s : "(unknown)" ); +				imcb_log( ic, "WARNING: %s tried to fake a roster push!", s ? s : "(unknown)" );  				xt_free_node( reply );  				reply = jabber_make_error_packet( node, "not-allowed", "cancel" ); @@ -218,7 +218,7 @@ static xt_status jabber_do_iq_auth( struct im_connection *ic, struct xt_node *no  	if( !( query = xt_find_node( node->children, "query" ) ) )  	{ -		imc_log( ic, "WARNING: Received incomplete IQ packet while authenticating" ); +		imcb_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );  		imc_logout( ic, FALSE );  		return XT_HANDLED;  	} @@ -257,7 +257,7 @@ static xt_status jabber_do_iq_auth( struct im_connection *ic, struct xt_node *no  	{  		xt_free_node( reply ); -		imc_error( ic, "Can't find suitable authentication method" ); +		imcb_error( ic, "Can't find suitable authentication method" );  		imc_logout( ic, FALSE );  		return XT_ABORT;  	} @@ -276,14 +276,14 @@ static xt_status jabber_finish_iq_auth( struct im_connection *ic, struct xt_node  	if( !( type = xt_find_attr( node, "type" ) ) )  	{ -		imc_log( ic, "WARNING: Received incomplete IQ packet while authenticating" ); +		imcb_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );  		imc_logout( ic, FALSE );  		return XT_HANDLED;  	}  	if( strcmp( type, "error" ) == 0 )  	{ -		imc_error( ic, "Authentication failure" ); +		imcb_error( ic, "Authentication failure" );  		imc_logout( ic, FALSE );  		return XT_ABORT;  	} @@ -310,7 +310,7 @@ xt_status jabber_pkt_bind_sess( struct im_connection *ic, struct xt_node *node,  		c = xt_find_node( c->children, "jid" );  		if( c && c->text_len && ( s = strchr( c->text, '/' ) ) &&  		    strcmp( s + 1, set_getstr( &ic->acc->set, "resource" ) ) != 0 ) -			imc_log( ic, "Server changed session resource string to `%s'", s + 1 ); +			imcb_log( ic, "Server changed session resource string to `%s'", s + 1 );  		jd->flags &= ~JFLAG_WAIT_BIND;  	} @@ -333,7 +333,7 @@ int jabber_get_roster( struct im_connection *ic )  	struct xt_node *node;  	int st; -	imc_log( ic, "Authenticated, requesting buddy list" ); +	imcb_log( ic, "Authenticated, requesting buddy list" );  	node = xt_new_node( "query", NULL, NULL );  	xt_add_attr( node, "xmlns", XMLNS_ROSTER ); @@ -352,7 +352,7 @@ static xt_status jabber_parse_roster( struct im_connection *ic, struct xt_node *  	if( !( query = xt_find_node( node->children, "query" ) ) )  	{ -		imc_log( ic, "WARNING: Received NULL roster packet" ); +		imcb_log( ic, "WARNING: Received NULL roster packet" );  		return XT_HANDLED;  	} @@ -396,7 +396,7 @@ static xt_status jabber_parse_roster( struct im_connection *ic, struct xt_node *  	}  	if( initial ) -		imc_connected( ic ); +		imcb_connected( ic );  	return XT_HANDLED;  } @@ -427,7 +427,7 @@ static xt_status jabber_iq_display_vcard( struct im_connection *ic, struct xt_no  	    ( vc = xt_find_node( node->children, "vCard" ) ) == NULL )  	{  		s = xt_find_attr( orig, "to" ); /* If this returns NULL something's wrong.. */ -		imc_log( ic, "Could not retrieve vCard of %s", s ? s : "(NULL)" ); +		imcb_log( ic, "Could not retrieve vCard of %s", s ? s : "(NULL)" );  		return XT_HANDLED;  	} @@ -535,7 +535,7 @@ static xt_status jabber_iq_display_vcard( struct im_connection *ic, struct xt_no  	/* *sigh* */ -	imc_log( ic, "%s", reply->str ); +	imcb_log( ic, "%s", reply->str );  	g_string_free( reply, TRUE );  	return XT_HANDLED; diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index af294d90..e560fda0 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -58,7 +58,7 @@ static void jabber_init( account_t *acc )  static void jabber_login( account_t *acc )  { -	struct im_connection *ic = imc_new( acc ); +	struct im_connection *ic = imcb_new( acc );  	struct jabber_data *jd = g_new0( struct jabber_data, 1 );  	struct ns_srv_reply *srv = NULL;  	char *connect_to, *s; @@ -71,7 +71,7 @@ static void jabber_login( account_t *acc )  	if( jd->server == NULL )  	{ -		imc_error( ic, "Incomplete account name (format it like <username@jabberserver.name>)" ); +		imcb_error( ic, "Incomplete account name (format it like <username@jabberserver.name>)" );  		imc_logout( ic, FALSE );  		return;  	} @@ -158,12 +158,12 @@ static void jabber_login( account_t *acc )  	else  		connect_to = jd->server; -	imc_log( ic, "Connecting" ); +	imcb_log( ic, "Connecting" );  	if( set_getint( &acc->set, "port" ) < JABBER_PORT_MIN ||  	    set_getint( &acc->set, "port" ) > JABBER_PORT_MAX )  	{ -		imc_log( ic, "Incorrect port number, must be in the %d-%d range", +		imcb_log( ic, "Incorrect port number, must be in the %d-%d range",  		               JABBER_PORT_MIN, JABBER_PORT_MAX );  		imc_logout( ic, FALSE );  		return; @@ -185,7 +185,7 @@ static void jabber_login( account_t *acc )  	if( jd->fd == -1 )  	{ -		imc_error( ic, "Could not connect to server" ); +		imcb_error( ic, "Could not connect to server" );  		imc_logout( ic, TRUE );  	}  } @@ -284,7 +284,7 @@ static void jabber_get_info( struct im_connection *ic, char *who )  	while( bud )  	{ -		imc_log( ic, "Buddy %s (%d) information:\nAway state: %s\nAway message: %s", +		imcb_log( ic, "Buddy %s (%d) information:\nAway state: %s\nAway message: %s",  		                   bud->full_jid, bud->priority,  		                   bud->away_state ? bud->away_state->full_name : "(none)",  		                   bud->away_message ? : "(none)" ); diff --git a/protocols/jabber/jabber_util.c b/protocols/jabber/jabber_util.c index cc237b03..949a7a4b 100644 --- a/protocols/jabber/jabber_util.c +++ b/protocols/jabber/jabber_util.c @@ -223,7 +223,7 @@ static void jabber_buddy_ask_yes( gpointer w, struct jabber_buddy_ask_data *bla  	presence_send_request( bla->ic, bla->handle, "subscribed" );  	if( find_buddy( bla->ic, bla->handle ) == NULL ) -		show_got_added( bla->ic, bla->handle, NULL ); +		imcb_ask_add( bla->ic, bla->handle, NULL );  	g_free( bla->handle );  	g_free( bla ); @@ -246,7 +246,7 @@ void jabber_buddy_ask( struct im_connection *ic, char *handle )  	bla->handle = g_strdup( handle );  	buf = g_strdup_printf( "The user %s wants to add you to his/her buddy list.", handle ); -	do_ask_dialog( ic, buf, bla, jabber_buddy_ask_yes, jabber_buddy_ask_no ); +	imcb_ask( ic, buf, bla, jabber_buddy_ask_yes, jabber_buddy_ask_no );  	g_free( buf );  } diff --git a/protocols/jabber/presence.c b/protocols/jabber/presence.c index 634948bf..4007c84e 100644 --- a/protocols/jabber/presence.c +++ b/protocols/jabber/presence.c @@ -40,7 +40,7 @@ xt_status jabber_pkt_presence( struct xt_node *node, gpointer data )  		if( !( bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT | GET_BUDDY_CREAT ) ) )  		{  			if( set_getbool( &ic->irc->set, "debug" ) ) -				imc_log( ic, "WARNING: Could not handle presence information from JID: %s", from ); +				imcb_log( ic, "WARNING: Could not handle presence information from JID: %s", from );  			return XT_HANDLED;  		} @@ -73,7 +73,7 @@ xt_status jabber_pkt_presence( struct xt_node *node, gpointer data )  		if( jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT ) == NULL )  		{  			if( set_getbool( &ic->irc->set, "debug" ) ) -				imc_log( ic, "WARNING: Received presence information from unknown JID: %s", from ); +				imcb_log( ic, "WARNING: Received presence information from unknown JID: %s", from );  			return XT_HANDLED;  		} @@ -102,7 +102,7 @@ xt_status jabber_pkt_presence( struct xt_node *node, gpointer data )  	else if( strcmp( type, "subscribed" ) == 0 )  	{  		/* Not sure about this one, actually... */ -		imc_log( ic, "%s just accepted your authorization request", from ); +		imcb_log( ic, "%s just accepted your authorization request", from );  	}  	else if( strcmp( type, "unsubscribe" ) == 0 || strcmp( type, "unsubscribed" ) == 0 )  	{ diff --git a/protocols/jabber/sasl.c b/protocols/jabber/sasl.c index cbd40fb1..69199a8b 100644 --- a/protocols/jabber/sasl.c +++ b/protocols/jabber/sasl.c @@ -37,14 +37,14 @@ xt_status sasl_pkt_mechanisms( struct xt_node *node, gpointer data )  		/* Should abort this now, since we should already be doing  		   IQ authentication. Strange things happen when you try  		   to do both... */ -		imc_log( ic, "XMPP 1.0 non-compliant server seems to support SASL, please report this as a BitlBee bug!" ); +		imcb_log( ic, "XMPP 1.0 non-compliant server seems to support SASL, please report this as a BitlBee bug!" );  		return XT_HANDLED;  	}  	s = xt_find_attr( node, "xmlns" );  	if( !s || strcmp( s, XMLNS_SASL ) != 0 )  	{ -		imc_log( ic, "Stream error while authenticating" ); +		imcb_log( ic, "Stream error while authenticating" );  		imc_logout( ic, FALSE );  		return XT_ABORT;  	} @@ -62,7 +62,7 @@ xt_status sasl_pkt_mechanisms( struct xt_node *node, gpointer data )  	if( !sup_plain && !sup_digest )  	{ -		imc_error( ic, "No known SASL authentication schemes supported" ); +		imcb_error( ic, "No known SASL authentication schemes supported" );  		imc_logout( ic, FALSE );  		return XT_ABORT;  	} @@ -279,7 +279,7 @@ xt_status sasl_pkt_challenge( struct xt_node *node, gpointer data )  	goto silent_error;  error: -	imc_error( ic, "Incorrect SASL challenge received" ); +	imcb_error( ic, "Incorrect SASL challenge received" );  	imc_logout( ic, FALSE );  silent_error: @@ -303,19 +303,19 @@ xt_status sasl_pkt_result( struct xt_node *node, gpointer data )  	s = xt_find_attr( node, "xmlns" );  	if( !s || strcmp( s, XMLNS_SASL ) != 0 )  	{ -		imc_log( ic, "Stream error while authenticating" ); +		imcb_log( ic, "Stream error while authenticating" );  		imc_logout( ic, FALSE );  		return XT_ABORT;  	}  	if( strcmp( node->name, "success" ) == 0 )  	{ -		imc_log( ic, "Authentication finished" ); +		imcb_log( ic, "Authentication finished" );  		jd->flags |= JFLAG_AUTHENTICATED | JFLAG_STREAM_RESTART;  	}  	else if( strcmp( node->name, "failure" ) == 0 )  	{ -		imc_error( ic, "Authentication failure" ); +		imcb_error( ic, "Authentication failure" );  		imc_logout( ic, FALSE );  		return XT_ABORT;  	} | 
