Changeset f8cb76d for protocols/msn


Ignore:
Timestamp:
2010-05-11T21:33:37Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
3742fb6
Parents:
e73a501
Message:

Stop those "Many switchboard failures" messages. No point in showing them
unless the lost switchboard actually had something queued.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/sb.c

    re73a501 rf8cb76d  
    328328        struct msn_data *md = ic->proto_data;
    329329       
    330         if( msn_handler( sb->handler ) == -1 )
     330        if( msn_handler( sb->handler ) != -1 )
     331                return TRUE;
     332       
     333        if( sb->msgq != NULL )
    331334        {
    332335                time_t now = time( NULL );
     336                char buf[1024];
    333337               
    334338                if( now - md->first_sb_failure > 600 )
     
    347351                                      "There might be problems delivering your messages." );
    348352               
    349                 if( sb->msgq != NULL )
    350                 {
    351                         char buf[1024];
    352                        
    353                         if( md->msgq == NULL )
    354                         {
    355                                 md->msgq = sb->msgq;
    356                         }
    357                         else
    358                         {
    359                                 GSList *l;
    360                                
    361                                 for( l = md->msgq; l->next; l = l->next );
    362                                 l->next = sb->msgq;
    363                         }
    364                         sb->msgq = NULL;
    365                        
    366                         debug( "Moved queued messages back to the main queue, creating a new switchboard to retry." );
    367                         g_snprintf( buf, sizeof( buf ), "XFR %d SB\r\n", ++md->trId );
    368                         if( !msn_write( ic, buf, strlen( buf ) ) )
    369                                 return FALSE;
    370                 }
    371                
    372                 msn_sb_destroy( sb );
    373                
    374                 return FALSE;
    375         }
    376         else
    377         {
    378                 return TRUE;
    379         }
     353                if( md->msgq == NULL )
     354                {
     355                        md->msgq = sb->msgq;
     356                }
     357                else
     358                {
     359                        GSList *l;
     360                       
     361                        for( l = md->msgq; l->next; l = l->next );
     362                        l->next = sb->msgq;
     363                }
     364                sb->msgq = NULL;
     365               
     366                debug( "Moved queued messages back to the main queue, "
     367                       "creating a new switchboard to retry." );
     368                g_snprintf( buf, sizeof( buf ), "XFR %d SB\r\n", ++md->trId );
     369                if( !msn_write( ic, buf, strlen( buf ) ) )
     370                        return FALSE;
     371        }
     372       
     373        msn_sb_destroy( sb );
     374        return FALSE;
    380375}
    381376
Note: See TracChangeset for help on using the changeset viewer.