aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/msn/sb.c
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/msn/sb.c')
-rw-r--r--protocols/msn/sb.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c
index cb5789b8..fdad2882 100644
--- a/protocols/msn/sb.c
+++ b/protocols/msn/sb.c
@@ -1,7 +1,7 @@
/********************************************************************\
* BitlBee -- An IRC to other IM-networks gateway *
* *
- * Copyright 2002-2005 Wilmer van der Gaast and others *
+ * Copyright 2002-2010 Wilmer van der Gaast and others *
\********************************************************************/
/* MSN module - Switchboard server callbacks and utilities */
@@ -26,8 +26,8 @@
#include <ctype.h>
#include "nogaim.h"
#include "msn.h"
-#include "passport.h"
#include "md5.h"
+#include "soap.h"
#include "invitation.h"
static gboolean msn_sb_callback( gpointer data, gint source, b_input_condition cond );
@@ -38,6 +38,12 @@ int msn_sb_write( struct msn_switchboard *sb, char *s, int len )
{
int st;
+ if( getenv( "BITLBEE_DEBUG" ) )
+ {
+ write( 2, "->SB:", 5 );
+ write( 2, s, len );
+ }
+
st = write( sb->fd, s, len );
if( st != len )
{
@@ -406,7 +412,7 @@ static int msn_sb_command( gpointer data, char **cmd, int num_parts )
}
else if( strcmp( cmd[0], "USR" ) == 0 )
{
- if( num_parts != 5 )
+ if( num_parts < 5 )
{
msn_sb_destroy( sb );
return( 0 );
@@ -432,7 +438,7 @@ static int msn_sb_command( gpointer data, char **cmd, int num_parts )
{
int num, tot;
- if( num_parts != 6 )
+ if( num_parts < 6 )
{
msn_sb_destroy( sb );
return( 0 );
@@ -469,7 +475,7 @@ static int msn_sb_command( gpointer data, char **cmd, int num_parts )
}
else if( strcmp( cmd[0], "ANS" ) == 0 )
{
- if( num_parts != 3 )
+ if( num_parts < 3 )
{
msn_sb_destroy( sb );
return( 0 );
@@ -488,7 +494,7 @@ static int msn_sb_command( gpointer data, char **cmd, int num_parts )
}
else if( strcmp( cmd[0], "CAL" ) == 0 )
{
- if( num_parts != 4 || !isdigit( cmd[3][0] ) )
+ if( num_parts < 4 || !isdigit( cmd[3][0] ) )
{
msn_sb_destroy( sb );
return( 0 );
@@ -498,7 +504,7 @@ static int msn_sb_command( gpointer data, char **cmd, int num_parts )
}
else if( strcmp( cmd[0], "JOI" ) == 0 )
{
- if( num_parts != 3 )
+ if( num_parts < 3 )
{
msn_sb_destroy( sb );
return( 0 );
@@ -559,7 +565,7 @@ static int msn_sb_command( gpointer data, char **cmd, int num_parts )
}
else if( strcmp( cmd[0], "MSG" ) == 0 )
{
- if( num_parts != 4 )
+ if( num_parts < 4 )
{
msn_sb_destroy( sb );
return( 0 );
@@ -624,7 +630,12 @@ static int msn_sb_command( gpointer data, char **cmd, int num_parts )
int num = atoi( cmd[0] );
const struct msn_status_code *err = msn_status_by_number( num );
- imcb_error( ic, "Error reported by switchboard server: %s", err->text );
+ /* If the person is offline, send an offline message instead,
+ and don't report an error. */
+ if( num == 217 )
+ msn_soap_oim_send_queue( ic, &sb->msgq );
+ else
+ imcb_error( ic, "Error reported by switchboard server: %s", err->text );
if( err->flags & STATUS_SB_FATAL )
{