| 33 xmlnode *item = xmlnode_get_child(items, "item"); |
33 xmlnode *item = xmlnode_get_child(items, "item"); |
| 34 JabberBuddy *buddy = jabber_buddy_find(js, from, FALSE); |
34 JabberBuddy *buddy = jabber_buddy_find(js, from, FALSE); |
| 35 xmlnode *tuneinfo, *tune; |
35 xmlnode *tuneinfo, *tune; |
| 36 PurpleJabberTuneInfo tuneinfodata; |
36 PurpleJabberTuneInfo tuneinfodata; |
| 37 JabberBuddyResource *resource; |
37 JabberBuddyResource *resource; |
| 38 const char *status_id; |
|
| 39 |
38 |
| 40 /* ignore the tune of people not on our buddy list */ |
39 /* ignore the tune of people not on our buddy list */ |
| 41 if (!buddy || !item) |
40 if (!buddy || !item) |
| 42 return; |
41 return; |
| 43 |
42 |
| 79 if (tuneinfodata.url == NULL) /* only pick the first one */ |
78 if (tuneinfodata.url == NULL) /* only pick the first one */ |
| 80 tuneinfodata.url = xmlnode_get_data(tuneinfo); |
79 tuneinfodata.url = xmlnode_get_data(tuneinfo); |
| 81 } |
80 } |
| 82 } |
81 } |
| 83 } |
82 } |
| 84 status_id = jabber_buddy_state_get_status_id(resource->state); |
|
| 85 |
83 |
| 86 purple_prpl_got_user_status(js->gc->account, from, status_id, |
84 purple_prpl_got_user_status(js->gc->account, from, "tune", |
| 87 PURPLE_TUNE_ARTIST, tuneinfodata.artist, |
85 PURPLE_TUNE_ARTIST, tuneinfodata.artist, |
| 88 PURPLE_TUNE_TITLE, tuneinfodata.title, |
86 PURPLE_TUNE_TITLE, tuneinfodata.title, |
| 89 PURPLE_TUNE_ALBUM, tuneinfodata.album, |
87 PURPLE_TUNE_ALBUM, tuneinfodata.album, |
| 90 PURPLE_TUNE_TRACK, tuneinfodata.track, |
88 PURPLE_TUNE_TRACK, tuneinfodata.track, |
| 91 PURPLE_TUNE_TIME, tuneinfodata.time, |
89 PURPLE_TUNE_TIME, tuneinfodata.time, |