Changeset 76c89dc7
- Timestamp:
- 2010-12-12T00:25:17Z (14 years ago)
- Branches:
- master
- Children:
- 8eec79d
- Parents:
- c775a58
- Location:
- protocols/msn
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
rc775a58 r76c89dc7 108 108 } 109 109 110 g_free( md->profile_rid ); 111 110 112 g_tree_destroy( md->domaintree ); 111 113 md->domaintree = NULL; … … 322 324 struct msn_data *md = ic->proto_data; 323 325 324 if( strlen( value ) > 129 )325 {326 imcb_log( ic, "Maximum name length exceeded" );327 return NULL;328 }329 330 if( md->flags & MSN_GOT_PROFILE_DN )331 imcb_log( ic, "Warning: Persistent name changes for this account have to be done "332 "in the profile. BitlBee doesn't currently support this." );333 334 326 if( md->flags & MSN_EMAIL_UNVERIFIED ) 335 327 imcb_log( ic, "Warning: Your e-mail address is unverified. MSN doesn't allow " 336 328 "changing your display name until your e-mail address is verified." ); 337 329 338 msn_soap_addressbook_set_display_name( ic, value ); 330 if( md->flags & MSN_GOT_PROFILE_DN ) 331 msn_soap_profile_set_dn( ic, value ); 332 else 333 msn_soap_addressbook_set_display_name( ic, value ); 334 339 335 return msn_ns_set_display_name( ic, value ) ? value : NULL; 340 336 } … … 363 359 364 360 ret->name = "msn"; 365 361 ret->mms = 1409; /* this guess taken from libotr UPGRADING file */ 366 362 ret->login = msn_login; 367 363 ret->init = msn_init; -
protocols/msn/msn.h
rc775a58 r76c89dc7 119 119 const struct msn_away_state *away_state; 120 120 GSList *groups; 121 char *profile_rid; 121 122 122 123 /* Mostly used for sending the ADL command; since MSNP13 the client -
protocols/msn/soap.c
rc775a58 r76c89dc7 398 398 399 399 if( md->soapq ) 400 { 401 md->flags &= ~MSN_REAUTHING; 400 402 return msn_soapq_flush( ic, TRUE ); 403 } 401 404 402 405 if( sd->secret == NULL ) … … 1072 1075 } 1073 1076 1077 static xt_status msn_soap_profile_get_rid( struct xt_node *node, gpointer data ) 1078 { 1079 struct msn_soap_req_data *soap_req = data; 1080 struct msn_data *md = soap_req->ic->proto_data; 1081 1082 g_free( md->profile_rid ); 1083 md->profile_rid = g_strdup( node->text ); 1084 1085 return XT_HANDLED; 1086 } 1087 1074 1088 static const struct xt_handler_entry msn_soap_profile_get_parser[] = { 1075 1089 { "ExpressionProfile", "GetProfileResult", msn_soap_profile_get_result }, 1090 { "ResourceID", "GetProfileResult", msn_soap_profile_get_rid }, 1076 1091 { NULL, NULL, NULL } 1077 1092 }; … … 1101 1116 msn_soap_profile_get_free_data ); 1102 1117 } 1118 1119 /* Update profile (display name). */ 1120 static int msn_soap_profile_set_dn_build_request( struct msn_soap_req_data *soap_req ) 1121 { 1122 struct msn_data *md = soap_req->ic->proto_data; 1123 1124 soap_req->url = g_strdup( SOAP_STORAGE_URL ); 1125 soap_req->action = g_strdup( SOAP_PROFILE_SET_DN_ACTION ); 1126 soap_req->payload = g_markup_printf_escaped( SOAP_PROFILE_SET_DN_PAYLOAD, 1127 md->tokens[3], md->profile_rid, (char*) soap_req->data ); 1128 1129 return 1; 1130 } 1131 1132 static const struct xt_handler_entry msn_soap_profile_set_dn_parser[] = { 1133 { NULL, NULL, NULL } 1134 }; 1135 1136 static int msn_soap_profile_set_dn_handle_response( struct msn_soap_req_data *soap_req ) 1137 { 1138 return MSN_SOAP_OK; 1139 } 1140 1141 static int msn_soap_profile_set_dn_free_data( struct msn_soap_req_data *soap_req ) 1142 { 1143 g_free( soap_req->data ); 1144 return 0; 1145 } 1146 1147 int msn_soap_profile_set_dn( struct im_connection *ic, const char *dn ) 1148 { 1149 return msn_soap_start( ic, g_strdup( dn ), 1150 msn_soap_profile_set_dn_build_request, 1151 msn_soap_profile_set_dn_parser, 1152 msn_soap_profile_set_dn_handle_response, 1153 msn_soap_profile_set_dn_free_data ); 1154 } -
protocols/msn/soap.h
rc775a58 r76c89dc7 303 303 #define SOAP_STORAGE_URL "https://storage.msn.com/storageservice/SchematizedStore.asmx" 304 304 #define SOAP_PROFILE_GET_ACTION "http://www.msn.com/webservices/storage/w10/GetProfile" 305 #define SOAP_PROFILE_SET_DN_ACTION "http://www.msn.com/webservices/storage/w10/UpdateProfile" 305 306 306 307 #define SOAP_PROFILE_GET_PAYLOAD \ … … 345 346 "</soap:Envelope>" 346 347 348 #define SOAP_PROFILE_SET_DN_PAYLOAD \ 349 "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \ 350 "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \ 351 "<soap:Header xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \ 352 "<StorageApplicationHeader xmlns=\"http://www.msn.com/webservices/storage/w10\">" \ 353 "<ApplicationID>Messenger Client 9.0</ApplicationID>" \ 354 "<Scenario>Initial</Scenario>" \ 355 "</StorageApplicationHeader>" \ 356 "<StorageUserHeader xmlns=\"http://www.msn.com/webservices/storage/w10\">" \ 357 "<Puid>0</Puid>" \ 358 "<TicketToken>%s</TicketToken>" \ 359 "</StorageUserHeader>" \ 360 "</soap:Header>" \ 361 "<soap:Body xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \ 362 "<UpdateProfile xmlns=\"http://www.msn.com/webservices/storage/w10\">" \ 363 "<profile>" \ 364 "<ResourceID>%s</ResourceID>" \ 365 "<ExpressionProfile>" \ 366 "<FreeText>Update</FreeText>" \ 367 "<DisplayName>%s</DisplayName>" \ 368 "<Flags>0</Flags>" \ 369 "</ExpressionProfile>" \ 370 "</profile>" \ 371 "</UpdateProfile>" \ 372 "</soap:Body>" \ 373 "</soap:Envelope>" 374 347 375 int msn_soap_profile_get( struct im_connection *ic, const char *cid ); 348 376 int msn_soap_profile_set_dn( struct im_connection *ic, const char *dn ); 349 377 350 378 #endif /* __SOAP_H__ */
Note: See TracChangeset
for help on using the changeset viewer.