diff options
| author | Jelmer Vernooij <jelmer@samba.org> | 2005-11-15 15:47:17 +0100 | 
|---|---|---|
| committer | Jelmer Vernooij <jelmer@samba.org> | 2005-11-15 15:47:17 +0100 | 
| commit | 9cb9868256c51a45983aac894428230de6035d79 (patch) | |
| tree | dd2b57879e7b493a1de8ac1574a2e90250923e7d /protocols | |
| parent | 9a103a2bdfb9a0afcc4d23e27d39c1a124194e18 (diff) | |
Remove handle_cmp() replacing it by a protocol-specific function.
Diffstat (limited to 'protocols')
| -rw-r--r-- | protocols/jabber/jabber.c | 1 | ||||
| -rw-r--r-- | protocols/msn/msn.c | 1 | ||||
| -rw-r--r-- | protocols/nogaim.c | 40 | ||||
| -rw-r--r-- | protocols/nogaim.h | 3 | ||||
| -rw-r--r-- | protocols/oscar/oscar.c | 7 | ||||
| -rw-r--r-- | protocols/oscar/oscar_util.c | 6 | ||||
| -rw-r--r-- | protocols/yahoo/yahoo.c | 1 | 
7 files changed, 8 insertions, 51 deletions
| diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 931a2182..a724bdcd 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -2440,6 +2440,7 @@ void jabber_init(struct prpl *ret)  	ret->buddy_free = jabber_buddy_free;  	ret->alias_buddy = jabber_roster_update;  	ret->group_buddy = jabber_group_change; +	ret->cmp_buddynames = g_strcasecmp;  	my_protocol = ret;  } diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c index 33e12af5..bc2f1235 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -397,6 +397,7 @@ void msn_init(struct prpl *ret)  	ret->add_deny = msn_add_deny;  	ret->rem_deny = msn_rem_deny;  	ret->send_typing = msn_send_typing; +	ret->cmp_buddynames = g_strcasecmp;  	my_protocol = ret;  } diff --git a/protocols/nogaim.c b/protocols/nogaim.c index dee89a5e..65fc5a98 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -162,44 +162,6 @@ static char *proto_away_alias_find( GList *gcm, char *away )  	return( NULL );  } -/* Compare two handles for a specific protocol. For most protocols, -   g_strcasecmp is okay, but for AIM, for example, it's not. This really -   should be a compare function inside the PRPL module, but I do it this -   way for now because I don't want to touch the Gaim code too much since -   it's not going to be here for too long anymore. */ -int handle_cmp( char *a, char *b, int protocol ) -{ -	if( protocol == PROTO_TOC || protocol == PROTO_ICQ ) -	{ -		/* AIM, being teh evil, thinks it's cool that users can put -		   random spaces in screennames. But "A B" and "AB" are -		   equal. Hrmm, okay. */ -		while( 1 ) -		{ -			while( *a == ' ' ) a ++; -			while( *b == ' ' ) b ++; -			 -			if( *a && *b ) -			{ -				if( tolower( *a ) != tolower( *b ) ) -					return( 1 ); -			} -			else if( *a || *b ) -				return( 1 ); -			else -				return( 0 ); -			 -			a ++; -			b ++; -		} -	} -	else -	{ -		return( g_strcasecmp( a, b ) ); -	} -} - -  /* multi.c */  struct gaim_connection *new_gaim_conn( struct aim_user *user ) @@ -835,7 +797,7 @@ void add_chat_buddy( struct conversation *b, char *handle )  		irc_usermsg( b->gc->irc, "User %s added to conversation %d", handle, b->id );  	/* It might be yourself! */ -	if( handle_cmp ( handle, b->gc->user->username, b->gc->protocol ) == 0 ) +	if( b->gc->prpl->cmp_buddynames( handle, b->gc->user->username ) == 0 )  	{  		u = user_find( b->gc->irc, b->gc->irc->nick );  		if( !b->joined ) diff --git a/protocols/nogaim.h b/protocols/nogaim.h index 4e10330a..5fc9aca5 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -219,6 +219,8 @@ struct prpl {  	void (* buddy_free)	(struct buddy *);  	char *(* get_status_string) (struct gaim_connection *gc, int stat); + +	int (* cmp_buddynames) (const char *who1, const char *who2);  };  #define PROTO_TOC	0 @@ -258,7 +260,6 @@ char *set_eval_charset( irc_t *irc, set_t *set, char *value );  void nogaim_init();  int proto_away( struct gaim_connection *gc, char *away );  char *set_eval_away_devoice( irc_t *irc, set_t *set, char *value ); -int handle_cmp( char *a, char *b, int protocol );  gboolean auto_reconnect( gpointer data );  void cancel_auto_reconnect( struct account *a ); diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 5a1ddc45..160d23ea 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -1209,11 +1209,7 @@ static int incomingim_chan4(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_  	return 1;  } -/* -int handle_cmp_aim(const char * a, const char * b) { -	return handle_cmp(a, b, PROTO_TOC); -} -*/ +  static int gaim_parse_incoming_im(aim_session_t *sess, aim_frame_t *fr, ...) {  	int channel, ret = 0;  	aim_userinfo_t *userinfo; @@ -2485,6 +2481,7 @@ void oscar_init(struct prpl *ret) {  	ret->rem_deny = oscar_rem_deny;  	ret->set_permit_deny = oscar_set_permit_deny;  	ret->keepalive = oscar_keepalive; +	ret->cmp_buddynames = aim_sncmp;  	ret->get_status_string = oscar_get_status_string;  	my_protocol = ret; diff --git a/protocols/oscar/oscar_util.c b/protocols/oscar/oscar_util.c index ed8409a4..1bb27559 100644 --- a/protocols/oscar/oscar_util.c +++ b/protocols/oscar/oscar_util.c @@ -1,9 +1,3 @@ -/* - * - * - * - */ -  #include <aim.h>  #include <ctype.h> diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c index 77fd86cc..8344fbf2 100644 --- a/protocols/yahoo/yahoo.c +++ b/protocols/yahoo/yahoo.c @@ -416,6 +416,7 @@ void byahoo_init( struct prpl *ret )  	ret->chat_invite = byahoo_chat_invite;  	ret->chat_leave = byahoo_chat_leave;  	ret->chat_open = byahoo_chat_open; +	ret->cmp_buddynames = g_strcasecmp;  	my_protocol = ret;  } | 
