Mercurial > pidgin.yaz
diff libpurple/protocols/jabber/jabber.c @ 27907:a64685485775
propagate from branch 'im.pidgin.pidgin' (head a4222a6a8081e1e41a29c5b01c09a31ed212eb60)
to branch 'im.pidgin.pidgin.yaz' (head f037145e58bf0c248f0bfb71758c04c604be896b)
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Sun, 23 Nov 2008 09:40:48 +0000 |
parents | 3a3d36791a47 7cda79469830 |
children | a063901a5499 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c Sun Nov 23 07:31:20 2008 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sun Nov 23 09:40:48 2008 +0000 @@ -367,8 +367,9 @@ void jabber_send(JabberStream *js, xmlnode *packet) { - char *txt; + char *txt, *utf; int len; + gsize utflen; purple_signal_emit(my_protocol, "jabber-sending-xmlnode", js->gc, &packet); @@ -377,8 +378,9 @@ return; txt = xmlnode_to_str(packet, &len); - jabber_send_raw(js, txt, len); - g_free(txt); + utf = botch_utf(txt, len, &utflen); //yaz + jabber_send_raw(js, utf, utflen); + g_free(txt); g_free(utf); } static void jabber_pong_cb(JabberStream *js, xmlnode *packet, gpointer unused) @@ -1499,7 +1501,7 @@ { char *ret = NULL; JabberBuddy *jb = NULL; - + if (b->account->gc && b->account->gc->proto_data) jb = jabber_buddy_find(b->account->gc->proto_data, b->name, FALSE); @@ -1508,13 +1510,21 @@ } else if(jb && !PURPLE_BUDDY_IS_ONLINE(b) && jb->error_msg) { ret = g_strdup(jb->error_msg); } else { - char *stripped; + char *stripped = NULL; if(!(stripped = purple_markup_strip_html(jabber_buddy_get_status_msg(jb)))) { PurplePresence *presence = purple_buddy_get_presence(b); if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { - PurpleStatus *status = purple_presence_get_status(presence, "tune"); - stripped = g_strdup(purple_status_get_attr_string(status, PURPLE_TUNE_TITLE)); + PurpleStatus *status; + const char *title, *artist; + + status = purple_presence_get_status(presence, "tune"); + title = purple_status_get_attr_string(status, PURPLE_TUNE_TITLE); + artist = purple_status_get_attr_string(status, PURPLE_TUNE_ARTIST); + + stripped = g_strdup_printf("%s%s%s", title, artist ? " - " : "", + artist ? artist : ""); + } } @@ -1585,6 +1595,7 @@ const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE); const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST); const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM); + char *playing = purple_util_format_song_info(title, artist, album, NULL); if (playing) { purple_notify_user_info_add_pair(user_info, _("Now Listening"), playing);