1 === modified file 'protocols/msn/msn.c'
2 --- protocols/msn/msn.c 2010-11-19 21:00:14 +0000
3 +++ protocols/msn/msn.c 2010-12-12 00:25:17 +0000
5 md->groups = g_slist_remove( md->groups, mg );
8 + g_free( md->profile_rid );
10 g_tree_destroy( md->domaintree );
11 md->domaintree = NULL;
14 struct im_connection *ic = acc->ic;
15 struct msn_data *md = ic->proto_data;
17 - if( strlen( value ) > 129 )
19 - imcb_log( ic, "Maximum name length exceeded" );
23 - if( md->flags & MSN_GOT_PROFILE_DN )
24 - imcb_log( ic, "Warning: Persistent name changes for this account have to be done "
25 - "in the profile. BitlBee doesn't currently support this." );
27 if( md->flags & MSN_EMAIL_UNVERIFIED )
28 imcb_log( ic, "Warning: Your e-mail address is unverified. MSN doesn't allow "
29 "changing your display name until your e-mail address is verified." );
31 - msn_soap_addressbook_set_display_name( ic, value );
32 + if( md->flags & MSN_GOT_PROFILE_DN )
33 + msn_soap_profile_set_dn( ic, value );
35 + msn_soap_addressbook_set_display_name( ic, value );
37 return msn_ns_set_display_name( ic, value ) ? value : NULL;
41 struct prpl *ret = g_new0(struct prpl, 1);
44 - ret->mms = 1409; /* this guess taken from libotr UPGRADING file */
45 + ret->mms = 1409; /* this guess taken from libotr UPGRADING file */
46 ret->login = msn_login;
48 ret->logout = msn_logout;
50 === modified file 'protocols/msn/msn.h'
51 --- protocols/msn/msn.h 2010-11-13 13:01:40 +0000
52 +++ protocols/msn/msn.h 2010-12-12 00:25:17 +0000
55 const struct msn_away_state *away_state;
59 /* Mostly used for sending the ADL command; since MSNP13 the client
60 is responsible for downloading the contact list and then sending
62 === modified file 'protocols/msn/soap.c'
63 --- protocols/msn/soap.c 2010-11-20 15:39:58 +0000
64 +++ protocols/msn/soap.c 2010-12-12 00:25:17 +0000
66 return MSN_SOAP_RETRY;
70 + md->flags &= ~MSN_REAUTHING;
71 return msn_soapq_flush( ic, TRUE );
74 if( sd->secret == NULL )
76 @@ -1071,8 +1074,20 @@
80 +static xt_status msn_soap_profile_get_rid( struct xt_node *node, gpointer data )
82 + struct msn_soap_req_data *soap_req = data;
83 + struct msn_data *md = soap_req->ic->proto_data;
85 + g_free( md->profile_rid );
86 + md->profile_rid = g_strdup( node->text );
91 static const struct xt_handler_entry msn_soap_profile_get_parser[] = {
92 { "ExpressionProfile", "GetProfileResult", msn_soap_profile_get_result },
93 + { "ResourceID", "GetProfileResult", msn_soap_profile_get_rid },
97 @@ -1100,3 +1115,40 @@
98 msn_soap_profile_get_handle_response,
99 msn_soap_profile_get_free_data );
102 +/* Update profile (display name). */
103 +static int msn_soap_profile_set_dn_build_request( struct msn_soap_req_data *soap_req )
105 + struct msn_data *md = soap_req->ic->proto_data;
107 + soap_req->url = g_strdup( SOAP_STORAGE_URL );
108 + soap_req->action = g_strdup( SOAP_PROFILE_SET_DN_ACTION );
109 + soap_req->payload = g_markup_printf_escaped( SOAP_PROFILE_SET_DN_PAYLOAD,
110 + md->tokens[3], md->profile_rid, (char*) soap_req->data );
115 +static const struct xt_handler_entry msn_soap_profile_set_dn_parser[] = {
116 + { NULL, NULL, NULL }
119 +static int msn_soap_profile_set_dn_handle_response( struct msn_soap_req_data *soap_req )
121 + return MSN_SOAP_OK;
124 +static int msn_soap_profile_set_dn_free_data( struct msn_soap_req_data *soap_req )
126 + g_free( soap_req->data );
130 +int msn_soap_profile_set_dn( struct im_connection *ic, const char *dn )
132 + return msn_soap_start( ic, g_strdup( dn ),
133 + msn_soap_profile_set_dn_build_request,
134 + msn_soap_profile_set_dn_parser,
135 + msn_soap_profile_set_dn_handle_response,
136 + msn_soap_profile_set_dn_free_data );
139 === modified file 'protocols/msn/soap.h'
140 --- protocols/msn/soap.h 2010-10-02 06:56:33 +0000
141 +++ protocols/msn/soap.h 2010-12-12 00:25:17 +0000
144 #define SOAP_STORAGE_URL "https://storage.msn.com/storageservice/SchematizedStore.asmx"
145 #define SOAP_PROFILE_GET_ACTION "http://www.msn.com/webservices/storage/w10/GetProfile"
146 +#define SOAP_PROFILE_SET_DN_ACTION "http://www.msn.com/webservices/storage/w10/UpdateProfile"
148 #define SOAP_PROFILE_GET_PAYLOAD \
149 "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \
154 +#define SOAP_PROFILE_SET_DN_PAYLOAD \
155 +"<?xml version=\"1.0\" encoding=\"utf-8\"?>" \
156 +"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
157 + "<soap:Header xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
158 + "<StorageApplicationHeader xmlns=\"http://www.msn.com/webservices/storage/w10\">" \
159 + "<ApplicationID>Messenger Client 9.0</ApplicationID>" \
160 + "<Scenario>Initial</Scenario>" \
161 + "</StorageApplicationHeader>" \
162 + "<StorageUserHeader xmlns=\"http://www.msn.com/webservices/storage/w10\">" \
164 + "<TicketToken>%s</TicketToken>" \
165 + "</StorageUserHeader>" \
167 + "<soap:Body xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
168 + "<UpdateProfile xmlns=\"http://www.msn.com/webservices/storage/w10\">" \
170 + "<ResourceID>%s</ResourceID>" \
171 + "<ExpressionProfile>" \
172 + "<FreeText>Update</FreeText>" \
173 + "<DisplayName>%s</DisplayName>" \
174 + "<Flags>0</Flags>" \
175 + "</ExpressionProfile>" \
177 + "</UpdateProfile>" \
181 int msn_soap_profile_get( struct im_connection *ic, const char *cid );
183 +int msn_soap_profile_set_dn( struct im_connection *ic, const char *dn );
185 #endif /* __SOAP_H__ */