view msn_alias.diff @ 6:76f3cd9915c5

branch merge
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Fri, 29 Feb 2008 17:48:14 +0900
parents 19782faf1f00
children
line wrap: on
line source

--- libpurple/protocols/msn/msn.c	3bcd65aecd19f1e6a396effee93eaa720e43b451
+++ libpurple/protocols/msn/msn.c	f85092bf0d9cb1e56c964fe091a7bb243aae2b46
@@ -187,6 +187,8 @@ msn_act_id(PurpleConnection *gc, const c
 	msn_cmdproc_send(cmdproc, "REA", "%s %s",
 					 purple_account_get_username(account),
 					 alias);
+	// propagate change on server side to local
+	purple_account_set_alias(account, entry);
 }
 
 static void
@@ -299,6 +301,23 @@ static void
 }
 
 static void
+msn_ipc_init(PurplePlugin *plugin)
+{
+	purple_plugin_ipc_register(plugin, "msn_set_friendly_name",
+				   PURPLE_CALLBACK(msn_act_id),
+				   purple_marshal_VOID__POINTER_POINTER,
+				   purple_value_new(PURPLE_TYPE_UNKNOWN),2,
+				   purple_value_new(PURPLE_TYPE_POINTER),
+				   purple_value_new(PURPLE_TYPE_POINTER));
+}
+
+static void
+msn_ipc_end(PurplePlugin *plugin)
+{
+	purple_plugin_ipc_unregister_all(plugin);
+}
+
+static void
 msn_show_set_home_phone(PurplePluginAction *action)
 {
 	PurpleConnection *gc;
@@ -1997,6 +2016,8 @@ static gboolean msn_load(PurplePlugin *p
 	msn_switchboard_init();
 	msn_sync_init();
 
+	msn_ipc_init(plugin);
+
 	return TRUE;
 }
 
@@ -2006,6 +2028,8 @@ static gboolean msn_unload(PurplePlugin 
 	msn_switchboard_end();
 	msn_sync_end();
 
+	msn_ipc_end(plugin);
+
 	return TRUE;
 }