| 254 * @param new_title New title to set, or NULL/empty to not change title. |
254 * @param new_title New title to set, or NULL/empty to not change title. |
| 255 * |
255 * |
| 256 * If new_artist and new_title are NULL/empty, deactivate PURPLE_STATUS_TUNE. |
256 * If new_artist and new_title are NULL/empty, deactivate PURPLE_STATUS_TUNE. |
| 257 * |
257 * |
| 258 * This function is useful because it lets you set the artist or title |
258 * This function is useful because it lets you set the artist or title |
| 259 * individually, which purple_prpl_got_user_status() doesn't do. |
259 * individually, which purple_protocol_got_user_status() doesn't do. |
| 260 */ |
260 */ |
| 261 static void msim_set_artist_or_title(MsimUser *user, const char *new_artist, const char *new_title) |
261 static void msim_set_artist_or_title(MsimUser *user, const char *new_artist, const char *new_title) |
| 262 { |
262 { |
| 263 PurplePresence *presence; |
263 PurplePresence *presence; |
| 264 PurpleAccount *account; |
264 PurpleAccount *account; |
| 279 |
279 |
| 280 account = purple_buddy_get_account(user->buddy); |
280 account = purple_buddy_get_account(user->buddy); |
| 281 name = purple_buddy_get_name(user->buddy); |
281 name = purple_buddy_get_name(user->buddy); |
| 282 |
282 |
| 283 if (!new_artist && !new_title) { |
283 if (!new_artist && !new_title) { |
| 284 purple_prpl_got_user_status_deactive(account, name, "tune"); |
284 purple_protocol_got_user_status_deactive(account, name, "tune"); |
| 285 return; |
285 return; |
| 286 } |
286 } |
| 287 |
287 |
| 288 presence = purple_buddy_get_presence(user->buddy); |
288 presence = purple_buddy_get_presence(user->buddy); |
| 289 |
289 |
| 299 new_artist = prev_artist; |
299 new_artist = prev_artist; |
| 300 |
300 |
| 301 if (!new_title) |
301 if (!new_title) |
| 302 new_title = prev_title; |
302 new_title = prev_title; |
| 303 |
303 |
| 304 purple_prpl_got_user_status(account, name, "tune", |
304 purple_protocol_got_user_status(account, name, "tune", |
| 305 PURPLE_TUNE_TITLE, new_title, |
305 PURPLE_TUNE_TITLE, new_title, |
| 306 PURPLE_TUNE_ARTIST, new_artist, |
306 PURPLE_TUNE_ARTIST, new_artist, |
| 307 NULL); |
307 NULL); |
| 308 } |
308 } |
| 309 |
309 |