From e5a8118236442d51eb202a8bdebe5866449554e4 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 20 Mar 2010 17:27:23 +0000 Subject: Added soap.c with a fairly reusable SOAP framework and simple code for sending offline messages. It works somewhat, just that Pidgin shows the messages as empty. :-( --- protocols/msn/sb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'protocols/msn/sb.c') diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c index e9526234..920e7f61 100644 --- a/protocols/msn/sb.c +++ b/protocols/msn/sb.c @@ -28,6 +28,7 @@ #include "msn.h" #include "passport.h" #include "md5.h" +#include "soap.h" static gboolean msn_sb_callback( gpointer data, gint source, b_input_condition cond ); static int msn_sb_command( gpointer data, char **cmd, int num_parts ); @@ -605,6 +606,17 @@ 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 ); + if( num == 217 ) + { + GSList *l; + + for( l = sb->msgq; l; l = l->next ) + { + struct msn_message *m = l->data; + msn_soap_oim_send( ic, m->who, m->text ); + } + } + imcb_error( ic, "Error reported by switchboard server: %s", err->text ); if( err->flags & STATUS_SB_FATAL ) -- cgit v1.2.3 From bc090f0c3bc243de277a8e04f906384838d95e35 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 20 Mar 2010 22:42:59 +0000 Subject: Error reporting and added a msgq_send function. Need to put some more intelligence into it later. --- protocols/msn/sb.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'protocols/msn/sb.c') diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c index 920e7f61..461bd483 100644 --- a/protocols/msn/sb.c +++ b/protocols/msn/sb.c @@ -606,18 +606,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 ); + /* If the person is offline, send an offline message instead, + and don't report an error. */ if( num == 217 ) - { - GSList *l; - - for( l = sb->msgq; l; l = l->next ) - { - struct msn_message *m = l->data; - msn_soap_oim_send( ic, m->who, m->text ); - } - } - - imcb_error( ic, "Error reported by switchboard server: %s", err->text ); + 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 ) { -- cgit v1.2.3