diff options
| -rw-r--r-- | protocols/msn/msn.h | 2 | ||||
| -rw-r--r-- | protocols/msn/sb.c | 26 | ||||
| -rw-r--r-- | protocols/msn/tables.c | 8 | 
3 files changed, 31 insertions, 5 deletions
| diff --git a/protocols/msn/msn.h b/protocols/msn/msn.h index 61231d8a..c8c7a788 100644 --- a/protocols/msn/msn.h +++ b/protocols/msn/msn.h @@ -126,6 +126,8 @@ struct msn_handler_data  /* Bitfield values for msn_status_code.flags */  #define STATUS_FATAL            1  #define STATUS_SB_FATAL         2 +#define STATUS_SB_IM_SPARE	4	/* Make one-to-one conversation switchboard available again, invite failed. */ +#define STATUS_SB_CHAT_SPARE	8	/* Same, but also for groupchats (not used yet). */  int msn_chat_id;  extern struct msn_away_state msn_away_state_list[]; diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c index 2f4d05d5..11728f03 100644 --- a/protocols/msn/sb.c +++ b/protocols/msn/sb.c @@ -521,11 +521,35 @@ static int msn_sb_command( gpointer data, char **cmd, int num_parts )  			msn_sb_destroy( sb );  			return( 0 );  		} -		else if( err->flags & STATUS_FATAL ) +		if( err->flags & STATUS_FATAL )  		{  			signoff( gc );  			return( 0 );  		} +		if( err->flags & STATUS_SB_IM_SPARE ) +		{ +			if( sb->who ) +			{ +				struct msn_message *m; +				GSList *l; +				 +				/* Apparently some invitation failed. We might want to use this +				   board later, so keep it as a spare. */ +				g_free( sb->who ); +				sb->who = NULL; +				 +				/* Also clear the msgq, otherwise someone else might get them. */ +				for( l = sb->msgq; l; l = l->next ) +				{ +					m = l->data; +					g_free( m->who ); +					g_free( m->text ); +					g_free( m ); +				} +				g_slist_free( sb->msgq ); +				sb->msgq = NULL; +			} +		}  	}  	else  	{ diff --git a/protocols/msn/tables.c b/protocols/msn/tables.c index 0cd80c01..2741048a 100644 --- a/protocols/msn/tables.c +++ b/protocols/msn/tables.c @@ -79,12 +79,12 @@ struct msn_status_code msn_status_code_list[] =  	{ 205, "Invalid (non-existent) handle",                         0 },  	{ 206, "Domain name missing",                                   0 },  	{ 207, "Already logged in",                                     0 }, -	{ 208, "Invalid handle",                                        0 }, +	{ 208, "Invalid handle",                                        STATUS_SB_IM_SPARE },  	{ 209, "Forbidden nickname",                                    0 },  	{ 210, "Buddy list too long",                                   0 },  	{ 215, "Handle is already in list",                             0 }, -	{ 216, "Handle is not in list",                                 0 }, -	{ 217, "Person is off-line or non-existent",                    0 }, +	{ 216, "Handle is not in list",                                 STATUS_SB_IM_SPARE }, +	{ 217, "Person is off-line or non-existent",                    STATUS_SB_IM_SPARE },  	{ 218, "Already in that mode",                                  0 },  	{ 219, "Handle is already in opposite list",                    0 },  	{ 223, "Too many groups",                                       0 }, @@ -117,7 +117,7 @@ struct msn_status_code msn_status_code_list[] =  	{ 710, "Invalid CVR parameters",                                STATUS_FATAL },  	{ 711, "Write is blocking",                                     STATUS_FATAL },  	{ 712, "Session is overloaded",                                 STATUS_FATAL }, -	{ 713, "Calling too rapidly",                                   0 }, +	{ 713, "Calling too rapidly",                                   STATUS_SB_IM_SPARE },  	{ 714, "Too many sessions",                                     STATUS_FATAL },  	{ 715, "Not expected/Invalid argument/action",                  0 },  	{ 717, "Bad friend file",                                       STATUS_FATAL }, | 
