comparison src/protocols/oscar/oscar.c @ 7023:bbf4710e342f

[gaim-migrate @ 7586] A patch from Ambrose C. LI (acli) to change some strings in oscar.c from using "contact" to using "buddy." committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 29 Sep 2003 20:15:11 +0000
parents dece74f05509
children 53a586c3a80e
comparison
equal deleted inserted replaced
7022:23194256b793 7023:bbf4710e342f
2523 _("OK"), G_CALLBACK(gaim_auth_dontgrant), 2523 _("OK"), G_CALLBACK(gaim_auth_dontgrant),
2524 _("Cancel"), G_CALLBACK(oscar_free_name_data), 2524 _("Cancel"), G_CALLBACK(oscar_free_name_data),
2525 data); 2525 data);
2526 } 2526 }
2527 2527
2528 /* When someone sends you contacts */ 2528 /* When someone sends you buddies */
2529 static void gaim_icq_contactadd(struct name_data *data) { 2529 static void gaim_icq_buddyadd(struct name_data *data) {
2530 GaimConnection *gc = data->gc; 2530 GaimConnection *gc = data->gc;
2531 2531
2532 if (g_list_find(gaim_connections_get_all(), gc)) { 2532 if (g_list_find(gaim_connections_get_all(), gc)) {
2533 show_add_buddy(gc, data->name, NULL, data->nick); 2533 show_add_buddy(gc, data->name, NULL, data->nick);
2534 } 2534 }
2609 } 2609 }
2610 } break; 2610 } break;
2611 2611
2612 case 0x07: { /* Someone has denied you authorization */ 2612 case 0x07: { /* Someone has denied you authorization */
2613 if (i >= 1) { 2613 if (i >= 1) {
2614 gchar *dialog_msg = g_strdup_printf(_("The user %u has denied your request to add them to your contact list for the following reason:\n%s"), args->uin, msg2[0] ? msg2[0] : _("No reason given.")); 2614 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."));
2615 gaim_notify_info(gc, NULL, _("ICQ authorization denied."), 2615 gaim_notify_info(gc, NULL, _("ICQ authorization denied."),
2616 dialog_msg); 2616 dialog_msg);
2617 g_free(dialog_msg); 2617 g_free(dialog_msg);
2618 } 2618 }
2619 } break; 2619 } break;
2620 2620
2621 case 0x08: { /* Someone has granted you authorization */ 2621 case 0x08: { /* Someone has granted you authorization */
2622 gchar *dialog_msg = g_strdup_printf(_("The user %u has granted your request to add them to your contact list."), args->uin); 2622 gchar *dialog_msg = g_strdup_printf(_("The user %u has granted your request to add them to your buddy list."), args->uin);
2623 gaim_notify_info(gc, NULL, "ICQ authorization accepted.", 2623 gaim_notify_info(gc, NULL, "ICQ authorization accepted.",
2624 dialog_msg); 2624 dialog_msg);
2625 g_free(dialog_msg); 2625 g_free(dialog_msg);
2626 } break; 2626 } break;
2627 2627
2649 } 2649 }
2650 } break; 2650 } break;
2651 2651
2652 case 0x12: { 2652 case 0x12: {
2653 /* Ack for authorizing/denying someone. Or possibly an ack for sending any system notice */ 2653 /* Ack for authorizing/denying someone. Or possibly an ack for sending any system notice */
2654 /* Someone added you to their contact list? */ 2654 /* Someone added you to their buddy list? */
2655 } break; 2655 } break;
2656 2656
2657 case 0x13: { /* Someone has sent you some ICQ contacts */ 2657 case 0x13: { /* Someone has sent you some ICQ buddies */
2658 int i, num; 2658 int i, num;
2659 gchar **text; 2659 gchar **text;
2660 text = g_strsplit(args->msg, "\376", 0); 2660 text = g_strsplit(args->msg, "\376", 0);
2661 if (text) { 2661 if (text) {
2662 num = 0; 2662 num = 0;
2663 for (i=0; i<strlen(text[0]); i++) 2663 for (i=0; i<strlen(text[0]); i++)
2664 num = num*10 + text[0][i]-48; 2664 num = num*10 + text[0][i]-48;
2665 for (i=0; i<num; i++) { 2665 for (i=0; i<num; i++) {
2666 struct name_data *data = g_new(struct name_data, 1); 2666 struct name_data *data = g_new(struct name_data, 1);
2667 gchar *message = g_strdup_printf(_("ICQ user %u has sent you a contact: %s (%s)"), args->uin, text[i*2+2], text[i*2+1]); 2667 gchar *message = g_strdup_printf(_("ICQ user %u has sent you a buddy: %s (%s)"), args->uin, text[i*2+2], text[i*2+1]);
2668 data->gc = gc; 2668 data->gc = gc;
2669 data->name = g_strdup(text[i*2+1]); 2669 data->name = g_strdup(text[i*2+1]);
2670 data->nick = g_strdup(text[i*2+2]); 2670 data->nick = g_strdup(text[i*2+2]);
2671 2671
2672 gaim_request_action(gc, NULL, message, 2672 gaim_request_action(gc, NULL, message,
2673 _("Do you want to add this contact " 2673 _("Do you want to add this buddy "
2674 "to your Buddy List?"), 2674 "to your buddy list?"),
2675 0, data, 2, 2675 0, data, 2,
2676 _("Add"), G_CALLBACK(gaim_icq_contactadd), 2676 _("Add"), G_CALLBACK(gaim_icq_buddyadd),
2677 _("Decline"), G_CALLBACK(oscar_free_name_data)); 2677 _("Decline"), G_CALLBACK(oscar_free_name_data));
2678 g_free(message); 2678 g_free(message);
2679 } 2679 }
2680 g_strfreev(text); 2680 g_strfreev(text);
2681 } 2681 }
2682 } break; 2682 } break;
2683 2683
2684 case 0x1a: { /* Someone has sent you a greeting card or requested contacts? */ 2684 case 0x1a: { /* Someone has sent you a greeting card or requested buddies? */
2685 /* This is boring and silly. */ 2685 /* This is boring and silly. */
2686 } break; 2686 } break;
2687 2687
2688 default: { 2688 default: {
2689 gaim_debug(GAIM_DEBUG_INFO, "oscar", 2689 gaim_debug(GAIM_DEBUG_INFO, "oscar",
4350 else 4350 else
4351 gaim_debug(GAIM_DEBUG_ERROR, "oscar", 4351 gaim_debug(GAIM_DEBUG_ERROR, "oscar",
4352 "Error: The user %s has no status message, therefore not requesting.\n", who); 4352 "Error: The user %s has no status message, therefore not requesting.\n", who);
4353 else 4353 else
4354 gaim_debug(GAIM_DEBUG_ERROR, "oscar", 4354 gaim_debug(GAIM_DEBUG_ERROR, "oscar",
4355 "Error: Could not find %s in local contact list, therefore unable to request status message.\n", who); 4355 "Error: Could not find %s in local buddy list, therefore unable to request status message.\n", who);
4356 } else 4356 } else
4357 aim_locate_getinfoshort(od->sess, who, 0x00000002); 4357 aim_locate_getinfoshort(od->sess, who, 0x00000002);
4358 } 4358 }
4359 4359
4360 static void oscar_set_dir(GaimConnection *gc, const char *first, const char *middle, const char *last, 4360 static void oscar_set_dir(GaimConnection *gc, const char *first, const char *middle, const char *last,
4967 buf = g_strdup_printf(_("Could not 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)"))); 4967 buf = g_strdup_printf(_("Could not 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)")));
4968 gaim_notify_error(gc, NULL, _("Unable To Add"), buf); 4968 gaim_notify_error(gc, NULL, _("Unable To Add"), buf);
4969 g_free(buf); 4969 g_free(buf);
4970 } 4970 }
4971 4971
4972 case 0x000e: { /* contact requires authorization */ 4972 case 0x000e: { /* buddy requires authorization */
4973 if ((retval->action == AIM_CB_SSI_ADD) && (retval->name)) 4973 if ((retval->action == AIM_CB_SSI_ADD) && (retval->name))
4974 gaim_auth_sendrequest(gc, retval->name); 4974 gaim_auth_sendrequest(gc, retval->name);
4975 } break; 4975 } break;
4976 4976
4977 default: { /* La la la */ 4977 default: { /* La la la */
5018 data->name = g_strdup(sn); 5018 data->name = g_strdup(sn);
5019 data->nick = NULL; 5019 data->nick = NULL;
5020 5020
5021 gaim_request_yes_no(gc, NULL, _("Authorization Given"), dialog_msg, 5021 gaim_request_yes_no(gc, NULL, _("Authorization Given"), dialog_msg,
5022 0, data, 5022 0, data,
5023 G_CALLBACK(gaim_icq_contactadd), 5023 G_CALLBACK(gaim_icq_buddyadd),
5024 G_CALLBACK(oscar_free_name_data)); 5024 G_CALLBACK(oscar_free_name_data));
5025 5025
5026 g_free(dialog_msg); 5026 g_free(dialog_msg);
5027 g_free(nombre); 5027 g_free(nombre);
5028 5028
5091 else 5091 else
5092 nombre = g_strdup(sn); 5092 nombre = g_strdup(sn);
5093 5093
5094 if (reply) { 5094 if (reply) {
5095 /* Granted */ 5095 /* Granted */
5096 dialog_msg = g_strdup_printf(_("The user %s has granted your request to add them to your contact list."), nombre); 5096 dialog_msg = g_strdup_printf(_("The user %s has granted your request to add them to your buddy list."), nombre);
5097 gaim_notify_info(gc, NULL, _("Authorization Granted"), dialog_msg); 5097 gaim_notify_info(gc, NULL, _("Authorization Granted"), dialog_msg);
5098 } else { 5098 } else {
5099 /* Denied */ 5099 /* Denied */
5100 dialog_msg = g_strdup_printf(_("The user %s has denied your request to add them to your contact list for the following reason:\n%s"), nombre, msg ? msg : _("No reason given.")); 5100 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."));
5101 gaim_notify_info(gc, NULL, _("Authorization Denied"), dialog_msg); 5101 gaim_notify_info(gc, NULL, _("Authorization Denied"), dialog_msg);
5102 } 5102 }
5103 g_free(dialog_msg); 5103 g_free(dialog_msg);
5104 g_free(nombre); 5104 g_free(nombre);
5105 5105