diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2009-11-23 23:00:54 +0000 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2009-11-23 23:00:54 +0000 | 
| commit | 4e041946706d3fc3aed405152028b02ec2794902 (patch) | |
| tree | ef4a4862f5476c49150cdd25f2ebbb3707ea2246 /protocols/yahoo/yahoo.c | |
| parent | b3117f2524775ff7c61ead7c3bdb3799064ed97f (diff) | |
| parent | fb51d85751b36098ad4271bc4553ade4dc53f20b (diff) | |
Merging BitlBee 1.2.4+
Diffstat (limited to 'protocols/yahoo/yahoo.c')
| -rw-r--r-- | protocols/yahoo/yahoo.c | 65 | 
1 files changed, 45 insertions, 20 deletions
| diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c index 65993d9d..a5dc2557 100644 --- a/protocols/yahoo/yahoo.c +++ b/protocols/yahoo/yahoo.c @@ -253,20 +253,23 @@ static void byahoo_set_away( struct im_connection *ic, char *state, char *msg )  static GList *byahoo_away_states( struct im_connection *ic )  { -	GList *m = NULL; - -	m = g_list_append( m, "Available" ); -	m = g_list_append( m, "Be Right Back" ); -	m = g_list_append( m, "Busy" ); -	m = g_list_append( m, "Not At Home" ); -	m = g_list_append( m, "Not At Desk" ); -	m = g_list_append( m, "Not In Office" ); -	m = g_list_append( m, "On Phone" ); -	m = g_list_append( m, "On Vacation" ); -	m = g_list_append( m, "Out To Lunch" ); -	m = g_list_append( m, "Stepped Out" ); -	m = g_list_append( m, "Invisible" ); -	m = g_list_append( m, GAIM_AWAY_CUSTOM ); +	static GList *m = NULL; + +	if( m == NULL ) +	{ +		m = g_list_append( m, "Available" ); +		m = g_list_append( m, "Be Right Back" ); +		m = g_list_append( m, "Busy" ); +		m = g_list_append( m, "Not At Home" ); +		m = g_list_append( m, "Not At Desk" ); +		m = g_list_append( m, "Not In Office" ); +		m = g_list_append( m, "On Phone" ); +		m = g_list_append( m, "On Vacation" ); +		m = g_list_append( m, "Out To Lunch" ); +		m = g_list_append( m, "Stepped Out" ); +		m = g_list_append( m, "Invisible" ); +		m = g_list_append( m, GAIM_AWAY_CUSTOM ); +	}  	return m;  } @@ -347,6 +350,20 @@ static struct groupchat *byahoo_chat_with( struct im_connection *ic, char *who )  	return c;  } +static void byahoo_auth_allow( struct im_connection *ic, const char *who ) +{ +	struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data; +	 +	yahoo_accept_buddy_ymsg13( yd->y2_id, NULL, who ); +} + +static void byahoo_auth_deny( struct im_connection *ic, const char *who ) +{ +	struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data; +	 +	yahoo_reject_buddy_ymsg13( yd->y2_id, NULL, who, NULL ); +} +  void byahoo_initmodule( )  {  	struct prpl *ret = g_new0(struct prpl, 1); @@ -372,6 +389,9 @@ void byahoo_initmodule( )  	ret->handle_cmp = g_strcasecmp; +	ret->auth_allow = byahoo_auth_allow; +	ret->auth_deny = byahoo_auth_deny; +	  	register_protocol(ret);  } @@ -451,9 +471,7 @@ gboolean byahoo_write_ready_callback( gpointer data, gint source, b_input_condit  {  	struct byahoo_write_ready_data *d = data; -	yahoo_write_ready( d->id, d->fd, d->data ); -	 -	return FALSE; +	return yahoo_write_ready( d->id, d->fd, d->data );  }  void ext_yahoo_login_response( int id, int succ, const char *url ) @@ -921,11 +939,18 @@ void ext_yahoo_chat_yahooerror( int id, const char *me )  {  } +void ext_yahoo_contact_auth_request( int id, const char *myid, const char *who, const char *msg ) +{ +	struct im_connection *ic = byahoo_get_ic_by_id( id ); +	 +	imcb_ask_auth( ic, who, NULL ); +} +  void ext_yahoo_contact_added( int id, const char *myid, const char *who, const char *msg )  { -	/* Groups schmoups. If I want to handle groups properly I can get the -	   buddy data from some internal libyahoo2 structure. */ -	imcb_add_buddy( byahoo_get_ic_by_id( id ), (char*) who, NULL ); +	struct im_connection *ic = byahoo_get_ic_by_id( id ); +	 +	imcb_add_buddy( ic, (char*) who, NULL );  }  void ext_yahoo_rejected( int id, const char *who, const char *msg ) | 
