From: Richard L. <rl...@us...> - 2006-01-09 22:28:31
|
Update of /cvsroot/gaim/gaim/src/protocols/yahoo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27131/src/protocols/yahoo Modified Files: yahoo.c yahoo.h Log Message: SF Patch #1389870 from Bleeter, building on work in SF Patch #1114194 from Alex Badea "Following on from #1114194, where I thought that sending audibles is a little twitty because we can't see what's going on, I also noted that it would be nice if we could display the URL wheree the audible swf file lived. The example URL provided only supported US locales, which also needed addressing. I've tested this patch with the Taiwain audible, named within the patch, by confirming that the URL pattern match actually works. Whether it actually works when sent from a Taiwanese YIM native client, I have no idea. It looks like it should. Just to re-iterate: This patch displays the the received audible's URL and text only, not the audible swf file itself, nor does it send anything." Index: yahoo.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/yahoo.c,v retrieving revision 1.381 retrieving revision 1.382 diff -u -d -p -r1.381 -r1.382 --- yahoo.c 9 Jan 2006 21:29:53 -0000 1.381 +++ yahoo.c 9 Jan 2006 22:28:17 -0000 1.382 @@ -1955,7 +1955,7 @@ static void yahoo_process_p2p(GaimConnec static void yahoo_process_audible(GaimConnection *gc, struct yahoo_packet *pkt) { - char *who = NULL, *msg = NULL; + char *who = NULL, *msg = NULL, *id = NULL; GSList *l = pkt->hash; while (l) { @@ -1969,7 +1969,9 @@ static void yahoo_process_audible(GaimCo /* us */ break; case 230: - /* the audible, in foo.bar.baz format */ + /* the audible, in foo.locale.bar.baz format + eg: base.tw.smiley.smiley43 */ + id = pair->value; break; case 231: /* the text of the audible */ @@ -1983,6 +1985,8 @@ static void yahoo_process_audible(GaimCo l = l->next; } + if (!msg) + msg = id; if (!who || !msg) return; if (!g_utf8_validate(msg, -1, NULL)) { @@ -1994,7 +1998,16 @@ static void yahoo_process_audible(GaimCo gc->account->username, who); return; } - serv_got_im(gc, who, msg, 0, time(NULL)); + if (id) { + /* "http://us.dl1.yimg.com/download.yahoo.com/dl/aud/"+locale+"/"+id+".swf" */ + char **audible_locale = g_strsplit(id, ".", 0); + char *buf = g_strdup_printf(_("[ Audible %s/%s/%s.swf ] %s"), YAHOO_AUDIBLE_URL, audible_locale[1], id, msg); + g_strfreev(audible_locale); + + serv_got_im(gc, who, buf, 0, time(NULL)); + g_free(buf); + } else + serv_got_im(gc, who, msg, 0, time(NULL)); } static void yahoo_packet_process(GaimConnection *gc, struct yahoo_packet *pkt) @@ -2109,6 +2122,7 @@ static void yahoo_packet_process(GaimCon break; case YAHOO_SERVICE_AUDIBLE: yahoo_process_audible(gc, pkt); + break; default: gaim_debug(GAIM_DEBUG_ERROR, "yahoo", "Unhandled service 0x%02x\n", pkt->service); Index: yahoo.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/yahoo.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -p -r1.45 -r1.46 --- yahoo.h 4 Dec 2005 18:19:55 -0000 1.45 +++ yahoo.h 9 Jan 2006 22:28:17 -0000 1.46 @@ -43,6 +43,8 @@ #define YAHOOJP_XFER_HOST "filetransfer.msg.yahoo.co.jp" #define YAHOOJP_WEBCAM_HOST "wc.yahoo.co.jp" +#define YAHOO_AUDIBLE_URL "http://us.dl1.yimg.com/download.yahoo.com/dl/aud" + #define WEBMESSENGER_URL "http://login.yahoo.com/config/login?.src=pg" #define YAHOO_ICON_CHECKSUM_KEY "icon_checksum" |