[e5a8118] | 1 | /* soap.h |
---|
| 2 | * |
---|
| 3 | * SOAP-related functions. Some manager at Microsoft apparently thought |
---|
| 4 | * MSNP wasn't XMLy enough so someone stepped up and changed that. This |
---|
| 5 | * is the result. |
---|
| 6 | * |
---|
| 7 | * Copyright (C) 2010 Wilmer van der Gaast <wilmer@gaast.net> |
---|
| 8 | * |
---|
| 9 | * This program is free software; you can redistribute it and/or modify |
---|
| 10 | * it under the terms of the GNU General Public License version 2 |
---|
| 11 | * as published by the Free Software Foundation |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that is will be useful, |
---|
| 14 | * bit WITHOU ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
| 21 | */ |
---|
| 22 | |
---|
| 23 | /* Thanks to http://msnpiki.msnfanatic.com/ for lots of info on this! */ |
---|
| 24 | |
---|
| 25 | #ifndef __SOAP_H__ |
---|
| 26 | #define __SOAP_H__ |
---|
| 27 | |
---|
| 28 | #include <stdio.h> |
---|
| 29 | #include <stdlib.h> |
---|
| 30 | #include <string.h> |
---|
| 31 | #include <sys/types.h> |
---|
| 32 | #ifndef _WIN32 |
---|
| 33 | #include <sys/socket.h> |
---|
| 34 | #include <netinet/in.h> |
---|
| 35 | #include <arpa/inet.h> |
---|
| 36 | #include <unistd.h> |
---|
| 37 | #endif |
---|
| 38 | #include "nogaim.h" |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | #define SOAP_HTTP_REQUEST \ |
---|
| 42 | "POST %s HTTP/1.0\r\n" \ |
---|
| 43 | "Host: %s\r\n" \ |
---|
| 44 | "Accept: */*\r\n" \ |
---|
| 45 | "SOAPAction: \"%s\"\r\n" \ |
---|
| 46 | "User-Agent: BitlBee " BITLBEE_VERSION "\r\n" \ |
---|
| 47 | "Content-Type: text/xml; charset=utf-8\r\n" \ |
---|
| 48 | "Content-Length: %d\r\n" \ |
---|
| 49 | "Cache-Control: no-cache\r\n" \ |
---|
| 50 | "\r\n" \ |
---|
| 51 | "%s" |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | #define SOAP_OIM_SEND_URL "https://ows.messenger.msn.com/OimWS/oim.asmx" |
---|
| 55 | #define SOAP_OIM_ACTION_URL "http://messenger.msn.com/ws/2004/09/oim/Store" |
---|
| 56 | |
---|
| 57 | #define SOAP_OIM_SEND_PAYLOAD \ |
---|
| 58 | "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \ |
---|
| 59 | "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \ |
---|
| 60 | "<soap:Header>" \ |
---|
| 61 | "<From memberName=\"%s\" friendlyName=\"=?utf-8?B?%s?=\" xml:lang=\"nl-nl\" proxy=\"MSNMSGR\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\" msnpVer=\"MSNP13\" buildVer=\"8.0.0328\"/>" \ |
---|
| 62 | "<To memberName=\"%s\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\"/>" \ |
---|
| 63 | "<Ticket passport=\"%s\" appid=\"%s\" lockkey=\"%s\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\"/>" \ |
---|
| 64 | "<Sequence xmlns=\"http://schemas.xmlsoap.org/ws/2003/03/rm\">" \ |
---|
| 65 | "<Identifier xmlns=\"http://schemas.xmlsoap.org/ws/2002/07/utility\">http://messenger.msn.com</Identifier>" \ |
---|
| 66 | "<MessageNumber>%d</MessageNumber>" \ |
---|
| 67 | "</Sequence>" \ |
---|
| 68 | "</soap:Header>" \ |
---|
| 69 | "<soap:Body>" \ |
---|
| 70 | "<MessageType xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\">text</MessageType>" \ |
---|
[ffb6dea] | 71 | "<Content xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\">" \ |
---|
| 72 | "MIME-Version: 1.0\r\n" \ |
---|
[e5a8118] | 73 | "Content-Type: text/plain; charset=UTF-8\r\n" \ |
---|
| 74 | "Content-Transfer-Encoding: base64\r\n" \ |
---|
| 75 | "X-OIM-Message-Type: OfflineMessage\r\n" \ |
---|
| 76 | "X-OIM-Run-Id: {89527393-8723-4F4F-8005-287532973298}\r\n" \ |
---|
| 77 | "X-OIM-Sequence-Num: %d\r\n" \ |
---|
| 78 | "\r\n" \ |
---|
| 79 | "%s" \ |
---|
| 80 | "</Content>" \ |
---|
| 81 | "</soap:Body>" \ |
---|
| 82 | "</soap:Envelope>" |
---|
| 83 | |
---|
| 84 | int msn_soap_oim_send( struct im_connection *ic, const char *to, const char *msg ); |
---|
| 85 | |
---|
| 86 | #endif /* __SOAP_H__ */ |
---|