aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/msn/soap.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-08-14 14:06:11 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-08-14 14:06:11 +0100
commit4452e69ab1f01793a37205db8227a2de2f211d3e (patch)
tree56a9a4bf6b4c41531ddcd225f8415024638b38a3 /protocols/msn/soap.c
parentd93c0eb9f3f5d2d2cd78f02422d0c0ed25743e3a (diff)
Allow changing the display_name, now permanently!
Diffstat (limited to 'protocols/msn/soap.c')
-rw-r--r--protocols/msn/soap.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/protocols/msn/soap.c b/protocols/msn/soap.c
index 5eae3089..cd54858f 100644
--- a/protocols/msn/soap.c
+++ b/protocols/msn/soap.c
@@ -608,3 +608,37 @@ int msn_soap_addressbook_request( struct im_connection *ic )
msn_soap_addressbook_handle_response,
msn_soap_addressbook_free_data );
}
+
+/* Variant: Change our display name. */
+static int msn_soap_ab_namechange_build_request( struct msn_soap_req_data *soap_req )
+{
+ struct msn_data *md = soap_req->ic->proto_data;
+
+ soap_req->url = g_strdup( SOAP_ADDRESSBOOK_URL );
+ soap_req->action = g_strdup( SOAP_AB_NAMECHANGE_ACTION );
+ soap_req->payload = g_markup_printf_escaped( SOAP_AB_NAMECHANGE_PAYLOAD,
+ md->tokens[1], (char *) soap_req->data );
+
+ return 1;
+}
+
+static int msn_soap_ab_namechange_handle_response( struct msn_soap_req_data *soap_req )
+{
+ /* TODO: Ack the change? Not sure what the NAKs look like.. */
+ return MSN_SOAP_OK;
+}
+
+static int msn_soap_ab_namechange_free_data( struct msn_soap_req_data *soap_req )
+{
+ g_free( soap_req->data );
+ return 0;
+}
+
+int msn_soap_addressbook_set_display_name( struct im_connection *ic, const char *new )
+{
+ return msn_soap_start( ic, g_strdup( new ),
+ msn_soap_ab_namechange_build_request,
+ NULL,
+ msn_soap_ab_namechange_handle_response,
+ msn_soap_ab_namechange_free_data );
+}