comparison libpurple/protocols/jabber/usertune.c @ 17860:84638e3af1bc

Minor compilation fixes and corrected some typos on user tune. Added convenience function for setting the user tune.
author Andreas Monitzer <pidgin@monitzer.com>
date Mon, 18 Jun 2007 01:55:54 +0000
parents 3e437e86bd6e
children 60c8535afc33
comparison
equal deleted inserted replaced
17859:beaeb7fb4dbd 17860:84638e3af1bc
105 xmlnode_insert_data(xmlnode_new_child(tunenode, "source"),tuneinfo->album,-1); 105 xmlnode_insert_data(xmlnode_new_child(tunenode, "source"),tuneinfo->album,-1);
106 if(tuneinfo->url) 106 if(tuneinfo->url)
107 xmlnode_insert_data(xmlnode_new_child(tunenode, "uri"),tuneinfo->url,-1); 107 xmlnode_insert_data(xmlnode_new_child(tunenode, "uri"),tuneinfo->url,-1);
108 if(tuneinfo->time >= 0) { 108 if(tuneinfo->time >= 0) {
109 char *length = g_strdup_printf("%d", tuneinfo->time); 109 char *length = g_strdup_printf("%d", tuneinfo->time);
110 xmlnode_insert_data(xmlnode_new_child(tunenode, "length"),tuneinfo->artist,-1); 110 xmlnode_insert_data(xmlnode_new_child(tunenode, "length"),length,-1);
111 g_free(length); 111 g_free(length);
112 } 112 }
113 if(tuneinfo->track >= 0) { 113 if(tuneinfo->track)
114 char *track = g_strdup_printf("%d", tuneinfo->year);
115 xmlnode_insert_data(xmlnode_new_child(tunenode, "track"),tuneinfo->track,-1); 114 xmlnode_insert_data(xmlnode_new_child(tunenode, "track"),tuneinfo->track,-1);
116 g_free(track);
117 }
118 } 115 }
119 116
120 jabber_pep_publish(js, publish); 117 jabber_pep_publish(js, publish);
121 /* publish is freed by jabber_pep_publish -> jabber_iq_send -> jabber_iq_free 118 /* publish is freed by jabber_pep_publish -> jabber_iq_send -> jabber_iq_free
122 (yay for well-defined memory management rules) */ 119 (yay for well-defined memory management rules) */