Sun, 30 Jul 2006 13:44:34 +0000
[gaim-migrate @ 16600]
change to add SOAP HTTP header retrieve
Now Can do the OIM Message XML process
submitted by Ma Yuan<mayuan2006@gmail.com>
committer: Ethan Blanton <elb@pidgin.im>
| 13855 | 1 | /** |
| 2 | * @file oim.h Header file for oim.c | |
| 3 | * Author | |
| 4 | * MaYuan<mayuan2006@gmail.com> | |
| 5 | * gaim | |
| 6 | * | |
| 7 | * Gaim is the legal property of its developers, whose names are too numerous | |
| 8 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 | * source distribution. | |
| 10 | * | |
| 11 | * This program is free software; you can redistribute it and/or modify | |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | */ | |
| 25 | #ifndef _MSN_OIM_H_ | |
| 26 | #define _MSN_OIM_H_ | |
| 27 | ||
| 28 | #define MSN_OIM_RETRIEVE_HOST "rsi.hotmail.com" | |
| 29 | #define MSN_OIM_RETRIEVE__URL "/rsi/rsi.asmx" | |
| 30 | #define MSN_OIM_GET_SOAP_ACTION "http://www.hotmail.msn.com/ws/2004/09/oim/rsi/GetMessage" | |
| 31 | #define MSN_OIM_DEL_SOAP_ACTION "http://www.hotmail.msn.com/ws/2004/09/oim/rsi/DeleteMessages" | |
| 32 | ||
| 33 | #define MSN_OIM_GET_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\ | |
| 34 | "<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/\">"\ | |
| 35 | "<soap:Header>"\ | |
| 36 | "<PassportCookie xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\ | |
| 37 | "<t>%s</t>"\ | |
| 38 | "<p>%s</p>"\ | |
| 39 | "</PassportCookie>"\ | |
| 40 | "</soap:Header>"\ | |
| 41 | "<soap:Body>"\ | |
| 42 | "<GetMessage xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\ | |
| 43 | "<messageId>%s</messageId>"\ | |
| 44 | "<alsoMarkAsRead>false</alsoMarkAsRead>"\ | |
| 45 | "</GetMessage>"\ | |
| 46 | "</soap:Body>"\ | |
| 47 | "</soap:Envelope>" | |
| 48 | ||
| 49 | #define MSN_OIM_DEL_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\ | |
| 50 | "<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/\">"\ | |
| 51 | "<soap:Header>"\ | |
| 52 | "<PassportCookie xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\ | |
| 53 | "<t>%s</t>"\ | |
| 54 | " <p>%s</p>"\ | |
| 55 | "</PassportCookie>"\ | |
| 56 | "</soap:Header>"\ | |
| 57 | "<soap:Body>"\ | |
| 58 | "<DeleteMessages xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\ | |
| 59 | "<messageIds>"\ | |
| 60 | "<messageId>%s</messageId>"\ | |
| 61 | "</messageIds>"\ | |
| 62 | "</DeleteMessages>"\ | |
| 63 | "</soap:Body>"\ | |
| 64 | "</soap:Envelope>" | |
| 65 | ||
| 66 | #define MSN_OIM_SEND_HOST "ows.messenger.msn.com" | |
| 67 | #define MSN_OIM_SEND_URL "/OimWS/oim.asmx" | |
| 68 | #define MSN_OIM_SEND_SOAP_ACTION "http://messenger.msn.com/ws/2004/09/oim/Store" | |
| 69 | #define MSN_OIM_SEND_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\ | |
| 70 | "<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/\">"\ | |
| 71 | "<soap:Header>"\ | |
| 72 | "<From memberName=\"%s\" friendlyName=\"%s\" xml:lang=\"en-US\" proxy=\"MSNMSGR\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\" msnpVer=\"MSNP13\" buildVer=\"8.0.0689\"/>"\ | |
| 73 | "<To memberName=\"%s\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\"/>"\ | |
| 74 | "<Ticket passport=\"%s\" appid=\"%s\" lockkey=\"%s\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\"/>"\ | |
| 75 | "<Sequence xmlns=\"http://schemas.xmlsoap.org/ws/2003/03/rm\">"\ | |
| 76 | "<Identifier xmlns=\"http://schemas.xmlsoap.org/ws/2002/07/utility\">http://messenger.msn.com</Identifier>"\ | |
| 77 | "<MessageNumber>%s</MessageNumber>"\ | |
| 78 | "</Sequence>"\ | |
| 79 | "</soap:Header>"\ | |
| 80 | "<soap:Body>"\ | |
| 81 | "<MessageType xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\">text</MessageType>"\ | |
| 82 | "<Content xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\">%s</Content>"\ | |
| 83 | "</soap:Body>"\ | |
| 84 | "</soap:Envelope>" | |
| 85 | ||
| 86 | typedef struct _MsnOim MsnOim; | |
| 87 | ||
| 88 | struct _MsnOim | |
| 89 | { | |
| 90 | MsnSession *session; | |
| 91 | ||
| 92 | MsnSoapConn *retrieveconn; | |
| 93 | ||
| 94 | MsnSoapConn *sendconn; | |
| 95 | gint LockKeyChallenge; | |
| 96 | }; | |
| 97 | ||
| 98 | /*function prototype*/ | |
| 99 | MsnOim * msn_oim_new(MsnSession *session); | |
| 100 | void msn_oim_destroy(MsnOim *oim); | |
| 13858 | 101 | void msn_parse_oim_msg(MsnOim *oim,char *xmlmsg); |
| 13855 | 102 | |
| 13858 | 103 | void msn_oim_get_msg(MsnOim *oim,char *msgid); |
| 13855 | 104 | #endif/* _MSN_OIM_H_*/ |
| 105 | /*endof oim.h*/ |