Mercurial > pidgin
comparison libpurple/protocols/msn/msn.c @ 23456:00eaff9396ec
propagate from branch 'im.pidgin.pidgin' (head e39a6e9be3df05b59a878001feb9276b9ceb66a9)
to branch 'im.pidgin.pidgin.khc.msnp15' (head c5b8a906c26f5cb0fd8c7256852e3c1e346d7863)
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Wed, 06 Feb 2008 03:35:04 +0000 |
parents | aa25bb450139 6e5d37105189 |
children | 69af5301e1a7 |
comparison
equal
deleted
inserted
replaced
23455:f182cf94145c | 23456:00eaff9396ec |
---|---|
120 } | 120 } |
121 | 121 |
122 static GList * | 122 static GList * |
123 msn_attention_types(PurpleAccount *account) | 123 msn_attention_types(PurpleAccount *account) |
124 { | 124 { |
125 PurpleAttentionType *attn; | |
126 static GList *list = NULL; | 125 static GList *list = NULL; |
127 | 126 |
128 if (!list) { | 127 if (!list) { |
129 attn = g_new0(PurpleAttentionType, 1); | 128 list = g_list_append(list, purple_attention_type_new("Nudge", _("Nudge"), |
130 attn->name = _("Nudge"); | 129 _("%s has nudged you!"), _("Nudging %s..."))); |
131 attn->incoming_description = _("%s has nudged you!"); | |
132 attn->outgoing_description = _("Nudging %s..."); | |
133 list = g_list_append(list, attn); | |
134 } | 130 } |
135 | 131 |
136 return list; | 132 return list; |
137 } | 133 } |
138 | 134 |
353 | 349 |
354 purple_request_action(gc, NULL, _("Allow MSN Mobile pages?"), | 350 purple_request_action(gc, NULL, _("Allow MSN Mobile pages?"), |
355 _("Do you want to allow or disallow people on " | 351 _("Do you want to allow or disallow people on " |
356 "your buddy list to send you MSN Mobile pages " | 352 "your buddy list to send you MSN Mobile pages " |
357 "to your cell phone or other mobile device?"), | 353 "to your cell phone or other mobile device?"), |
358 -1, | 354 PURPLE_DEFAULT_ACTION_NONE, |
359 purple_connection_get_account(gc), NULL, NULL, | 355 purple_connection_get_account(gc), NULL, NULL, |
360 gc, 3, | 356 gc, 3, |
361 _("Allow"), G_CALLBACK(enable_msn_pages_cb), | 357 _("Allow"), G_CALLBACK(enable_msn_pages_cb), |
362 _("Disallow"), G_CALLBACK(disable_msn_pages_cb), | 358 _("Disallow"), G_CALLBACK(disable_msn_pages_cb), |
363 _("Cancel"), NULL); | 359 _("Cancel"), NULL); |
459 swboard = msn_switchboard_new(session); | 455 swboard = msn_switchboard_new(session); |
460 msn_switchboard_request(swboard); | 456 msn_switchboard_request(swboard); |
461 msn_switchboard_request_add_user(swboard, buddy->name); | 457 msn_switchboard_request_add_user(swboard, buddy->name); |
462 | 458 |
463 /* TODO: This might move somewhere else, after USR might be */ | 459 /* TODO: This might move somewhere else, after USR might be */ |
464 swboard->chat_id = session->conv_seq++; | 460 swboard->chat_id = msn_switchboard_get_chat_id(); |
465 swboard->conv = serv_got_joined_chat(gc, swboard->chat_id, "MSN Chat"); | 461 swboard->conv = serv_got_joined_chat(gc, swboard->chat_id, "MSN Chat"); |
466 swboard->flag = MSN_SB_FLAG_IM; | 462 swboard->flag = MSN_SB_FLAG_IM; |
467 | 463 |
468 purple_conv_chat_add_user(PURPLE_CONV_CHAT(swboard->conv), | 464 purple_conv_chat_add_user(PURPLE_CONV_CHAT(swboard->conv), |
469 purple_account_get_username(buddy->account), NULL, PURPLE_CBFLAGS_NONE, TRUE); | 465 purple_account_get_username(buddy->account), NULL, PURPLE_CBFLAGS_NONE, TRUE); |
591 psm = purple_status_get_attr_string(status, "message"); | 587 psm = purple_status_get_attr_string(status, "message"); |
592 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { | 588 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { |
593 PurpleStatus *tune = purple_presence_get_status(presence, "tune"); | 589 PurpleStatus *tune = purple_presence_get_status(presence, "tune"); |
594 const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE); | 590 const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE); |
595 const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST); | 591 const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST); |
596 currentmedia = g_strdup_printf("%s%s%s", title, artist ? " - " : "", | 592 const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM); |
597 artist ? artist : ""); | 593 currentmedia = purple_util_format_song_info(title, artist, album, NULL); |
598 /* We could probably just use user->media.title etc. here */ | 594 /* We could probably just use user->media.title etc. here */ |
599 } | 595 } |
600 | 596 |
601 if (!purple_status_is_available(status)) { | 597 if (!purple_status_is_available(status)) { |
602 name = purple_status_get_name(status); | 598 name = purple_status_get_name(status); |
641 } | 637 } |
642 } | 638 } |
643 } | 639 } |
644 | 640 |
645 if (currentmedia) { | 641 if (currentmedia) { |
646 tmp = g_markup_escape_text(currentmedia, -1); | 642 purple_notify_user_info_add_pair(user_info, _("Now Listening"), currentmedia); |
647 purple_notify_user_info_add_pair(user_info, _("Current media"), tmp); | |
648 g_free(tmp); | |
649 g_free(currentmedia); | 643 g_free(currentmedia); |
650 } | 644 } |
651 } | 645 } |
652 | 646 |
653 /* XXX: This is being shown in non-full tooltips because the | 647 /* XXX: This is being shown in non-full tooltips because the |
659 * indicating whether a particular buddy is going to be able to message | 653 * indicating whether a particular buddy is going to be able to message |
660 * you, which is the important information that this is trying to convey. | 654 * you, which is the important information that this is trying to convey. |
661 */ | 655 */ |
662 if (full && user) | 656 if (full && user) |
663 { | 657 { |
658 const char *phone; | |
659 | |
664 purple_notify_user_info_add_pair(user_info, _("Blocked"), | 660 purple_notify_user_info_add_pair(user_info, _("Blocked"), |
665 ((user->list_op & (1 << MSN_LIST_BL)) ? _("Yes") : _("No"))); | 661 ((user->list_op & (1 << MSN_LIST_BL)) ? _("Yes") : _("No"))); |
662 | |
663 phone = msn_user_get_home_phone(user); | |
664 if (phone != NULL) | |
665 purple_notify_user_info_add_pair(user_info, _("Home Phone Number"), phone); | |
666 | |
667 phone = msn_user_get_work_phone(user); | |
668 if (phone != NULL) | |
669 purple_notify_user_info_add_pair(user_info, _("Work Phone Number"), phone); | |
670 | |
671 phone = msn_user_get_mobile_phone(user); | |
672 if (phone != NULL) | |
673 purple_notify_user_info_add_pair(user_info, _("Mobile Phone Number"), phone); | |
666 } | 674 } |
667 } | 675 } |
668 | 676 |
669 static GList * | 677 static GList * |
670 msn_status_types(PurpleAccount *account) | 678 msn_status_types(PurpleAccount *account) |