Changeset 46dca11 for protocols/msn/sb.c


Ignore:
Timestamp:
2008-01-06T12:32:27Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
43462708
Parents:
1febf5c
Message:

Changed warning message about unsent MSN messages. It should show the actual
message(s) now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/sb.c

    r1febf5c r46dca11  
    128128                if( strcmp( text, TYPING_NOTIFICATION_MESSAGE ) != 0 )
    129129                {
    130                         buf = g_new0( char, sizeof( MSN_MESSAGE_HEADERS ) + strlen( text ) * 2 );
     130                        buf = g_new0( char, sizeof( MSN_MESSAGE_HEADERS ) + strlen( text ) * 2 + 1 );
    131131                        i = strlen( MSN_MESSAGE_HEADERS );
    132132                       
     
    207207        debug( "Destroying switchboard: %s", sb->who ? sb->who : sb->key ? sb->key : "" );
    208208       
    209         if( sb->msgq )
    210         {
    211                 struct msn_message *m;
    212                 GSList *l;
    213                
    214                 for( l = sb->msgq; l; l = l->next )
    215                 {
    216                         m = l->data;
    217 
    218                         g_free( m->who );
    219                         g_free( m->text );
    220                         g_free( m );
    221                 }
    222                 g_slist_free( sb->msgq );
    223                
    224                 imcb_log( ic, "Warning: Closing down MSN switchboard connection with "
    225                                    "unsent message to %s, you'll have to resend it.",
    226                                    sb->who ? sb->who : "(unknown)" );
    227         }
     209        msn_msgq_purge( ic, &sb->msgq );
    228210       
    229211        if( sb->key ) g_free( sb->key );
     
    266248        if( source != sb->fd )
    267249        {
    268                 debug( "ERROR %d while connecting to switchboard server", 1 );
     250                debug( "Error %d while connecting to switchboard server", 1 );
    269251                msn_sb_destroy( sb );
    270252                return FALSE;
     
    287269                sb->inp = b_input_add( sb->fd, GAIM_INPUT_READ, msn_sb_callback, sb );
    288270        else
    289                 debug( "ERROR %d while connecting to switchboard server", 2 );
     271                debug( "Error %d while connecting to switchboard server", 2 );
    290272       
    291273        return FALSE;
     
    298280        if( msn_handler( sb->handler ) == -1 )
    299281        {
    300                 debug( "ERROR: Switchboard died" );
     282                debug( "Error: Switchboard died" );
    301283                msn_sb_destroy( sb );
    302284               
     
    555537                        if( sb->who )
    556538                        {
    557                                 struct msn_message *m;
    558                                 GSList *l;
    559                                
    560539                                /* Apparently some invitation failed. We might want to use this
    561540                                   board later, so keep it as a spare. */
     
    564543                               
    565544                                /* Also clear the msgq, otherwise someone else might get them. */
    566                                 for( l = sb->msgq; l; l = l->next )
    567                                 {
    568                                         m = l->data;
    569                                         g_free( m->who );
    570                                         g_free( m->text );
    571                                         g_free( m );
    572                                 }
    573                                 g_slist_free( sb->msgq );
    574                                 sb->msgq = NULL;
     545                                msn_msgq_purge( ic, &sb->msgq );
    575546                        }
    576547                       
Note: See TracChangeset for help on using the changeset viewer.