19738
|
1 /**
|
|
2 * @file contact.h Header file for contact.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_CONTACT_H_
|
|
26 #define _MSN_CONTACT_H_
|
|
27
|
19750
|
28 #define MSN_CONTACT_SERVER "omega.contacts.msn.com"
|
19738
|
29
|
19742
|
30 /*get contact list soap request template*/
|
19738
|
31 #define MSN_GET_CONTACT_POST_URL "/abservice/SharingService.asmx"
|
19739
|
32 #define MSN_GET_CONTACT_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/FindMembership"
|
19738
|
33 #define MSN_GET_CONTACT_TEMPLATE "<?xml version='1.0' encoding='utf-8'?>"\
|
|
34 "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
|
|
35 "<soap:Header xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
|
|
36 "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
|
|
37 "<ApplicationId xmlns=\"http://www.msn.com/webservices/AddressBook\">09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId>"\
|
|
38 "<IsMigration xmlns=\"http://www.msn.com/webservices/AddressBook\">false</IsMigration>"\
|
|
39 "<PartnerScenario xmlns=\"http://www.msn.com/webservices/AddressBook\">Initial</PartnerScenario>"\
|
|
40 "</ABApplicationHeader>"\
|
|
41 "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
|
|
42 "<ManagedGroupRequest xmlns=\"http://www.msn.com/webservices/AddressBook\">false</ManagedGroupRequest>"\
|
|
43 "</ABAuthHeader>"\
|
|
44 "</soap:Header>"\
|
|
45 "<soap:Body xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
|
|
46 "<FindMembership xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
|
|
47 "<serviceFilter xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
|
|
48 "<Types xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
|
|
49 "<ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Messenger</ServiceType>"\
|
|
50 "<ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Invitation</ServiceType>"\
|
|
51 "<ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">SocialNetwork</ServiceType>"\
|
|
52 "<ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Space</ServiceType>"\
|
|
53 "<ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Profile</ServiceType>"\
|
|
54 "</Types>"\
|
|
55 "</serviceFilter>"\
|
|
56 "</FindMembership>"\
|
|
57 "</soap:Body>"\
|
|
58 "</soap:Envelope>"
|
|
59
|
19747
|
60 /************************************************
|
|
61 * Address Book SOAP
|
|
62 * *********************************************/
|
|
63 #define MSN_ADDRESS_BOOK_POST_URL "/abservice/abservice.asmx"
|
19742
|
64 /*get addressbook soap request template*/
|
19739
|
65 #define MSN_GET_ADDRESS_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABFindAll"
|
|
66 #define MSN_GET_ADDRESS_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
|
19738
|
67 "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
|
|
68 "<soap:Header>"\
|
|
69 "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
|
|
70 "<ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId>"\
|
|
71 "<IsMigration>false</IsMigration>"\
|
|
72 "<PartnerScenario>Initial</PartnerScenario>"\
|
|
73 "</ABApplicationHeader>"\
|
|
74 "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
|
|
75 "<ManagedGroupRequest>false</ManagedGroupRequest>"\
|
|
76 "</ABAuthHeader>"\
|
|
77 "</soap:Header>"\
|
|
78 "<soap:Body>"\
|
|
79 "<ABFindAll xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
|
|
80 "<abId>00000000-0000-0000-0000-000000000000</abId>"\
|
|
81 "<abView>Full</abView>"\
|
|
82 "</ABFindAll>"\
|
|
83 "</soap:Body>"\
|
|
84 "</soap:Envelope>"
|
|
85
|
19742
|
86 /*Gleams SOAP request template*/
|
19747
|
87 #define MSN_GET_GLEAMS_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABFindAll"
|
19744
|
88 #define MSN_GLEAMS_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
|
19738
|
89 "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
|
|
90 "<soap:Header>"\
|
|
91 "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
|
|
92 "<ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId>"\
|
|
93 "<IsMigration>false</IsMigration>"\
|
|
94 "<PartnerScenario>Initial</PartnerScenario>"\
|
|
95 "</ABApplicationHeader>"\
|
|
96 "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
|
|
97 "<ManagedGroupRequest>false</ManagedGroupRequest>"\
|
|
98 "</ABAuthHeader>"\
|
|
99 "</soap:Header>"\
|
|
100 "<soap:Body>"\
|
|
101 "<ABFindAll xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
|
|
102 "<abId>00000000-0000-0000-0000-000000000000</abId>"\
|
|
103 "<abView>Full</abView>"\
|
|
104 "<dynamicItemView>Gleam</dynamicItemView>"\
|
|
105 "<dynamicItemLastChange>0001-01-01T00:00:00.0000000-08:00</dynamicItemLastChange>"\
|
|
106 "</ABFindAll>"\
|
|
107 "</soap:Body>"\
|
|
108 "</soap:Envelope>"
|
|
109
|
19747
|
110 /*******************************************************
|
|
111 * Contact Add/del SOAP Action
|
|
112 *******************************************************/
|
19742
|
113 /*add conatct soap request*/
|
19739
|
114 #define MSN_CONTACT_ADD_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABContactAdd"
|
|
115 #define MSN_CONTACT_XML "<Contact xmlns=\"http://www.msn.com/webservices/AddressBook\"><contactInfo><contactType>LivePending</contactType><passportName>%s</passportName><isMessengerUser>true</isMessengerUser></contactInfo></Contact>"
|
|
116
|
|
117 #define MSN_ADD_CONTACT_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>ContactSave</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><ABContactAdd xmlns=\"http://www.msn.com/webservices/AddressBook\"><abId>00000000-0000-0000-0000-000000000000</abId><contacts>%s</contacts><options><EnableAllowListManagement>true</EnableAllowListManagement></options></ABContactAdd></soap:Body></soap:Envelope>"
|
|
118
|
19750
|
119 /*Contact Group Add*/
|
|
120 #define MSN_ADD_CONTACT_GROUP_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABGroupContactAdd"
|
|
121 #define MSN_ADD_CONTACT_GROUP_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>ContactSave</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><ABGroupContactAdd xmlns=\"http://www.msn.com/webservices/AddressBook\"><abId>00000000-0000-0000-0000-000000000000</abId><groupFilter><groupIds><guid>%s</guid></groupIds></groupFilter><contacts>%s</contacts><groupContactAddOptions><fGenerateMissingQuickName>true</fGenerateMissingQuickName><EnableAllowListManagement>true</EnableAllowListManagement></groupContactAddOptions></ABGroupContactAdd></soap:Body></soap:Envelope>"
|
|
122
|
19742
|
123 /*delete contact from contact list soap request template*/
|
19739
|
124 #define MSN_CONTACT_DEL_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABContactDelete"
|
19748
|
125 #define MSN_CONTACTS_DEL_XML "<Contact><contactId>%s</contactId></Contact>"
|
19739
|
126 #define MSN_DEL_CONTACT_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>Timer</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><ABContactDelete xmlns=\"http://www.msn.com/webservices/AddressBook\"><abId>00000000-0000-0000-0000-000000000000</abId><contacts>%s</contacts></ABContactDelete></soap:Body></soap:Envelope>"
|
|
127
|
|
128 #define MSN_MEMBER_TEMPLATE "<Member xsi:type=\"PassportMember\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Type>Passport</Type><State>Accepted</State><PassportName>%s</PassportName></Member>"
|
|
129
|
19747
|
130 /*******************************************************
|
|
131 * Contact Block/Unblock SOAP Action
|
|
132 *******************************************************/
|
19748
|
133 /*block means delete from allow list and add contact to block list*/
|
19747
|
134 #define MSN_SHARE_POST_URL "/abservice/SharingService.asmx"
|
19739
|
135 #define MSN_CONTACT_BLOCK_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/AddMember"
|
19748
|
136 /*first delete contact from allow list*/
|
|
137 #define MSN_CONTACT_DELECT_FROM_ALLOW_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>BlockUnblock</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><DeleteMember xmlns=\"http://www.msn.com/webservices/AddressBook\"><serviceHandle><Id>0</Id><Type>Messenger</Type><ForeignId></ForeignId></serviceHandle><memberships><Membership><MemberRole>Allow</MemberRole><Members><Member xsi:type=\"PassportMember\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Type>Passport</Type><MembershipId>%s</MembershipId><State>Accepted</State></Member></Members></Membership></memberships></DeleteMember></soap:Body></soap:Envelope>"
|
19739
|
138
|
19748
|
139 #define MSN_CONTACT_ADD_TO_BLOCK_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>BlockUnblock</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><AddMember xmlns=\"http://www.msn.com/webservices/AddressBook\"><serviceHandle><Id>0</Id><Type>Messenger</Type><ForeignId></ForeignId></serviceHandle><memberships><Membership><MemberRole>Block</MemberRole><Members>%s</Members></Membership></memberships></AddMember></soap:Body></soap:Envelope>"
|
|
140
|
|
141 /*unblock means delete contact from block list*/
|
19739
|
142 #define MSN_CONTACT_UNBLOCK_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/DeleteMember"
|
|
143 #define MSN_UNBLOCK_CONTACT_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>BlockUnblock</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><DeleteMember xmlns=\"http://www.msn.com/webservices/AddressBook\"><serviceHandle><Id>0</Id><Type>Messenger</Type><ForeignId></ForeignId></serviceHandle><memberships><Membership><MemberRole>Block</MemberRole><Members>%s</Members></Membership></memberships></DeleteMember></soap:Body></soap:Envelope>"
|
|
144
|
19747
|
145 /*******************************************************
|
|
146 * Group SOAP Action
|
|
147 *******************************************************/
|
|
148 /*add a group*/
|
|
149 #define MSN_GROUP_ADD_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABGroupAdd"
|
|
150 #define MSN_GROUP_ADD_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>GroupSave</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><ABGroupAdd xmlns=\"http://www.msn.com/webservices/AddressBook\"><abId>00000000-0000-0000-0000-000000000000</abId><groupAddOptions><fRenameOnMsgrConflict>false</fRenameOnMsgrConflict></groupAddOptions><groupInfo><GroupInfo><name>%s</name><groupType>C8529CE2-6EAD-434d-881F-341E17DB3FF8</groupType><fMessenger>false</fMessenger><annotations><Annotation><Name>MSN.IM.Display</Name><Value>1</Value></Annotation></annotations></GroupInfo></groupInfo></ABGroupAdd></soap:Body></soap:Envelope>"
|
|
151
|
|
152 /*delete a group*/
|
|
153 #define MSN_GROUP_DEL_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABGroupDelete"
|
|
154 #define MSN_GROUP_DEL_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>Timer</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><ABGroupDelete xmlns=\"http://www.msn.com/webservices/AddressBook\"><abId>00000000-0000-0000-0000-000000000000</abId><groupFilter><groupIds><guid>%s</guid></groupIds></groupFilter></ABGroupDelete></soap:Body></soap:Envelope>"
|
|
155
|
19738
|
156 typedef struct _MsnContact MsnContact;
|
|
157
|
|
158 struct _MsnContact
|
|
159 {
|
|
160 MsnSession *session;
|
|
161
|
|
162 MsnSoapConn *soapconn;
|
|
163 };
|
|
164
|
19749
|
165 /************************************************
|
|
166 * function prototype
|
|
167 ************************************************/
|
19738
|
168 MsnContact * msn_contact_new(MsnSession *session);
|
19739
|
169 void msn_contact_destroy(MsnContact *contact);
|
19738
|
170
|
19739
|
171 void msn_contact_connect(MsnContact *contact);
|
19738
|
172 void msn_get_contact_list(MsnContact * contact);
|
19739
|
173 void msn_get_address_book(MsnContact *contact);
|
19738
|
174
|
19750
|
175 /*contact SOAP Operation*/
|
|
176 void msn_add_contact(MsnContact *contact,const char *passport,char *groupId);
|
|
177 void msn_delete_contact(MsnContact *contact,const char *contactId);
|
|
178
|
|
179
|
19749
|
180 /*group operation*/
|
|
181 void msn_add_group(MsnSession *session,const char* group_name);
|
|
182 void msn_del_group(MsnSession *session,const char *guid);
|
19738
|
183 #endif/* _MSN_CMDPROC_H_*/
|
|
184
|