Changeset 6ddb223 for protocols/msn
- Timestamp:
- 2010-08-14T19:57:13Z (14 years ago)
- Branches:
- master
- Children:
- 4fc95c5
- Parents:
- 193dc74
- Location:
- protocols/msn
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn_util.c
r193dc74 r6ddb223 147 147 return msn_write( ic, buf, strlen( buf ) ); 148 148 } 149 150 return 1; 149 151 } 150 152 … … 188 190 } 189 191 190 return ( 0 );192 return 1; 191 193 } 192 194 -
protocols/msn/soap.c
r193dc74 r6ddb223 145 145 g_free( soap_req ); 146 146 } 147 } 148 149 static char *msn_soap_abservice_build( const char *body_fmt, const char *scenario, const char *ticket, ... ) 150 { 151 va_list params; 152 char *ret, *format, *body; 153 154 format = g_markup_printf_escaped( SOAP_ABSERVICE_PAYLOAD, scenario, ticket ); 155 156 va_start( params, ticket ); 157 body = g_strdup_vprintf( body_fmt, params ); 158 va_end( params ); 159 160 ret = g_strdup_printf( format, body ); 161 g_free( body ); 162 g_free( format ); 163 164 return ret; 147 165 } 148 166 … … 445 463 soap_req->url = g_strdup( SOAP_MEMLIST_URL ); 446 464 soap_req->action = g_strdup( SOAP_MEMLIST_ACTION ); 447 soap_req->payload = g_markup_printf_escaped( SOAP_MEMLIST_PAYLOAD, md->tokens[1] );465 soap_req->payload = msn_soap_abservice_build( SOAP_MEMLIST_PAYLOAD, "Initial", md->tokens[1] ); 448 466 449 467 return 1; … … 562 580 break; 563 581 } 564 soap_req->payload = g_markup_printf_escaped( SOAP_MEMLIST_EDIT_PAYLOAD,582 soap_req->payload = msn_soap_abservice_build( SOAP_MEMLIST_EDIT_PAYLOAD, 565 583 scenario, md->tokens[1], add, list, med->handle, add ); 566 584 … … 607 625 soap_req->url = g_strdup( SOAP_ADDRESSBOOK_URL ); 608 626 soap_req->action = g_strdup( SOAP_ADDRESSBOOK_ACTION ); 609 soap_req->payload = g_markup_printf_escaped( SOAP_ADDRESSBOOK_PAYLOAD, md->tokens[1] );627 soap_req->payload = msn_soap_abservice_build( SOAP_ADDRESSBOOK_PAYLOAD, "Initial", md->tokens[1] ); 610 628 611 629 return 1; … … 706 724 soap_req->url = g_strdup( SOAP_ADDRESSBOOK_URL ); 707 725 soap_req->action = g_strdup( SOAP_AB_NAMECHANGE_ACTION ); 708 soap_req->payload = g_markup_printf_escaped( SOAP_AB_NAMECHANGE_PAYLOAD,709 md->tokens[1], (char *) soap_req->data );726 soap_req->payload = msn_soap_abservice_build( SOAP_AB_NAMECHANGE_PAYLOAD, 727 "Initial", md->tokens[1], (char *) soap_req->data ); 710 728 711 729 return 1; -
protocols/msn/soap.h
r193dc74 r6ddb223 167 167 168 168 169 #define SOAP_MEMLIST_URL "http://contacts.msn.com/abservice/SharingService.asmx" 170 #define SOAP_MEMLIST_ACTION "http://www.msn.com/webservices/AddressBook/FindMembership" 171 172 #define SOAP_MEMLIST_PAYLOAD \ 173 "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \ 174 "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \ 175 "<soap:Header xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \ 176 "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">" \ 177 "<ApplicationId xmlns=\"http://www.msn.com/webservices/AddressBook\">CFE80F9D-180F-4399-82AB-413F33A1FA11</ApplicationId>" \ 178 "<IsMigration xmlns=\"http://www.msn.com/webservices/AddressBook\">false</IsMigration>" \ 179 "<PartnerScenario xmlns=\"http://www.msn.com/webservices/AddressBook\">Initial</PartnerScenario>" \ 180 "</ABApplicationHeader>" \ 181 "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">" \ 182 "<ManagedGroupRequest xmlns=\"http://www.msn.com/webservices/AddressBook\">false</ManagedGroupRequest>" \ 183 "<TicketToken>%s</TicketToken>" \ 184 "</ABAuthHeader>" \ 185 "</soap:Header>" \ 186 "<soap:Body xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \ 187 "<FindMembership xmlns=\"http://www.msn.com/webservices/AddressBook\"><serviceFilter xmlns=\"http://www.msn.com/webservices/AddressBook\"><Types xmlns=\"http://www.msn.com/webservices/AddressBook\"><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Messenger</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Invitation</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">SocialNetwork</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Space</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Profile</ServiceType></Types></serviceFilter>" \ 188 "</FindMembership>" \ 189 "</soap:Body>" \ 190 "</soap:Envelope>" 191 192 #define SOAP_MEMLIST_ADD_ACTION "http://www.msn.com/webservices/AddressBook/AddMember" 193 #define SOAP_MEMLIST_DEL_ACTION "http://www.msn.com/webservices/AddressBook/DeleteMember" 194 195 #define SOAP_MEMLIST_EDIT_PAYLOAD \ 169 #define SOAP_ABSERVICE_PAYLOAD \ 196 170 "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \ 197 171 "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \ … … 208 182 "</soap:Header>" \ 209 183 "<soap:Body xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \ 184 "%%s" \ 185 "</soap:Body>" \ 186 "</soap:Envelope>" 187 188 #define SOAP_MEMLIST_URL "http://contacts.msn.com/abservice/SharingService.asmx" 189 #define SOAP_MEMLIST_ACTION "http://www.msn.com/webservices/AddressBook/FindMembership" 190 191 #define SOAP_MEMLIST_PAYLOAD \ 192 "<FindMembership xmlns=\"http://www.msn.com/webservices/AddressBook\"><serviceFilter xmlns=\"http://www.msn.com/webservices/AddressBook\"><Types xmlns=\"http://www.msn.com/webservices/AddressBook\"><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Messenger</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Invitation</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">SocialNetwork</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Space</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Profile</ServiceType></Types></serviceFilter>" \ 193 "</FindMembership>" 194 195 #define SOAP_MEMLIST_ADD_ACTION "http://www.msn.com/webservices/AddressBook/AddMember" 196 #define SOAP_MEMLIST_DEL_ACTION "http://www.msn.com/webservices/AddressBook/DeleteMember" 197 198 #define SOAP_MEMLIST_EDIT_PAYLOAD \ 210 199 "<%sMember xmlns=\"http://www.msn.com/webservices/AddressBook\">" \ 211 200 "<serviceHandle>" \ … … 226 215 "</Membership>" \ 227 216 "</memberships>" \ 228 "</%sMember>" \ 229 "</soap:Body>" \ 230 "</soap:Envelope>" 217 "</%sMember>" 231 218 232 219 int msn_soap_memlist_request( struct im_connection *ic ); … … 238 225 239 226 #define SOAP_ADDRESSBOOK_PAYLOAD \ 240 "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \241 "<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/\">" \242 "<soap:Header>" \243 "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">" \244 "<ApplicationId>CFE80F9D-180F-4399-82AB-413F33A1FA11</ApplicationId>" \245 "<IsMigration>false</IsMigration>" \246 "<PartnerScenario>Initial</PartnerScenario>" \247 "</ABApplicationHeader>" \248 "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">" \249 "<ManagedGroupRequest>false</ManagedGroupRequest>" \250 "<TicketToken>%s</TicketToken>" \251 "</ABAuthHeader>" \252 "</soap:Header>" \253 "<soap:Body>" \254 227 "<ABFindAll xmlns=\"http://www.msn.com/webservices/AddressBook\">" \ 255 228 "<abId>00000000-0000-0000-0000-000000000000</abId>" \ … … 257 230 "<deltasOnly>false</deltasOnly>" \ 258 231 "<lastChange>0001-01-01T00:00:00.0000000-08:00</lastChange>" \ 259 "</ABFindAll>" \ 260 "</soap:Body>" \ 261 "</soap:Envelope>" 232 "</ABFindAll>" 262 233 263 234 #define SOAP_AB_NAMECHANGE_ACTION "http://www.msn.com/webservices/AddressBook/ABContactUpdate" 264 235 265 236 #define SOAP_AB_NAMECHANGE_PAYLOAD \ 266 "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \267 "<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/\">" \268 "<soap:Header>" \269 "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">" \270 "<ApplicationId>CFE80F9D-180F-4399-82AB-413F33A1FA11</ApplicationId>" \271 "<IsMigration>false</IsMigration>" \272 "<PartnerScenario>Initial</PartnerScenario>" \273 "</ABApplicationHeader>" \274 "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">" \275 "<ManagedGroupRequest>false</ManagedGroupRequest>" \276 "<TicketToken>%s</TicketToken>" \277 "</ABAuthHeader>" \278 "</soap:Header>" \279 "<soap:Body>" \280 237 "<ABContactUpdate xmlns=\"http://www.msn.com/webservices/AddressBook\">" \ 281 238 "<abId>00000000-0000-0000-0000-000000000000</abId>" \ … … 289 246 "</Contact>" \ 290 247 "</contacts>" \ 291 "</ABContactUpdate>" \ 292 "</soap:Body>" \ 293 "</soap:Envelope>" 248 "</ABContactUpdate>" 294 249 295 250 int msn_soap_addressbook_request( struct im_connection *ic );
Note: See TracChangeset
for help on using the changeset viewer.