Changeset 3330468 for protocols/msn


Ignore:
Timestamp:
2010-03-14T23:15:05Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
81ee561
Parents:
7c5affca (diff), 7e2b593 (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 in head.

Location:
protocols/msn
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.c

    r7c5affca r3330468  
    2626#include "nogaim.h"
    2727#include "msn.h"
     28
     29int msn_chat_id;
     30GSList *msn_connections;
     31GSList *msn_switchboards;
    2832
    2933static char *msn_set_display_name( set_t *set, char *value );
  • protocols/msn/msn.h

    r7c5affca r3330468  
    135135#define STATUS_SB_CHAT_SPARE    8       /* Same, but also for groupchats (not used yet). */
    136136
    137 int msn_chat_id;
     137extern int msn_chat_id;
    138138extern const struct msn_away_state msn_away_state_list[];
    139139extern const struct msn_status_code msn_status_code_list[];
     
    144144   connection), the callback should check whether it's still listed here
    145145   before doing *anything* else. */
    146 GSList *msn_connections;
    147 GSList *msn_switchboards;
     146extern GSList *msn_connections;
     147extern GSList *msn_switchboards;
    148148
    149149/* ns.c */
  • protocols/msn/msn_util.c

    r7c5affca r3330468  
    171171               
    172172                /* End of headers? */
    173                 if( strncmp( text + i - 2, "\n\n", 2 ) == 0 ||
    174                     strncmp( text + i - 4, "\r\n\r\n", 4 ) == 0 ||
    175                     strncmp( text + i - 2, "\r\r", 2 ) == 0 )
     173                if( ( i >= 4 && strncmp( text + i - 4, "\r\n\r\n", 4 ) == 0 ) ||
     174                    ( i >= 2 && ( strncmp( text + i - 2, "\n\n", 2 ) == 0 ||   
     175                                  strncmp( text + i - 2, "\r\r", 2 ) == 0 ) ) )
    176176                {
    177177                        break;
  • protocols/msn/ns.c

    r7c5affca r3330468  
    229229                        }
    230230                }
    231                 else if( num_parts == 7 && strcmp( cmd[2], "OK" ) == 0 )
     231                else if( num_parts >= 7 && strcmp( cmd[2], "OK" ) == 0 )
    232232                {
    233233                        set_t *s;
    234234                       
    235                         http_decode( cmd[4] );
    236                        
    237                         strncpy( ic->displayname, cmd[4], sizeof( ic->displayname ) );
    238                         ic->displayname[sizeof(ic->displayname)-1] = 0;
    239                        
    240                         if( ( s = set_find( &ic->acc->set, "display_name" ) ) )
    241                         {
    242                                 g_free( s->value );
    243                                 s->value = g_strdup( cmd[4] );
     235                        if( num_parts == 7 )
     236                        {
     237                                http_decode( cmd[4] );
     238                               
     239                                strncpy( ic->displayname, cmd[4], sizeof( ic->displayname ) );
     240                                ic->displayname[sizeof(ic->displayname)-1] = 0;
     241                               
     242                                if( ( s = set_find( &ic->acc->set, "display_name" ) ) )
     243                                {
     244                                        g_free( s->value );
     245                                        s->value = g_strdup( cmd[4] );
     246                                }
     247                        }
     248                        else
     249                        {
     250                                imcb_log( ic, "Warning: Friendly name in server response was corrupted" );
    244251                        }
    245252                       
Note: See TracChangeset for help on using the changeset viewer.