annotate src/protocols/msn/oim.h @ 19790:4f21c73a0c48

[gaim-migrate @ 16613] add oim retrieve,can get oim message write the framework of oim send Committed by MaYuan <mayuan2006@gmail.com> committer: Ethan Blanton <elb@pidgin.im>
author Ma Yuan <mayuan2006@gmail.com>
date Wed, 02 Aug 2006 05:44:42 +0000
parents 7e36832172a9
children c2f3cd6626e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19785
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
1 /**
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
2 * @file oim.h Header file for oim.c
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
3 * Author
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
4 * MaYuan<mayuan2006@gmail.com>
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
5 * gaim
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
6 *
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
9 * source distribution.
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
10 *
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
14 * (at your option) any later version.
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
15 *
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
19 * GNU General Public License for more details.
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
20 *
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
24 */
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
25 #ifndef _MSN_OIM_H_
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
26 #define _MSN_OIM_H_
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
27
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
28 #define MSN_OIM_RETRIEVE_HOST "rsi.hotmail.com"
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
29 #define MSN_OIM_RETRIEVE__URL "/rsi/rsi.asmx"
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
30 #define MSN_OIM_GET_SOAP_ACTION "http://www.hotmail.msn.com/ws/2004/09/oim/rsi/GetMessage"
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
31 #define MSN_OIM_DEL_SOAP_ACTION "http://www.hotmail.msn.com/ws/2004/09/oim/rsi/DeleteMessages"
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
32
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
33 #define MSN_OIM_GET_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
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/\">"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
35 "<soap:Header>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
36 "<PassportCookie xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
37 "<t>%s</t>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
38 "<p>%s</p>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
39 "</PassportCookie>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
40 "</soap:Header>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
41 "<soap:Body>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
42 "<GetMessage xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
43 "<messageId>%s</messageId>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
44 "<alsoMarkAsRead>false</alsoMarkAsRead>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
45 "</GetMessage>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
46 "</soap:Body>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
47 "</soap:Envelope>"
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
48
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
49 #define MSN_OIM_DEL_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
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/\">"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
51 "<soap:Header>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
52 "<PassportCookie xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
53 "<t>%s</t>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
54 " <p>%s</p>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
55 "</PassportCookie>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
56 "</soap:Header>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
57 "<soap:Body>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
58 "<DeleteMessages xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
59 "<messageIds>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
60 "<messageId>%s</messageId>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
61 "</messageIds>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
62 "</DeleteMessages>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
63 "</soap:Body>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
64 "</soap:Envelope>"
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
65
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
66 #define MSN_OIM_SEND_HOST "ows.messenger.msn.com"
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
67 #define MSN_OIM_SEND_URL "/OimWS/oim.asmx"
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
68 #define MSN_OIM_SEND_SOAP_ACTION "http://messenger.msn.com/ws/2004/09/oim/Store"
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
69 #define MSN_OIM_SEND_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
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/\">"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
71 "<soap:Header>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
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\"/>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
73 "<To memberName=\"%s\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\"/>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
74 "<Ticket passport=\"%s\" appid=\"%s\" lockkey=\"%s\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\"/>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
75 "<Sequence xmlns=\"http://schemas.xmlsoap.org/ws/2003/03/rm\">"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
76 "<Identifier xmlns=\"http://schemas.xmlsoap.org/ws/2002/07/utility\">http://messenger.msn.com</Identifier>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
77 "<MessageNumber>%s</MessageNumber>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
78 "</Sequence>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
79 "</soap:Header>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
80 "<soap:Body>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
81 "<MessageType xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\">text</MessageType>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
82 "<Content xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\">%s</Content>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
83 "</soap:Body>"\
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
84 "</soap:Envelope>"
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
85
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
86 typedef struct _MsnOim MsnOim;
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
87
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
88 struct _MsnOim
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
89 {
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
90 MsnSession *session;
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
91
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
92 MsnSoapConn *retrieveconn;
19790
4f21c73a0c48 [gaim-migrate @ 16613]
Ma Yuan <mayuan2006@gmail.com>
parents: 19789
diff changeset
93 GList * oim_list;
19785
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
94
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
95 MsnSoapConn *sendconn;
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
96 gint LockKeyChallenge;
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
97 };
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
98
19790
4f21c73a0c48 [gaim-migrate @ 16613]
Ma Yuan <mayuan2006@gmail.com>
parents: 19789
diff changeset
99 /****************************************************
4f21c73a0c48 [gaim-migrate @ 16613]
Ma Yuan <mayuan2006@gmail.com>
parents: 19789
diff changeset
100 * function prototype
4f21c73a0c48 [gaim-migrate @ 16613]
Ma Yuan <mayuan2006@gmail.com>
parents: 19789
diff changeset
101 * **************************************************/
19785
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
102 MsnOim * msn_oim_new(MsnSession *session);
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
103 void msn_oim_destroy(MsnOim *oim);
19789
7e36832172a9 [gaim-migrate @ 16601]
Ma Yuan <mayuan2006@gmail.com>
parents: 19788
diff changeset
104 void msn_oim_connect(MsnOim *oim);
7e36832172a9 [gaim-migrate @ 16601]
Ma Yuan <mayuan2006@gmail.com>
parents: 19788
diff changeset
105
19788
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19785
diff changeset
106 void msn_parse_oim_msg(MsnOim *oim,char *xmlmsg);
19785
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
107
19790
4f21c73a0c48 [gaim-migrate @ 16613]
Ma Yuan <mayuan2006@gmail.com>
parents: 19789
diff changeset
108 /*get the OIM message*/
4f21c73a0c48 [gaim-migrate @ 16613]
Ma Yuan <mayuan2006@gmail.com>
parents: 19789
diff changeset
109 void msn_oim_get_msg(MsnOim *oim);
4f21c73a0c48 [gaim-migrate @ 16613]
Ma Yuan <mayuan2006@gmail.com>
parents: 19789
diff changeset
110
4f21c73a0c48 [gaim-migrate @ 16613]
Ma Yuan <mayuan2006@gmail.com>
parents: 19789
diff changeset
111 /*report the oim message to the conversation*/
4f21c73a0c48 [gaim-migrate @ 16613]
Ma Yuan <mayuan2006@gmail.com>
parents: 19789
diff changeset
112 void msn_oim_report_user(MsnOim *oim,const char *passport,char *msg);
4f21c73a0c48 [gaim-migrate @ 16613]
Ma Yuan <mayuan2006@gmail.com>
parents: 19789
diff changeset
113
19785
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
114 #endif/* _MSN_OIM_H_*/
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents:
diff changeset
115 /*endof oim.h*/