Changeset d8d63a2 for protocols/yahoo


Ignore:
Timestamp:
2006-12-05T20:40:17Z (18 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
7740c4c
Parents:
f4aa393 (diff), 55078f5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

[merge] wilmer

Location:
protocols/yahoo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/yahoo/libyahoo2.c

    rf4aa393 rd8d63a2  
    8989#define vsnprintf _vsnprintf
    9090#endif
     91
     92#include "base64.h"
    9193
    9294#ifdef USE_STRUCT_CALLBACKS
     
    695697}
    696698
    697 static char base64digits[] =    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    698                                 "abcdefghijklmnopqrstuvwxyz"
    699                                 "0123456789._";
     699/* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */
    700700static void to_y64(unsigned char *out, const unsigned char *in, int inlen)
    701 /* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */
    702 {
    703         for (; inlen >= 3; inlen -= 3)
    704                 {
    705                         *out++ = base64digits[in[0] >> 2];
    706                         *out++ = base64digits[((in[0]<<4) & 0x30) | (in[1]>>4)];
    707                         *out++ = base64digits[((in[1]<<2) & 0x3c) | (in[2]>>6)];
    708                         *out++ = base64digits[in[2] & 0x3f];
    709                         in += 3;
    710                 }
    711         if (inlen > 0)
    712                 {
    713                         unsigned char fragment;
    714 
    715                         *out++ = base64digits[in[0] >> 2];
    716                         fragment = (in[0] << 4) & 0x30;
    717                         if (inlen > 1)
    718                                 fragment |= in[1] >> 4;
    719                         *out++ = base64digits[fragment];
    720                         *out++ = (inlen < 2) ? '-'
    721                                         : base64digits[(in[1] << 2) & 0x3c];
    722                         *out++ = '-';
    723                 }
    724         *out = '\0';
     701{
     702        base64_encode_real(in, inlen, out, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-");
    725703}
    726704
  • protocols/yahoo/yahoo.c

    rf4aa393 rd8d63a2  
    121121}
    122122
    123 static void byahoo_login( struct aim_user *user )
    124 {
    125         struct gaim_connection *gc = new_gaim_conn( user );
     123static void byahoo_login( account_t *acc )
     124{
     125        struct gaim_connection *gc = new_gaim_conn( acc );
    126126        struct byahoo_data *yd = gc->proto_data = g_new0( struct byahoo_data, 1 );
    127127       
     
    130130       
    131131        set_login_progress( gc, 1, "Connecting" );
    132         yd->y2_id = yahoo_init( user->username, user->password );
     132        yd->y2_id = yahoo_init( acc->user, acc->pass );
    133133        yahoo_login( yd->y2_id, yd->current_status );
    134134}
     
    192192        gc->away = NULL;
    193193       
    194         if( msg )
     194        if( state && msg && g_strcasecmp( state, msg ) != 0 )
    195195        {
    196196                yd->current_status = YAHOO_STATUS_CUSTOM;
    197197                gc->away = "";
    198198        }
    199         if( state )
    200         {
     199        else if( state )
     200        {
     201                /* Set msg to NULL since (if it isn't NULL already) it's equal
     202                   to state. msg must be empty if we want to use an existing
     203                   away state. */
     204                msg = NULL;
     205               
    201206                gc->away = "";
    202207                if( g_strcasecmp( state, "Available" ) == 0 )
     
    235240                yd->current_status = YAHOO_STATUS_AVAILABLE;
    236241       
    237         if( yd->current_status == YAHOO_STATUS_INVISIBLE )
    238                 yahoo_set_away( yd->y2_id, yd->current_status, NULL, gc->away != NULL );
    239         else
    240                 yahoo_set_away( yd->y2_id, yd->current_status, msg, gc->away != NULL );
     242        yahoo_set_away( yd->y2_id, yd->current_status, msg, gc->away != NULL );
    241243}
    242244
     
    409411        ret->chat_leave = byahoo_chat_leave;
    410412        ret->chat_open = byahoo_chat_open;
    411         ret->cmp_buddynames = g_strcasecmp;
     413
     414        ret->handle_cmp = g_strcasecmp;
    412415       
    413416        register_protocol(ret);
     
    425428                yd = gc->proto_data;
    426429               
    427                 if( !strcmp(gc->prpl->name, "yahoo") && yd->y2_id == id )
     430                if( strcmp( gc->acc->prpl->name, "yahoo" ) == 0 && yd->y2_id == id )
    428431                        return( gc );
    429432        }
Note: See TracChangeset for help on using the changeset viewer.