Changeset 93b7bd4


Ignore:
Timestamp:
2006-10-15T09:34:02Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
ee5c355
Parents:
7e83adca (diff), e97827b (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:

Merging from devel and storage-xml.

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • lib/rc4.c

    r7e83adca r93b7bd4  
    66*  Copyright 2006 Wilmer van der Gaast <wilmer@gaast.net>                   *
    77*                                                                           *
    8 *  This program is free software; you can redistribute it and/or modify     *
    9 it under the terms of the GNU General Public License as published by     *
    10 the Free Software Foundation; either version 2 of the License, or        *
    11 (at your option) any later version.                                      *
     8*  This library is free software; you can redistribute it and/or            *
     9modify it under the terms of the GNU Lesser General Public               *
     10License as published by the Free Software Foundation, version            *
     112.1.                                                                     *
    1212*                                                                           *
    13 *  This program is distributed in the hope that it will be useful,          *
     13*  This library is distributed in the hope that it will be useful,          *
    1414*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
    15 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            *
    16 GNU General Public License for more details.                             *
     15*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        *
     16Lesser General Public License for more details.                          *
    1717*                                                                           *
    18 *  You should have received a copy of the GNU General Public License along *
    19 with this program; if not, write to the Free Software Foundation, Inc.,  *
    20 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.              *
     18*  You should have received a copy of the GNU Lesser General Public License *
     19along with this library; if not, write to the Free Software Foundation,  *
     20Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA           *
    2121*                                                                           *
    2222\***************************************************************************/
  • protocols/msn/msn.c

    r7e83adca r93b7bd4  
    367367        struct gaim_connection *gc = acc->gc;
    368368        struct msn_data *md;
    369         char buf[1024], *fn, *s;
     369        char buf[1024], *fn;
    370370        int i;
    371371       
     
    382382        }
    383383       
    384         /* Of course we could use http_encode() here, but when we encode
    385            every character, the server is less likely to complain about the
    386            chosen name. However, the MSN server doesn't seem to like escaped
    387            non-ASCII chars, so we keep those unescaped. */
    388         s = fn = g_new0( char, strlen( value ) * 3 + 1 );
    389         for( i = 0; value[i]; i ++ )
    390                 if( value[i] & 128 )
    391                 {
    392                         *s = value[i];
    393                         s ++;
    394                 }
    395                 else
    396                 {
    397                         g_snprintf( s, 4, "%%%02X", value[i] );
    398                         s += 3;
    399                 }
     384        fn = msn_http_encode( value );
    400385       
    401386        g_snprintf( buf, sizeof( buf ), "REA %d %s %s\r\n", ++md->trId, gc->username, fn );
  • protocols/msn/msn.h

    r7e83adca r93b7bd4  
    157157char **msn_linesplit( char *line );
    158158int msn_handler( struct msn_handler_data *h );
     159char *msn_http_encode( const char *input );
    159160
    160161/* tables.c */
  • protocols/msn/msn_util.c

    r7e83adca r93b7bd4  
    5454{
    5555        struct msn_data *md = gc->proto_data;
    56         GSList *l, **lp = NULL;
    5756        char buf[1024], *realname;
    5857       
    59         if( strcmp( list, "AL" ) == 0 )
    60                 lp = &gc->permit;
    61         else if( strcmp( list, "BL" ) == 0 )
    62                 lp = &gc->deny;
    63        
    64         if( lp )
    65                 for( l = *lp; l; l = l->next )
    66                         if( g_strcasecmp( l->data, who ) == 0 )
    67                                 return( 1 );
    68        
    69         realname = g_new0( char, strlen( realname_ ) * 3 + 1 );
    70         strcpy( realname, realname_ );
    71         http_encode( realname );
     58        realname = msn_http_encode( realname_ );
    7259       
    7360        g_snprintf( buf, sizeof( buf ), "ADD %d %s %s %s\r\n", ++md->trId, list, who, realname );
     
    7663                g_free( realname );
    7764               
    78                 if( lp )
    79                         *lp = g_slist_append( *lp, g_strdup( who ) );
    80                
    8165                return( 1 );
    8266        }
     
    9074{
    9175        struct msn_data *md = gc->proto_data;
    92         GSList *l = NULL, **lp = NULL;
    9376        char buf[1024];
    94        
    95         if( strcmp( list, "AL" ) == 0 )
    96                 lp = &gc->permit;
    97         else if( strcmp( list, "BL" ) == 0 )
    98                 lp = &gc->deny;
    99        
    100         if( lp )
    101         {
    102                 for( l = *lp; l; l = l->next )
    103                         if( g_strcasecmp( l->data, who ) == 0 )
    104                                 break;
    105                
    106                 if( !l )
    107                         return( 1 );
    108         }
    10977       
    11078        g_snprintf( buf, sizeof( buf ), "REM %d %s %s\r\n", ++md->trId, list, who );
    11179        if( msn_write( gc, buf, strlen( buf ) ) )
    112         {
    113                 if( lp )
    114                         *lp = g_slist_remove( *lp, l->data );
    115                
    11680                return( 1 );
    117         }
    11881       
    11982        return( 0 );
     
    350313        return( 1 );
    351314}
     315
     316/* The difference between this function and the normal http_encode() function
     317   is that this one escapes every 7-bit ASCII character because this is said
     318   to avoid some lame server-side checks when setting a real-name. Also,
     319   non-ASCII characters are not escaped because MSN servers don't seem to
     320   appreciate that! */
     321char *msn_http_encode( const char *input )
     322{
     323        char *ret, *s;
     324        int i;
     325       
     326        ret = s = g_new0( char, strlen( input ) * 3 + 1 );
     327        for( i = 0; input[i]; i ++ )
     328                if( input[i] & 128 )
     329                {
     330                        *s = input[i];
     331                        s ++;
     332                }
     333                else
     334                {
     335                        g_snprintf( s, 4, "%%%02X", input[i] );
     336                        s += 3;
     337                }
     338       
     339        return ret;
     340}
  • protocols/msn/passport.c

    r7e83adca r93b7bd4  
    5959        rep->data = data;
    6060        rep->func = func;
     61        rep->header = header;
    6162       
    6263        server = g_strdup( prd_cached );
     
    125126static char *passport_create_header( char *cookie, char *email, char *pwd )
    126127{
    127         char *buffer = g_new0( char, 2048 );
     128        char *buffer;
    128129        char *currenttoken;
    129130        char *email_enc, *pwd_enc;
     131       
     132        currenttoken = strstr( cookie, "lc=" );
     133        if( currenttoken == NULL )
     134                return NULL;
    130135       
    131136        email_enc = g_new0( char, strlen( email ) * 3 + 1 );
     
    137142        http_encode( pwd_enc );
    138143       
    139         currenttoken = strstr( cookie, "lc=" );
    140         if( currenttoken == NULL )
    141                 return( NULL );
    142        
    143         g_snprintf( buffer, 2048,
    144                     "Authorization: Passport1.4 OrgVerb=GET,"
    145                     "OrgURL=http%%3A%%2F%%2Fmessenger%%2Emsn%%2Ecom,"
    146                     "sign-in=%s,pwd=%s,%s", email_enc, pwd_enc,
    147                     currenttoken );
     144        buffer = g_strdup_printf( "Authorization: Passport1.4 OrgVerb=GET,"
     145                                  "OrgURL=http%%3A%%2F%%2Fmessenger%%2Emsn%%2Ecom,"
     146                                  "sign-in=%s,pwd=%s,%s", email_enc, pwd_enc,
     147                                  currenttoken );
    148148       
    149149        g_free( email_enc );
    150150        g_free( pwd_enc );
    151151       
    152         return( buffer );
     152        return buffer;
    153153}
    154154
  • protocols/yahoo/yahoo.c

    r7e83adca r93b7bd4  
    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
  • root_commands.c

    r7e83adca r93b7bd4  
    573573        u->gc->acc->prpl->remove_buddy( u->gc, u->handle, NULL );
    574574        user_del( irc, cmd[1] );
    575         nick_del( u->gc->acc, u->handle );
     575        nick_del( u->gc->acc, s );
    576576       
    577577        irc_usermsg( irc, "Buddy `%s' (nick %s) removed from contact list", s, cmd[1] );
     
    656656               
    657657                irc_usermsg( irc, format, "Handle", "Nickname" );
    658                 for( l = a->gc->deny; l; l = l->next )
     658                for( l = a->gc->permit; l; l = l->next )
    659659                {
    660660                        user_t *u = user_findhandle( a->gc, l->data );
Note: See TracChangeset for help on using the changeset viewer.