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/soap.h | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 protocols/msn/soap.h (limited to 'protocols/msn/soap.h') diff --git a/protocols/msn/soap.h b/protocols/msn/soap.h new file mode 100644 index 00000000..4e7d6627 --- /dev/null +++ b/protocols/msn/soap.h @@ -0,0 +1,85 @@ +/* soap.h + * + * SOAP-related functions. Some manager at Microsoft apparently thought + * MSNP wasn't XMLy enough so someone stepped up and changed that. This + * is the result. + * + * Copyright (C) 2010 Wilmer van der Gaast + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * This program is distributed in the hope that is will be useful, + * bit WITHOU ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* Thanks to http://msnpiki.msnfanatic.com/ for lots of info on this! */ + +#ifndef __SOAP_H__ +#define __SOAP_H__ + +#include +#include +#include +#include +#ifndef _WIN32 +#include +#include +#include +#include +#endif +#include "nogaim.h" + + +#define SOAP_HTTP_REQUEST \ +"POST %s HTTP/1.0\r\n" \ +"Host: %s\r\n" \ +"Accept: */*\r\n" \ +"SOAPAction: \"%s\"\r\n" \ +"User-Agent: BitlBee " BITLBEE_VERSION "\r\n" \ +"Content-Type: text/xml; charset=utf-8\r\n" \ +"Content-Length: %d\r\n" \ +"Cache-Control: no-cache\r\n" \ +"\r\n" \ +"%s" + + +#define SOAP_OIM_SEND_URL "https://ows.messenger.msn.com/OimWS/oim.asmx" +#define SOAP_OIM_ACTION_URL "http://messenger.msn.com/ws/2004/09/oim/Store" + +#define SOAP_OIM_SEND_PAYLOAD \ +"" \ +"" \ +"" \ + "" \ + "" \ + "" \ + "" \ + "http://messenger.msn.com" \ + "%d" \ + "" \ +"" \ +"" \ + "text" \ + "MIME-Version: 1.0\r\n" \ + "Content-Type: text/plain; charset=UTF-8\r\n" \ + "Content-Transfer-Encoding: base64\r\n" \ + "X-OIM-Message-Type: OfflineMessage\r\n" \ + "X-OIM-Run-Id: {89527393-8723-4F4F-8005-287532973298}\r\n" \ + "X-OIM-Sequence-Num: %d\r\n" \ + "\r\n" \ + "%s" \ + "" \ +"" \ +"" + +int msn_soap_oim_send( struct im_connection *ic, const char *to, const char *msg ); + +#endif /* __SOAP_H__ */ -- cgit v1.2.3 From ffb6dea650db7671d2414b1a9541cf0baba8ff11 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 20 Mar 2010 21:58:04 +0000 Subject: Killing some memory leaks. --- protocols/msn/soap.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'protocols/msn/soap.h') diff --git a/protocols/msn/soap.h b/protocols/msn/soap.h index 4e7d6627..687cc282 100644 --- a/protocols/msn/soap.h +++ b/protocols/msn/soap.h @@ -68,7 +68,8 @@ "" \ "" \ "text" \ - "MIME-Version: 1.0\r\n" \ + "" \ + "MIME-Version: 1.0\r\n" \ "Content-Type: text/plain; charset=UTF-8\r\n" \ "Content-Transfer-Encoding: base64\r\n" \ "X-OIM-Message-Type: OfflineMessage\r\n" \ -- 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/soap.h | 1 + 1 file changed, 1 insertion(+) (limited to 'protocols/msn/soap.h') diff --git a/protocols/msn/soap.h b/protocols/msn/soap.h index 687cc282..3db2d59d 100644 --- a/protocols/msn/soap.h +++ b/protocols/msn/soap.h @@ -82,5 +82,6 @@ "" int msn_soap_oim_send( struct im_connection *ic, const char *to, const char *msg ); +int msn_soap_oim_send_queue( struct im_connection *ic, GSList **msgq ); #endif /* __SOAP_H__ */ -- cgit v1.2.3