2 * @file oim.h Header file for oim.c
4 * MaYuan<mayuan2006@gmail.com>
7 * Purple 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
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.
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.
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
28 /* OIM Retrieval Info */
29 #define MSN_OIM_RETRIEVE_HOST "rsi.hotmail.com"
30 #define MSN_OIM_RETRIEVE_URL "/rsi/rsi.asmx"
32 /* OIM GetMetadata SOAP Template */
33 #define MSN_OIM_GET_METADATA_ACTION "http://www.hotmail.msn.com/ws/2004/09/oim/rsi/GetMetadata"
35 #define MSN_OIM_GET_METADATA_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
37 " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
38 " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
39 " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
41 "<PassportCookie xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
47 "<GetMetadata xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\" />"\
51 /*OIM GetMessage SOAP Template*/
52 #define MSN_OIM_GET_SOAP_ACTION "http://www.hotmail.msn.com/ws/2004/09/oim/rsi/GetMessage"
54 #define MSN_OIM_GET_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
56 " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
57 " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
58 " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
60 "<PassportCookie xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
66 "<GetMessage xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
67 "<messageId>%s</messageId>"\
68 "<alsoMarkAsRead>false</alsoMarkAsRead>"\
73 /*OIM DeleteMessages SOAP Template*/
74 #define MSN_OIM_DEL_SOAP_ACTION "http://www.hotmail.msn.com/ws/2004/09/oim/rsi/DeleteMessages"
76 #define MSN_OIM_DEL_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
78 " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
79 " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
80 " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
82 "<PassportCookie xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
88 "<DeleteMessages xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
90 "<messageId>%s</messageId>"\
96 /*OIM Send SOAP Template*/
97 #define MSN_OIM_MSG_TEMPLATE "MIME-Version: 1.0\n"\
98 "Content-Type: text/plain; charset=UTF-8\n"\
99 "Content-Transfer-Encoding: base64\n"\
100 "X-OIM-Message-Type: OfflineMessage\n"\
101 "X-OIM-Run-Id: {%s}\n"\
102 "X-OIM-Sequence-Num: %d\n\n"
104 #define MSN_OIM_SEND_HOST "ows.messenger.msn.com"
105 #define MSN_OIM_SEND_URL "/OimWS/oim.asmx"
106 #define MSN_OIM_SEND_SOAP_ACTION "http://messenger.live.com/ws/2006/09/oim/Store2"
107 #define MSN_OIM_SEND_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
109 " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
110 " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
111 " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
114 " memberName=\"%s\""\
115 " friendlyName=\"%s\""\
116 " xml:lang=\"en-US\""\
117 " proxy=\"MSNMSGR\""\
118 " xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\""\
119 " msnpVer=\"MSNP15\""\
120 " buildVer=\"8.5.1288\"/>"\
121 "<To memberName=\"%s\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\"/>"\
122 "<Ticket passport=\"EMPTY\" appid=\"%s\" lockkey=\"%s\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\"/>"\
123 "<Sequence xmlns=\"http://schemas.xmlsoap.org/ws/2003/03/rm\">"\
124 "<Identifier xmlns=\"http://schemas.xmlsoap.org/ws/2002/07/utility\">http://messenger.msn.com</Identifier>"\
125 "<MessageNumber>%d</MessageNumber>"\
129 "<MessageType xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\">text</MessageType>"\
130 "<Content xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\">%s</Content>"\
134 typedef struct _MsnOim MsnOim;
148 /****************************************************
150 * **************************************************/
151 MsnOim * msn_oim_new(MsnSession *session);
152 void msn_oim_destroy(MsnOim *oim);
154 void msn_parse_oim_msg(MsnOim *oim,const char *xmlmsg);
157 void msn_oim_prep_send_msg_info(MsnOim *oim, const char *membername,
158 const char *friendname, const char *tomember,
161 void msn_oim_send_msg(MsnOim *oim);
163 #endif/* _MSN_OIM_H_*/