changeset 4:19782faf1f00 2.0.0

- add a msn alias patch to the repository. - clean up for 2.0.0 release.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Sun, 02 Sep 2007 13:45:07 +0900
parents f1dc959e4706
children 04b5c3834bfd
files README msn_alias.diff pidgin-audacious.c
diffstat 3 files changed, 59 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/README	Fri Jun 29 01:42:55 2007 +0900
+++ b/README	Sun Sep 02 13:45:07 2007 +0900
@@ -1,4 +1,4 @@
-pidgin-audacious-2.0.0d2
+pidgin-audacious-2.0.0
 
 1. What's this?
 
@@ -6,13 +6,13 @@
 message for your pidgin accounts, reflecting the current track name what
 you are listening in Audacious.
 
-Moreover, after version 1.1.0, pidgin-audacious can alter your alias
+Moreover, from version 1.1.0, pidgin-audacious can alter your alias
 (aka friendly name or nickname) in msn protocol using the current
 track name.
 
 This plugin requires pidgin 2.0.0 or later and development version of
-audacious. (capable of DBus connection expected to be released as
-1.4.0.)
+audacious (which capable of DBus connection expected to be released
+as 1.4.0.).
 
 2. How to build
 
@@ -23,8 +23,7 @@
 make install
 
 If you would like to test new alias substitution feature, please apply
-included patch against the pidgin source. Both 2.0.0b4 and svn around
-October 15 2006 would work.
+included patch against the pidgin source. 
 
 3. Usage
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/msn_alias.diff	Sun Sep 02 13:45:07 2007 +0900
@@ -0,0 +1,53 @@
+--- 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;
+ }
+ 
--- a/pidgin-audacious.c	Fri Jun 29 01:42:55 2007 +0900
+++ b/pidgin-audacious.c	Sun Sep 02 13:45:07 2007 +0900
@@ -78,14 +78,6 @@
 
     g_clear_error(&error);
     return session;
-#if 0
-    if (audacious_remote_is_running(session)) {
-        return session;
-    }
-    else {
-        return NULL;
-    }
-#endif
 }
 
 static gboolean
@@ -93,7 +85,6 @@
 {
 	gint playpos = 0;
 	gchar *song = NULL, *tmp = NULL;
-//    DBusGProxy *session = get_dbus_proxy();
 
 	gboolean rv = TRUE;
 	size_t dummy;
@@ -292,7 +283,6 @@
 	key = g_strdup_printf("%s %s", account->username, account->protocol_id);
 
 	/* retrieve current alias */
-//	current = purple_url_decode(purple_account_get_alias(account));
 	current = purple_account_get_alias(account);
 	if(current == NULL || strlen(current) == 0) {
 		aud_error("couldn't get current alias\n");
@@ -307,7 +297,6 @@
     /* if current alias differs from pushed_alias or contains token, replace seed with current. */
     if( (pushed && g_ascii_strcasecmp(current, pushed)) || strstr(current, SONG_TOKEN) ) {
 		g_hash_table_replace(seed_alias, g_strdup(key), g_strdup(current));
-//		g_hash_table_replace(pushed_alias, g_strdup(key), g_strdup(current)); //XXX should do?
     }
 
 	/* construct new status message */
@@ -491,7 +480,7 @@
 	PURPLE_PRIORITY_DEFAULT,	/**< priority	*/
 	PIDGINAUD_PLUGIN_ID,		/**< id		*/
 	"Pidgin-Audacious",			/**< name	*/
-	"2.0.0d4",					/**< version	*/
+	"2.0.0",					/**< version	*/
 	"Automatically updates your Pidgin status info	with the currently "
 			"playing music in Audacious.", /**  summary	*/
 	"Automatically updates your Pidgin status info with the currently "