libpurple/protocols/oscar/oscar.c

branch
soc.2013.gobjectification.plugins
changeset 36782
64936dae41a3
parent 36735
e336804e65d2
parent 34955
854143116575
child 36858
920cf8db7c68
equal deleted inserted replaced
36781:8fb558514134 36782:64936dae41a3
1757 } break; 1757 } break;
1758 1758
1759 case 0x07: { /* Someone has denied you authorization */ 1759 case 0x07: { /* Someone has denied you authorization */
1760 if (i >= 1) { 1760 if (i >= 1) {
1761 gchar *dialog_msg = g_strdup_printf(_("The user %u has denied your request to add them to your buddy list for the following reason:\n%s"), args->uin, msg2[0] ? msg2[0] : _("No reason given.")); 1761 gchar *dialog_msg = g_strdup_printf(_("The user %u has denied your request to add them to your buddy list for the following reason:\n%s"), args->uin, msg2[0] ? msg2[0] : _("No reason given."));
1762 purple_notify_info(gc, NULL, _("ICQ authorization denied."), 1762 purple_notify_info(gc, NULL, _("ICQ authorization denied."), dialog_msg, purple_request_cpar_from_connection(gc));
1763 dialog_msg);
1764 g_free(dialog_msg); 1763 g_free(dialog_msg);
1765 } 1764 }
1766 } break; 1765 } break;
1767 1766
1768 case 0x08: { /* Someone has granted you authorization */ 1767 case 0x08: { /* Someone has granted you authorization */
1769 gchar *dialog_msg = g_strdup_printf(_("The user %u has granted your request to add them to your buddy list."), args->uin); 1768 gchar *dialog_msg = g_strdup_printf(_("The user %u has granted your request to add them to your buddy list."), args->uin);
1770 purple_notify_info(gc, NULL, "ICQ authorization accepted.", 1769 purple_notify_info(gc, NULL, "ICQ authorization accepted.", dialog_msg, purple_request_cpar_from_connection(gc));
1771 dialog_msg);
1772 g_free(dialog_msg); 1770 g_free(dialog_msg);
1773 } break; 1771 } break;
1774 1772
1775 case 0x09: { /* Message from the Godly ICQ server itself, I think */ 1773 case 0x09: { /* Message from the Godly ICQ server itself, I think */
1776 if (i >= 5) { 1774 if (i >= 5) {
1777 gchar *dialog_msg = g_strdup_printf(_("You have received a special message\n\nFrom: %s [%s]\n%s"), msg2[0], msg2[3], msg2[5]); 1775 gchar *dialog_msg = g_strdup_printf(_("You have received a special message\n\nFrom: %s [%s]\n%s"), msg2[0], msg2[3], msg2[5]);
1778 purple_notify_info(gc, NULL, "ICQ Server Message", dialog_msg); 1776 purple_notify_info(gc, NULL, "ICQ Server Message", dialog_msg, purple_request_cpar_from_connection(gc));
1779 g_free(dialog_msg); 1777 g_free(dialog_msg);
1780 } 1778 }
1781 } break; 1779 } break;
1782 1780
1783 case 0x0d: { /* Someone has sent you a pager message from http://www.icq.com/your_uin */ 1781 case 0x0d: { /* Someone has sent you a pager message from http://www.icq.com/your_uin */
1784 if (i >= 6) { 1782 if (i >= 6) {
1785 gchar *dialog_msg = g_strdup_printf(_("You have received an ICQ page\n\nFrom: %s [%s]\n%s"), msg2[0], msg2[3], msg2[5]); 1783 gchar *dialog_msg = g_strdup_printf(_("You have received an ICQ page\n\nFrom: %s [%s]\n%s"), msg2[0], msg2[3], msg2[5]);
1786 purple_notify_info(gc, NULL, "ICQ Page", dialog_msg); 1784 purple_notify_info(gc, NULL, "ICQ Page", dialog_msg, purple_request_cpar_from_connection(gc));
1787 g_free(dialog_msg); 1785 g_free(dialog_msg);
1788 } 1786 }
1789 } break; 1787 } break;
1790 1788
1791 case 0x0e: { /* Someone has emailed you at your_uin@pager.icq.com */ 1789 case 0x0e: { /* Someone has emailed you at your_uin@pager.icq.com */
1792 if (i >= 6) { 1790 if (i >= 6) {
1793 gchar *dialog_msg = g_strdup_printf(_("You have received an ICQ email from %s [%s]\n\nMessage is:\n%s"), msg2[0], msg2[3], msg2[5]); 1791 gchar *dialog_msg = g_strdup_printf(_("You have received an ICQ email from %s [%s]\n\nMessage is:\n%s"), msg2[0], msg2[3], msg2[5]);
1794 purple_notify_info(gc, NULL, "ICQ Email", dialog_msg); 1792 purple_notify_info(gc, NULL, "ICQ Email", dialog_msg, purple_request_cpar_from_connection(gc));
1795 g_free(dialog_msg); 1793 g_free(dialog_msg);
1796 } 1794 }
1797 } break; 1795 } break;
1798 1796
1799 case 0x12: { 1797 case 0x12: {
2037 nummissed, 2035 nummissed,
2038 userinfo->bn); 2036 userinfo->bn);
2039 break; 2037 break;
2040 } 2038 }
2041 2039
2042 if (!purple_conversation_present_error(userinfo->bn, account, buf)) 2040 if (!purple_conversation_present_error(userinfo->bn, account, buf)) {
2043 purple_notify_error(od->gc, NULL, buf, NULL); 2041 purple_notify_error(od->gc, NULL, buf, NULL,
2042 purple_request_cpar_from_connection(od->gc));
2043 }
2044 g_free(buf); 2044 g_free(buf);
2045 2045
2046 return 1; 2046 return 1;
2047 } 2047 }
2048 2048
2235 msg = va_arg(ap, char *); 2235 msg = va_arg(ap, char *);
2236 va_end(ap); 2236 va_end(ap);
2237 2237
2238 purple_debug_misc("oscar", 2238 purple_debug_misc("oscar",
2239 "MOTD: %s (%hu)\n", msg ? msg : "Unknown", id); 2239 "MOTD: %s (%hu)\n", msg ? msg : "Unknown", id);
2240 if (id < 4) 2240 if (id < 4) {
2241 purple_notify_warning(od->gc, NULL, 2241 purple_notify_warning(od->gc, NULL,
2242 _("Your AIM connection may be lost."), NULL); 2242 _("Your AIM connection may be lost."), NULL,
2243 purple_request_cpar_from_connection(od->gc));
2244 }
2243 2245
2244 return 1; 2246 return 1;
2245 } 2247 }
2246 2248
2247 static int purple_chatnav_info(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { 2249 static int purple_chatnav_info(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) {
2645 } 2647 }
2646 2648
2647 username = purple_account_get_username(purple_connection_get_account(gc)); 2649 username = purple_account_get_username(purple_connection_get_account(gc));
2648 if (oscar_util_name_compare(username, new_display_name)) { 2650 if (oscar_util_name_compare(username, new_display_name)) {
2649 purple_notify_error(gc, NULL, _("The new formatting is invalid."), 2651 purple_notify_error(gc, NULL, _("The new formatting is invalid."),
2650 _("Username formatting can change only capitalization and whitespace.")); 2652 _("Username formatting can change only capitalization and whitespace."),
2653 purple_request_cpar_from_connection(gc));
2651 return; 2654 return;
2652 } 2655 }
2653 2656
2654 tmp = g_strdup(new_display_name); 2657 tmp = g_strdup(new_display_name);
2655 2658
2811 results = purple_notify_searchresults_new(); 2814 results = purple_notify_searchresults_new();
2812 2815
2813 if (results == NULL) { 2816 if (results == NULL) {
2814 purple_debug_error("oscar", "purple_parse_searchreply: " 2817 purple_debug_error("oscar", "purple_parse_searchreply: "
2815 "Unable to display the search results.\n"); 2818 "Unable to display the search results.\n");
2816 purple_notify_error(gc, NULL, 2819 purple_notify_error(gc, NULL, _("Unable to display the search "
2817 _("Unable to display the search results."), 2820 "results."), NULL,
2818 NULL); 2821 purple_request_cpar_from_connection(gc));
2819 return 1; 2822 return 1;
2820 } 2823 }
2821 2824
2822 secondary = g_strdup_printf( 2825 secondary = g_strdup_printf(
2823 dngettext(PACKAGE, "The following username is associated with %s", 2826 dngettext(PACKAGE, "The following username is associated with %s",
2850 va_start(ap, fr); 2853 va_start(ap, fr);
2851 email = va_arg(ap, char *); 2854 email = va_arg(ap, char *);
2852 va_end(ap); 2855 va_end(ap);
2853 2856
2854 buf = g_strdup_printf(_("No results found for email address %s"), email); 2857 buf = g_strdup_printf(_("No results found for email address %s"), email);
2855 purple_notify_error(od->gc, NULL, buf, NULL); 2858 purple_notify_error(od->gc, NULL, buf, NULL,
2859 purple_request_cpar_from_connection(od->gc));
2856 g_free(buf); 2860 g_free(buf);
2857 2861
2858 return 1; 2862 return 1;
2859 } 2863 }
2860 2864
2872 "account confirmation returned status 0x%04x (%s)\n", status, 2876 "account confirmation returned status 0x%04x (%s)\n", status,
2873 status ? "unknown" : "email sent"); 2877 status ? "unknown" : "email sent");
2874 if (!status) { 2878 if (!status) {
2875 g_snprintf(msg, sizeof(msg), _("You should receive an email asking to confirm %s."), 2879 g_snprintf(msg, sizeof(msg), _("You should receive an email asking to confirm %s."),
2876 purple_account_get_username(purple_connection_get_account(gc))); 2880 purple_account_get_username(purple_connection_get_account(gc)));
2877 purple_notify_info(gc, NULL, _("Account Confirmation Requested"), msg); 2881 purple_notify_info(gc, NULL, _("Account Confirmation Requested"),
2882 msg, purple_request_cpar_from_connection(gc));
2878 } 2883 }
2879 2884
2880 return 1; 2885 return 1;
2881 } 2886 }
2882 2887
2918 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change email address because the given address has too many usernames associated with it."), err); 2923 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change email address because the given address has too many usernames associated with it."), err);
2919 else if (err == 0x0023) 2924 else if (err == 0x0023)
2920 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change email address because the given address is invalid."), err); 2925 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change email address because the given address is invalid."), err);
2921 else 2926 else
2922 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unknown error."), err); 2927 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unknown error."), err);
2923 purple_notify_error(gc, NULL, 2928 purple_notify_error(gc, NULL, _("Error Changing Account Info"),
2924 _("Error Changing Account Info"), dialog_msg); 2929 dialog_msg, purple_request_cpar_from_connection(gc));
2925 g_free(dialog_msg); 2930 g_free(dialog_msg);
2926 return 1; 2931 return 1;
2927 } 2932 }
2928 2933
2929 if (email != NULL) { 2934 if (email != NULL) {
2930 char *dialog_msg = g_strdup_printf(_("The email address for %s is %s"), 2935 char *dialog_msg = g_strdup_printf(_("The email address for %s is %s"),
2931 purple_account_get_username(purple_connection_get_account(gc)), email); 2936 purple_account_get_username(purple_connection_get_account(gc)), email);
2932 purple_notify_info(gc, NULL, _("Account Info"), dialog_msg); 2937 purple_notify_info(gc, NULL, _("Account Info"), dialog_msg,
2938 purple_request_cpar_from_connection(gc));
2933 g_free(dialog_msg); 2939 g_free(dialog_msg);
2934 } 2940 }
2935 2941
2936 return 1; 2942 return 1;
2937 } 2943 }
3350 { 3356 {
3351 purple_notify_warning(gc, NULL, _("Unable to set AIM profile."), 3357 purple_notify_warning(gc, NULL, _("Unable to set AIM profile."),
3352 _("You have probably requested to set your " 3358 _("You have probably requested to set your "
3353 "profile before the login procedure completed. " 3359 "profile before the login procedure completed. "
3354 "Your profile remains unset; try setting it " 3360 "Your profile remains unset; try setting it "
3355 "again when you are fully connected.")); 3361 "again when you are fully connected."),
3362 purple_request_cpar_from_connection(gc));
3356 } 3363 }
3357 else if (rawinfo != NULL) 3364 else if (rawinfo != NULL)
3358 { 3365 {
3359 char *htmlinfo = purple_strdup_withhtml(rawinfo); 3366 char *htmlinfo = purple_strdup_withhtml(rawinfo);
3360 info = oscar_encode_im(htmlinfo, &infolen, NULL, &info_encoding); 3367 info = oscar_encode_im(htmlinfo, &infolen, NULL, &info_encoding);
3366 errstr = g_strdup_printf(dngettext(PACKAGE, "The maximum profile length of %d byte " 3373 errstr = g_strdup_printf(dngettext(PACKAGE, "The maximum profile length of %d byte "
3367 "has been exceeded. It has been truncated for you.", 3374 "has been exceeded. It has been truncated for you.",
3368 "The maximum profile length of %d bytes " 3375 "The maximum profile length of %d bytes "
3369 "has been exceeded. It has been truncated for you.", 3376 "has been exceeded. It has been truncated for you.",
3370 od->rights.maxsiglen), od->rights.maxsiglen); 3377 od->rights.maxsiglen), od->rights.maxsiglen);
3371 purple_notify_warning(gc, NULL, _("Profile too long."), errstr); 3378 purple_notify_warning(gc, NULL, _("Profile too long."),
3379 errstr, purple_request_cpar_from_connection(gc));
3372 g_free(errstr); 3380 g_free(errstr);
3373 } 3381 }
3374 } 3382 }
3375 3383
3376 if (setstatus) 3384 if (setstatus)
3400 errstr = g_strdup_printf(dngettext(PACKAGE, "The maximum away message length of %d byte " 3408 errstr = g_strdup_printf(dngettext(PACKAGE, "The maximum away message length of %d byte "
3401 "has been exceeded. It has been truncated for you.", 3409 "has been exceeded. It has been truncated for you.",
3402 "The maximum away message length of %d bytes " 3410 "The maximum away message length of %d bytes "
3403 "has been exceeded. It has been truncated for you.", 3411 "has been exceeded. It has been truncated for you.",
3404 od->rights.maxawaymsglen), od->rights.maxawaymsglen); 3412 od->rights.maxawaymsglen), od->rights.maxawaymsglen);
3405 purple_notify_warning(gc, NULL, _("Away message too long."), errstr); 3413 purple_notify_warning(gc, NULL,
3414 _("Away message too long."), errstr,
3415 purple_request_cpar_from_connection(gc));
3406 g_free(errstr); 3416 g_free(errstr);
3407 } 3417 }
3408 } 3418 }
3409 } 3419 }
3410 3420
3502 3512
3503 if (!oscar_util_valid_name(bname)) { 3513 if (!oscar_util_valid_name(bname)) {
3504 gchar *buf; 3514 gchar *buf;
3505 buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), bname); 3515 buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), bname);
3506 if (!purple_conversation_present_error(bname, account, buf)) 3516 if (!purple_conversation_present_error(bname, account, buf))
3507 purple_notify_error(gc, NULL, _("Unable to Add"), buf); 3517 purple_notify_error(gc, NULL, _("Unable to Add"), buf, purple_request_cpar_from_connection(gc));
3508 g_free(buf); 3518 g_free(buf);
3509 3519
3510 /* Remove from local list */ 3520 /* Remove from local list */
3511 purple_blist_remove_buddy(buddy); 3521 purple_blist_remove_buddy(buddy);
3512 3522
3639 /* We only show this error the first time it happens */ 3649 /* We only show this error the first time it happens */
3640 purple_notify_error(gc, NULL, 3650 purple_notify_error(gc, NULL,
3641 _("Unable to Retrieve Buddy List"), 3651 _("Unable to Retrieve Buddy List"),
3642 _("The AIM servers were temporarily unable to send " 3652 _("The AIM servers were temporarily unable to send "
3643 "your buddy list. Your buddy list is not lost, and " 3653 "your buddy list. Your buddy list is not lost, and "
3644 "will probably become available in a few minutes.")); 3654 "will probably become available in a few minutes."),
3655 purple_request_cpar_from_connection(gc));
3645 od->getblisttimer = purple_timeout_add_seconds(30, purple_ssi_rerequestdata, od); 3656 od->getblisttimer = purple_timeout_add_seconds(30, purple_ssi_rerequestdata, od);
3646 return 1; 3657 return 1;
3647 } 3658 }
3648 3659
3649 return 1; 3660 return 1;
3968 3979
3969 case 0x000c: { /* you are over the limit, the cheat is to the limit, come on fhqwhgads */ 3980 case 0x000c: { /* you are over the limit, the cheat is to the limit, come on fhqwhgads */
3970 gchar *buf; 3981 gchar *buf;
3971 buf = g_strdup_printf(_("Unable to add the buddy %s because you have too many buddies in your buddy list. Please remove one and try again."), (retval->name ? retval->name : _("(no name)"))); 3982 buf = g_strdup_printf(_("Unable to add the buddy %s because you have too many buddies in your buddy list. Please remove one and try again."), (retval->name ? retval->name : _("(no name)")));
3972 if ((retval->name != NULL) && !purple_conversation_present_error(retval->name, purple_connection_get_account(gc), buf)) 3983 if ((retval->name != NULL) && !purple_conversation_present_error(retval->name, purple_connection_get_account(gc), buf))
3973 purple_notify_error(gc, NULL, _("Unable to Add"), buf); 3984 purple_notify_error(gc, NULL, _("Unable to Add"), buf, purple_request_cpar_from_connection(gc));
3974 g_free(buf); 3985 g_free(buf);
3975 } break; 3986 } break;
3976 3987
3977 case 0x000e: { /* buddy requires authorization */ 3988 case 0x000e: { /* buddy requires authorization */
3978 if ((retval->action == SNAC_SUBTYPE_FEEDBAG_ADD) && (retval->name)) 3989 if ((retval->action == SNAC_SUBTYPE_FEEDBAG_ADD) && (retval->name))
3983 gchar *buf; 3994 gchar *buf;
3984 purple_debug_error("oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack); 3995 purple_debug_error("oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack);
3985 buf = g_strdup_printf(_("Unable to add the buddy %s for an unknown reason."), 3996 buf = g_strdup_printf(_("Unable to add the buddy %s for an unknown reason."),
3986 (retval->name ? retval->name : _("(no name)"))); 3997 (retval->name ? retval->name : _("(no name)")));
3987 if ((retval->name != NULL) && !purple_conversation_present_error(retval->name, purple_connection_get_account(gc), buf)) 3998 if ((retval->name != NULL) && !purple_conversation_present_error(retval->name, purple_connection_get_account(gc), buf))
3988 purple_notify_error(gc, NULL, _("Unable to Add"), buf); 3999 purple_notify_error(gc, NULL, _("Unable to Add"), buf, purple_request_cpar_from_connection(gc));
3989 g_free(buf); 4000 g_free(buf);
3990 } break; 4001 } break;
3991 } 4002 }
3992 4003
3993 retval = retval->next; 4004 retval = retval->next;
4169 nombre = g_strdup(bn); 4180 nombre = g_strdup(bn);
4170 4181
4171 if (reply) { 4182 if (reply) {
4172 /* Granted */ 4183 /* Granted */
4173 dialog_msg = g_strdup_printf(_("The user %s has granted your request to add them to your buddy list."), nombre); 4184 dialog_msg = g_strdup_printf(_("The user %s has granted your request to add them to your buddy list."), nombre);
4174 purple_notify_info(gc, NULL, _("Authorization Granted"), dialog_msg); 4185 purple_notify_info(gc, NULL, _("Authorization Granted"),
4186 dialog_msg, purple_request_cpar_from_connection(gc));
4175 } else { 4187 } else {
4176 /* Denied */ 4188 /* Denied */
4177 dialog_msg = g_strdup_printf(_("The user %s has denied your request to add them to your buddy list for the following reason:\n%s"), nombre, msg ? msg : _("No reason given.")); 4189 dialog_msg = g_strdup_printf(_("The user %s has denied your request to add them to your buddy list for the following reason:\n%s"), nombre, msg ? msg : _("No reason given."));
4178 purple_notify_info(gc, NULL, _("Authorization Denied"), dialog_msg); 4190 purple_notify_info(gc, NULL, _("Authorization Denied"),
4191 dialog_msg, purple_request_cpar_from_connection(gc));
4179 } 4192 }
4180 g_free(dialog_msg); 4193 g_free(dialog_msg);
4181 g_free(nombre); 4194 g_free(nombre);
4182 4195
4183 return 1; 4196 return 1;

mercurial