Changeset 3b9390b for protocols/msn


Ignore:
Timestamp:
2005-12-18T10:39:13Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
578d627
Parents:
43f205b
Message:

When trying to talk to MSN people who are offline, the switchboard gets reset to a spare correctly.
This fixes a problem with messages to MSN people not arriving sometimes.

Location:
protocols/msn
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.h

    r43f205b r3b9390b  
    127127#define STATUS_FATAL            1
    128128#define STATUS_SB_FATAL         2
     129#define STATUS_SB_IM_SPARE      4       /* Make one-to-one conversation switchboard available again, invite failed. */
     130#define STATUS_SB_CHAT_SPARE    8       /* Same, but also for groupchats (not used yet). */
    129131
    130132int msn_chat_id;
  • protocols/msn/sb.c

    r43f205b r3b9390b  
    522522                        return( 0 );
    523523                }
    524                 else if( err->flags & STATUS_FATAL )
     524                if( err->flags & STATUS_FATAL )
    525525                {
    526526                        signoff( gc );
    527527                        return( 0 );
     528                }
     529                if( err->flags & STATUS_SB_IM_SPARE )
     530                {
     531                        if( sb->who )
     532                        {
     533                                struct msn_message *m;
     534                                GSList *l;
     535                               
     536                                /* Apparently some invitation failed. We might want to use this
     537                                   board later, so keep it as a spare. */
     538                                g_free( sb->who );
     539                                sb->who = NULL;
     540                               
     541                                /* Also clear the msgq, otherwise someone else might get them. */
     542                                for( l = sb->msgq; l; l = l->next )
     543                                {
     544                                        m = l->data;
     545                                        g_free( m->who );
     546                                        g_free( m->text );
     547                                        g_free( m );
     548                                }
     549                                g_slist_free( sb->msgq );
     550                                sb->msgq = NULL;
     551                        }
    528552                }
    529553        }
  • protocols/msn/tables.c

    r43f205b r3b9390b  
    8080        { 206, "Domain name missing",                                   0 },
    8181        { 207, "Already logged in",                                     0 },
    82         { 208, "Invalid handle",                                        0 },
     82        { 208, "Invalid handle",                                        STATUS_SB_IM_SPARE },
    8383        { 209, "Forbidden nickname",                                    0 },
    8484        { 210, "Buddy list too long",                                   0 },
    8585        { 215, "Handle is already in list",                             0 },
    86         { 216, "Handle is not in list",                                 0 },
    87         { 217, "Person is off-line or non-existent",                    0 },
     86        { 216, "Handle is not in list",                                 STATUS_SB_IM_SPARE },
     87        { 217, "Person is off-line or non-existent",                    STATUS_SB_IM_SPARE },
    8888        { 218, "Already in that mode",                                  0 },
    8989        { 219, "Handle is already in opposite list",                    0 },
     
    118118        { 711, "Write is blocking",                                     STATUS_FATAL },
    119119        { 712, "Session is overloaded",                                 STATUS_FATAL },
    120         { 713, "Calling too rapidly",                                   0 },
     120        { 713, "Calling too rapidly",                                   STATUS_SB_IM_SPARE },
    121121        { 714, "Too many sessions",                                     STATUS_FATAL },
    122122        { 715, "Not expected/Invalid argument/action",                  0 },
Note: See TracChangeset for help on using the changeset viewer.