aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/yahoo/yahoo.c
diff options
context:
space:
mode:
authorSven Moritz Hallberg <pesco@khjk.org>2010-06-03 12:31:46 +0200
committerSven Moritz Hallberg <pesco@khjk.org>2010-06-03 12:31:46 +0200
commit3f81999c20852f14a5fb27a6ef6c5ea44db61a4d (patch)
tree14fa6a79d444049e758be853277270117e11692b /protocols/yahoo/yahoo.c
parentfc34fb5d0b717d90edfc7ed78f11166eb23c536e (diff)
parent2e44b1f12fb58a6969a8fbaf2946d6ecdace484a (diff)
merge in bitlbee 1.2.4
Diffstat (limited to 'protocols/yahoo/yahoo.c')
-rw-r--r--protocols/yahoo/yahoo.c65
1 files changed, 45 insertions, 20 deletions
diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c
index 5aa5033c..40ecf347 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);
@@ -373,6 +390,9 @@ void byahoo_initmodule( )
ret->handle_cmp = g_strcasecmp;
+ ret->auth_allow = byahoo_auth_allow;
+ ret->auth_deny = byahoo_auth_deny;
+
register_protocol(ret);
}
@@ -452,9 +472,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 )
@@ -922,11 +940,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 )