diff options
Diffstat (limited to 'protocols/yahoo/yahoo.c')
-rw-r--r-- | protocols/yahoo/yahoo.c | 111 |
1 files changed, 56 insertions, 55 deletions
diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c index bf577496..7a856254 100644 --- a/protocols/yahoo/yahoo.c +++ b/protocols/yahoo/yahoo.c @@ -1,7 +1,7 @@ /* * libyahoo2 wrapper to BitlBee * - * Mostly Copyright 2004 Wilmer van der Gaast <wilmer@gaast.net> + * Mostly Copyright 2004-2010 Wilmer van der Gaast <wilmer@gaast.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -338,16 +338,20 @@ static struct groupchat *byahoo_chat_with( struct im_connection *ic, char *who ) 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( ) @@ -420,7 +424,7 @@ void byahoo_connect_callback( gpointer data, gint source, b_input_condition cond return; } - d->callback( d->fd, 0, d->data ); + d->callback( NULL + d->fd, 0, d->data ); g_free( d ); } @@ -440,7 +444,7 @@ gboolean byahoo_read_ready_callback( gpointer data, gint source, b_input_conditi /* WTF doesn't libyahoo clean this up? */ return FALSE; - yahoo_read_ready( d->id, d->fd, d->data ); + yahoo_read_ready( d->id, NULL + d->fd, d->data ); return TRUE; } @@ -457,7 +461,7 @@ gboolean byahoo_write_ready_callback( gpointer data, gint source, b_input_condit { struct byahoo_write_ready_data *d = data; - return yahoo_write_ready( d->id, d->fd, d->data ); + return yahoo_write_ready( d->id, NULL + d->fd, d->data ); } void ext_yahoo_login_response( int id, int succ, const char *url ) @@ -605,9 +609,6 @@ void ext_yahoo_status_changed( int id, const char *who, int stat, const char *ms state_string = "Offline"; flags = 0; break; - case YAHOO_STATUS_NOTIFY: - state_string = "Notify"; - break; } imcb_buddy_status( ic, who, flags, state_string, msg ); @@ -616,6 +617,10 @@ void ext_yahoo_status_changed( int id, const char *who, int stat, const char *ms imcb_buddy_times( ic, who, 0, idle ); } +void ext_yahoo_got_buzz( int id, const char *me, const char *who, long tm ) +{ +} + void ext_yahoo_got_im( int id, const char *me, const char *who, const char *msg, long tm, int stat, int utf8 ) { struct im_connection *ic = byahoo_get_ic_by_id( id ); @@ -629,15 +634,22 @@ void ext_yahoo_got_im( int id, const char *me, const char *who, const char *msg, } } -void ext_yahoo_got_file( int id, - const char *ignored, - const char *who, const char *url, long expires, const char *msg, const char *fname, unsigned long fesize ) +void ext_yahoo_got_file( int id, const char *ignored, const char *who, const char *msg, + const char *fname, unsigned long fesize, char *trid ) { struct im_connection *ic = byahoo_get_ic_by_id( id ); imcb_log( ic, "Got a file transfer (file = %s) from %s. Ignoring for now due to lack of support.", fname, who ); } +void ext_yahoo_got_ft_data( int id, const unsigned char *in, int len, void *data ) +{ +} + +void ext_yahoo_file_transfer_done( int id, int result, void *data ) +{ +} + void ext_yahoo_typing_notify( int id, const char *ignored, const char *who, int stat ) { struct im_connection *ic = byahoo_get_ic_by_id( id ); @@ -648,7 +660,7 @@ void ext_yahoo_typing_notify( int id, const char *ignored, const char *who, int imcb_buddy_typing( ic, (char*) who, 0 ); } -void ext_yahoo_system_message( int id, const char *msg ) +void ext_yahoo_system_message( int id, const char *me, const char *who, const char *msg ) { struct im_connection *ic = byahoo_get_ic_by_id( id ); @@ -670,9 +682,10 @@ void ext_yahoo_error( int id, const char *err, int fatal, int num ) } /* TODO: Clear up the mess of inp and d structures */ -int ext_yahoo_add_handler( int id, int fd, yahoo_input_condition cond, void *data ) +int ext_yahoo_add_handler( int id, void *fd_, yahoo_input_condition cond, void *data ) { struct byahoo_input_data *inp = g_new0( struct byahoo_input_data, 1 ); + int fd = (int) fd_; if( cond == YAHOO_INPUT_READ ) { @@ -699,12 +712,12 @@ int ext_yahoo_add_handler( int id, int fd, yahoo_input_condition cond, void *dat else { g_free( inp ); - return( -1 ); + return -1; /* Panic... */ } byahoo_inputs = g_slist_append( byahoo_inputs, inp ); - return( inp->h ); + return inp->h; } void ext_yahoo_remove_handler( int id, int tag ) @@ -728,7 +741,7 @@ void ext_yahoo_remove_handler( int id, int tag ) b_event_remove( tag ); } -int ext_yahoo_connect_async( int id, const char *host, int port, yahoo_connect_callback callback, void *data ) +int ext_yahoo_connect_async( int id, const char *host, int port, yahoo_connect_callback callback, void *data, int use_ssl ) { struct byahoo_connect_callback_data *d; int fd; @@ -744,48 +757,38 @@ int ext_yahoo_connect_async( int id, const char *host, int port, yahoo_connect_c d->data = data; d->id = id; - return( fd ); + return fd; } -/* Because we don't want asynchronous connects in BitlBee, and because - libyahoo doesn't seem to use this one anyway, this one is now defunct. */ -int ext_yahoo_connect(const char *host, int port) +char *ext_yahoo_get_ip_addr( const char *domain ) { -#if 0 - struct sockaddr_in serv_addr; - static struct hostent *server; - static char last_host[256]; - int servfd; - char **p; + return NULL; +} - if(last_host[0] || g_strcasecmp(last_host, host)!=0) { - if(!(server = gethostbyname(host))) { - return -1; - } - strncpy(last_host, host, 255); - } +int ext_yahoo_write( void *fd, char *buf, int len ) +{ + return write( (int) fd, buf, len ); +} - if((servfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - return -1; - } +int ext_yahoo_read( void *fd, char *buf, int len ) +{ + return read( (int) fd, buf, len ); +} - for (p = server->h_addr_list; *p; p++) - { - memset(&serv_addr, 0, sizeof(serv_addr)); - serv_addr.sin_family = AF_INET; - memcpy(&serv_addr.sin_addr.s_addr, *p, server->h_length); - serv_addr.sin_port = htons(port); - - if(connect(servfd, (struct sockaddr *) &serv_addr, - sizeof(serv_addr)) == -1) { - return -1; - } else { - return servfd; - } - } +void ext_yahoo_close( void *fd ) +{ + close( (int) fd ); +} + +void ext_yahoo_got_buddy_change_group( int id, const char *me, const char *who, + const char *old_group, const char *new_group ) +{ +} - closesocket(servfd); -#endif +/* Because we don't want asynchronous connects in BitlBee, and because + libyahoo doesn't seem to use this one anyway, this one is now defunct. */ +int ext_yahoo_connect(const char *host, int port) +{ return -1; } @@ -897,7 +900,7 @@ void ext_yahoo_chat_cat_xml( int id, const char *xml ) { } -void ext_yahoo_chat_join( int id, const char *who, const char *room, const char *topic, YList *members, int fd ) +void ext_yahoo_chat_join( int id, const char *who, const char *room, const char *topic, YList *members, void *fd ) { } @@ -927,9 +930,7 @@ 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 ); + /* Apparently no longer implemented.. */ } void ext_yahoo_contact_added( int id, const char *myid, const char *who, const char *msg ) @@ -943,7 +944,7 @@ void ext_yahoo_rejected( int id, const char *who, const char *msg ) { } -void ext_yahoo_game_notify( int id, const char *me, const char *who, int stat ) +void ext_yahoo_game_notify( int id, const char *me, const char *who, int stat, const char *msg ) { } |