Mercurial > pidgin
comparison libpurple/protocols/msn/msn.c @ 20519:8a4748cbf844
explicit merge of '5d4b00a88466bb9e851eaca42ab3fd3f2c4093ef'
and '26aa195b85d196378bd98ee299a60fac553d5bcd'
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sun, 16 Sep 2007 18:07:46 +0000 |
parents | 5bc492d82ff4 e73e510d56ec |
children | bd60afa72fce |
comparison
equal
deleted
inserted
replaced
20518:4b20ec37460f | 20519:8a4748cbf844 |
---|---|
352 | 352 |
353 purple_request_action(gc, NULL, _("Allow MSN Mobile pages?"), | 353 purple_request_action(gc, NULL, _("Allow MSN Mobile pages?"), |
354 _("Do you want to allow or disallow people on " | 354 _("Do you want to allow or disallow people on " |
355 "your buddy list to send you MSN Mobile pages " | 355 "your buddy list to send you MSN Mobile pages " |
356 "to your cell phone or other mobile device?"), | 356 "to your cell phone or other mobile device?"), |
357 -1, | 357 -1, |
358 purple_connection_get_account(gc), NULL, NULL, | 358 purple_connection_get_account(gc), NULL, NULL, |
359 gc, 3, | 359 gc, 3, |
360 _("Allow"), G_CALLBACK(enable_msn_pages_cb), | 360 _("Allow"), G_CALLBACK(enable_msn_pages_cb), |
361 _("Disallow"), G_CALLBACK(disable_msn_pages_cb), | 361 _("Disallow"), G_CALLBACK(disable_msn_pages_cb), |
362 _("Cancel"), NULL); | 362 _("Cancel"), NULL); |
568 PurplePresence *presence = purple_buddy_get_presence(buddy); | 568 PurplePresence *presence = purple_buddy_get_presence(buddy); |
569 PurpleStatus *status = purple_presence_get_active_status(presence); | 569 PurpleStatus *status = purple_presence_get_active_status(presence); |
570 | 570 |
571 user = buddy->proto_data; | 571 user = buddy->proto_data; |
572 | 572 |
573 | 573 |
574 if (purple_presence_is_online(presence)) | 574 if (purple_presence_is_online(presence)) |
575 { | 575 { |
576 const char *psm, *currentmedia, *name; | 576 const char *psm, *currentmedia, *name; |
577 char *tmp; | 577 char *tmp; |
578 | 578 |
607 tmp = g_markup_escape_text(currentmedia, -1); | 607 tmp = g_markup_escape_text(currentmedia, -1); |
608 purple_notify_user_info_add_pair(user_info, _("Current media"), tmp); | 608 purple_notify_user_info_add_pair(user_info, _("Current media"), tmp); |
609 g_free(tmp); | 609 g_free(tmp); |
610 } | 610 } |
611 } | 611 } |
612 | 612 |
613 if (full && user) | 613 if (full && user) |
614 { | 614 { |
615 purple_notify_user_info_add_pair(user_info, _("Has you"), | 615 purple_notify_user_info_add_pair(user_info, _("Has you"), |
616 ((user->list_op & (1 << MSN_LIST_RL)) ? _("Yes") : _("No"))); | 616 ((user->list_op & (1 << MSN_LIST_RL)) ? _("Yes") : _("No"))); |
617 } | 617 } |
813 return; | 813 return; |
814 } | 814 } |
815 | 815 |
816 http_method = purple_account_get_bool(account, "http_method", FALSE); | 816 http_method = purple_account_get_bool(account, "http_method", FALSE); |
817 | 817 |
818 host = purple_account_get_string(account, "server", MSN_SERVER); | 818 if (http_method) |
819 host = purple_account_get_string(account, "http_method_server", MSN_SERVER); | |
820 else | |
821 host = purple_account_get_string(account, "server", MSN_SERVER); | |
819 port = purple_account_get_int(account, "port", MSN_PORT); | 822 port = purple_account_get_int(account, "port", MSN_PORT); |
820 | 823 |
821 session = msn_session_new(account); | 824 session = msn_session_new(account); |
822 | 825 |
823 gc->proto_data = session; | 826 gc->proto_data = session; |
1686 | 1689 |
1687 /* Gonna re-use the memory we've already got for url_buffer */ | 1690 /* Gonna re-use the memory we've already got for url_buffer */ |
1688 /* No we're not. */ | 1691 /* No we're not. */ |
1689 s = g_string_sized_new(strlen(url_buffer)); | 1692 s = g_string_sized_new(strlen(url_buffer)); |
1690 s2 = g_string_sized_new(strlen(url_buffer)); | 1693 s2 = g_string_sized_new(strlen(url_buffer)); |
1691 | 1694 |
1692 /* General section header */ | 1695 /* General section header */ |
1693 if (has_tooltip_text) | 1696 if (has_tooltip_text) |
1694 purple_notify_user_info_add_section_break(user_info); | 1697 purple_notify_user_info_add_section_break(user_info); |
1695 | 1698 |
1696 purple_notify_user_info_add_section_header(user_info, _("General")); | 1699 purple_notify_user_info_add_section_header(user_info, _("General")); |
1697 | 1700 |
1698 /* Extract their Name and put it in */ | 1701 /* Extract their Name and put it in */ |
1699 MSN_GOT_INFO_GET_FIELD("Name", _("Name")); | 1702 MSN_GOT_INFO_GET_FIELD("Name", _("Name")); |
1700 | 1703 |
1701 /* General */ | 1704 /* General */ |
1702 MSN_GOT_INFO_GET_FIELD("Nickname", _("Nickname")); | 1705 MSN_GOT_INFO_GET_FIELD("Nickname", _("Nickname")); |
1703 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Age", _("Age")); | 1706 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Age", _("Age")); |
1704 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Gender", _("Gender")); | 1707 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Gender", _("Gender")); |
1705 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Occupation", _("Occupation")); | 1708 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Occupation", _("Occupation")); |
1713 | 1716 |
1714 if (found) | 1717 if (found) |
1715 sect_info = TRUE; | 1718 sect_info = TRUE; |
1716 | 1719 |
1717 MSN_GOT_INFO_GET_FIELD("More about me", _("A Little About Me")); | 1720 MSN_GOT_INFO_GET_FIELD("More about me", _("A Little About Me")); |
1718 | 1721 |
1719 if (sect_info) | 1722 if (sect_info) |
1720 { | 1723 { |
1721 has_info = TRUE; | 1724 has_info = TRUE; |
1722 sect_info = FALSE; | 1725 sect_info = FALSE; |
1723 } | 1726 } |
1724 else | 1727 else |
1725 { | 1728 { |
1726 /* Remove the section header */ | 1729 /* Remove the section header */ |
1727 purple_notify_user_info_remove_last_item(user_info); | 1730 purple_notify_user_info_remove_last_item(user_info); |
1728 if (has_tooltip_text) | 1731 if (has_tooltip_text) |
1729 purple_notify_user_info_remove_last_item(user_info); | 1732 purple_notify_user_info_remove_last_item(user_info); |
1730 } | 1733 } |
1731 | 1734 |
1732 /* Social */ | 1735 /* Social */ |
1733 purple_notify_user_info_add_section_break(user_info); | 1736 purple_notify_user_info_add_section_break(user_info); |
1734 purple_notify_user_info_add_section_header(user_info, _("Social")); | 1737 purple_notify_user_info_add_section_header(user_info, _("Social")); |
1735 | 1738 |
1736 MSN_GOT_INFO_GET_FIELD("Marital status", _("Marital Status")); | 1739 MSN_GOT_INFO_GET_FIELD("Marital status", _("Marital Status")); |
1737 MSN_GOT_INFO_GET_FIELD("Interested in", _("Interests")); | 1740 MSN_GOT_INFO_GET_FIELD("Interested in", _("Interests")); |
1738 MSN_GOT_INFO_GET_FIELD("Pets", _("Pets")); | 1741 MSN_GOT_INFO_GET_FIELD("Pets", _("Pets")); |
1739 MSN_GOT_INFO_GET_FIELD("Hometown", _("Hometown")); | 1742 MSN_GOT_INFO_GET_FIELD("Hometown", _("Hometown")); |
1740 MSN_GOT_INFO_GET_FIELD("Places lived", _("Places Lived")); | 1743 MSN_GOT_INFO_GET_FIELD("Places lived", _("Places Lived")); |
1746 if (sect_info) | 1749 if (sect_info) |
1747 { | 1750 { |
1748 has_info = TRUE; | 1751 has_info = TRUE; |
1749 sect_info = FALSE; | 1752 sect_info = FALSE; |
1750 } | 1753 } |
1751 else | 1754 else |
1752 { | 1755 { |
1753 /* Remove the section header */ | 1756 /* Remove the section header */ |
1754 purple_notify_user_info_remove_last_item(user_info); | 1757 purple_notify_user_info_remove_last_item(user_info); |
1755 purple_notify_user_info_remove_last_item(user_info); | 1758 purple_notify_user_info_remove_last_item(user_info); |
1756 } | 1759 } |
1778 { | 1781 { |
1779 has_info = TRUE; | 1782 has_info = TRUE; |
1780 sect_info = FALSE; | 1783 sect_info = FALSE; |
1781 has_contact_info = TRUE; | 1784 has_contact_info = TRUE; |
1782 } | 1785 } |
1783 else | 1786 else |
1784 { | 1787 { |
1785 /* Remove the section header */ | 1788 /* Remove the section header */ |
1786 purple_notify_user_info_remove_last_item(user_info); | 1789 purple_notify_user_info_remove_last_item(user_info); |
1787 } | 1790 } |
1788 | 1791 |
1808 { | 1811 { |
1809 has_info = TRUE; | 1812 has_info = TRUE; |
1810 sect_info = FALSE; | 1813 sect_info = FALSE; |
1811 has_contact_info = TRUE; | 1814 has_contact_info = TRUE; |
1812 } | 1815 } |
1813 else | 1816 else |
1814 { | 1817 { |
1815 /* Remove the section header */ | 1818 /* Remove the section header */ |
1816 purple_notify_user_info_remove_last_item(user_info); | 1819 purple_notify_user_info_remove_last_item(user_info); |
1817 } | 1820 } |
1818 | 1821 |
1983 | 1986 |
1984 /* put a link to the actual profile URL */ | 1987 /* put a link to the actual profile URL */ |
1985 tmp = g_strdup_printf("<a href=\"%s%s\">%s%s</a>", | 1988 tmp = g_strdup_printf("<a href=\"%s%s\">%s%s</a>", |
1986 PROFILE_URL, info_data->name, PROFILE_URL, info_data->name); | 1989 PROFILE_URL, info_data->name, PROFILE_URL, info_data->name); |
1987 purple_notify_user_info_add_pair(user_info, _("Profile URL"), tmp); | 1990 purple_notify_user_info_add_pair(user_info, _("Profile URL"), tmp); |
1988 g_free(tmp); | 1991 g_free(tmp); |
1989 | 1992 |
1990 #if PHOTO_SUPPORT | 1993 #if PHOTO_SUPPORT |
1991 /* Find the URL to the photo; must be before the marshalling [Bug 994207] */ | 1994 /* Find the URL to the photo; must be before the marshalling [Bug 994207] */ |
1992 photo_url_text = msn_get_photo_url(url_text); | 1995 photo_url_text = msn_get_photo_url(url_text); |
1993 purple_debug_info("MSNP14","photo url:{%s}\n",photo_url_text); | 1996 purple_debug_info("MSNP14","photo url:{%s}\n",photo_url_text); |
2311 option = purple_account_option_bool_new(_("Use HTTP Method"), | 2314 option = purple_account_option_bool_new(_("Use HTTP Method"), |
2312 "http_method", FALSE); | 2315 "http_method", FALSE); |
2313 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, | 2316 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
2314 option); | 2317 option); |
2315 | 2318 |
2319 /* TODO: Mark translatable as soon as 2.2.0 is released and we're not string frozen */ | |
2320 option = purple_account_option_string_new("HTTP Method Server", | |
2321 "http_method_server", MSN_HTTPCONN_SERVER); | |
2322 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, | |
2323 option); | |
2324 | |
2316 option = purple_account_option_bool_new(_("Show custom smileys"), | 2325 option = purple_account_option_bool_new(_("Show custom smileys"), |
2317 "custom_smileys", TRUE); | 2326 "custom_smileys", TRUE); |
2318 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, | 2327 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
2319 option); | 2328 option); |
2320 | 2329 |