changeset 8:8af1f090ba9a

branch merge
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Sat, 01 Mar 2008 03:18:22 +0900
parents feb13e877029 (current diff) 76f3cd9915c5 (diff)
children d5702f04b19c
files pidgin-audacious.c
diffstat 4 files changed, 60 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgtags	Sat Mar 01 03:18:22 2008 +0900
@@ -0,0 +1,1 @@
+19782faf1f00eb56d7d4d2323ba5aab7a07603c1 2.0.0
--- a/README	Sat Mar 01 03:16:47 2008 +0900
+++ b/README	Sat Mar 01 03:18:22 2008 +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	Sat Mar 01 03:18:22 2008 +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	Sat Mar 01 03:16:47 2008 +0900
+++ b/pidgin-audacious.c	Sat Mar 01 03:18:22 2008 +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 "