comparison src/protocols/oscar/oscar.c @ 4282:aa20cc16dc08

[gaim-migrate @ 4533] Let's see here... I kinda rewrote normalize. I think it should be more efficient this way, because memory isn't allocated. I dunno. That function is called quite a bit, though. The ngettext thing is cool, but having parameters in the right order is cooler. :-) I made is so aliases on the server list overwrite the local aliases. They would only be the same if you sign on elsewhere and change them, so this should be ok. I renamed some variables in ssi.c. Time Warner is still a horrible, horrible company. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 10 Jan 2003 23:08:56 +0000
parents 32fcf4cf5f80
children 78a3d2caf84c
comparison
equal deleted inserted replaced
4281:d956ac6157cd 4282:aa20cc16dc08
2348 sizeof(buf), 2348 sizeof(buf),
2349 ngettext( 2349 ngettext(
2350 "You missed %hu message from %s because it was invalid.", 2350 "You missed %hu message from %s because it was invalid.",
2351 "You missed %hu messages from %s because they were invalid.", 2351 "You missed %hu messages from %s because they were invalid.",
2352 nummissed), 2352 nummissed),
2353 userinfo->sn, 2353 nummissed,
2354 nummissed); 2354 userinfo->sn);
2355 break; 2355 break;
2356 case 1: 2356 case 1:
2357 /* Message too large */ 2357 /* Message too large */
2358 g_snprintf(buf, 2358 g_snprintf(buf,
2359 sizeof(buf), 2359 sizeof(buf),
2360 ngettext( 2360 ngettext(
2361 "You missed %hu message from %s because it was too large.", 2361 "You missed %hu message from %s because it was too large.",
2362 "You missed %hu messages from %s because they were too large.", 2362 "You missed %hu messages from %s because they were too large.",
2363 nummissed), 2363 nummissed),
2364 userinfo->sn, 2364 nummissed,
2365 nummissed); 2365 userinfo->sn);
2366 break; 2366 break;
2367 case 2: 2367 case 2:
2368 /* Rate exceeded */ 2368 /* Rate exceeded */
2369 g_snprintf(buf, 2369 g_snprintf(buf,
2370 sizeof(buf), 2370 sizeof(buf),
2371 ngettext( 2371 ngettext(
2372 "You missed %hu message from %s because the rate limit has been exceeded.", 2372 "You missed %hu message from %s because the rate limit has been exceeded.",
2373 "You missed %hu messages from %s because the rate limit has been exceeded.", 2373 "You missed %hu messages from %s because the rate limit has been exceeded.",
2374 nummissed), 2374 nummissed),
2375 userinfo->sn, 2375 nummissed,
2376 nummissed); 2376 userinfo->sn);
2377 break; 2377 break;
2378 case 3: 2378 case 3:
2379 /* Evil Sender */ 2379 /* Evil Sender */
2380 g_snprintf(buf, 2380 g_snprintf(buf,
2381 sizeof(buf), 2381 sizeof(buf),
2382 ngettext( 2382 ngettext(
2383 "You missed %hu message from %s because he/she was too evil.", 2383 "You missed %hu message from %s because he/she was too evil.",
2384 "You missed %hu messages from %s because he/she was too evil.", 2384 "You missed %hu messages from %s because he/she was too evil.",
2385 nummissed), 2385 nummissed),
2386 userinfo->sn, 2386 nummissed,
2387 nummissed); 2387 userinfo->sn);
2388 break; 2388 break;
2389 case 4: 2389 case 4:
2390 /* Evil Receiver */ 2390 /* Evil Receiver */
2391 g_snprintf(buf, 2391 g_snprintf(buf,
2392 sizeof(buf), 2392 sizeof(buf),
2393 ngettext( 2393 ngettext(
2394 "You missed %hu message from %s because you are too evil.", 2394 "You missed %hu message from %s because you are too evil.",
2395 "You missed %hu messages from %s because you are too evil.", 2395 "You missed %hu messages from %s because you are too evil.",
2396 nummissed), 2396 nummissed),
2397 userinfo->sn, 2397 nummissed,
2398 nummissed); 2398 userinfo->sn);
2399 break; 2399 break;
2400 default: 2400 default:
2401 g_snprintf(buf, 2401 g_snprintf(buf,
2402 sizeof(buf), 2402 sizeof(buf),
2403 ngettext( 2403 ngettext(
2404 "You missed %hu message from %s for an unknown reason.", 2404 "You missed %hu message from %s for an unknown reason.",
2405 "You missed %hu messages from %s for an unknown reason.", 2405 "You missed %hu messages from %s for an unknown reason.",
2406 nummissed), 2406 nummissed),
2407 userinfo->sn, 2407 nummissed,
2408 nummissed); 2408 userinfo->sn);
2409 break; 2409 break;
2410 } 2410 }
2411 do_error_dialog(buf, NULL, GAIM_ERROR); 2411 do_error_dialog(buf, NULL, GAIM_ERROR);
2412 2412
2413 return 1; 2413 return 1;
4123 for (curitem=sess->ssi.local; curitem; curitem=curitem->next) { 4123 for (curitem=sess->ssi.local; curitem; curitem=curitem->next) {
4124 switch (curitem->type) { 4124 switch (curitem->type) {
4125 case 0x0000: { /* Buddy */ 4125 case 0x0000: { /* Buddy */
4126 if (curitem->name) { 4126 if (curitem->name) {
4127 char *gname = aim_ssi_itemlist_findparentname(od->sess->ssi.local, curitem->name); 4127 char *gname = aim_ssi_itemlist_findparentname(od->sess->ssi.local, curitem->name);
4128 if (!find_buddy(gc, curitem->name)) { 4128 char *alias = aim_ssi_getalias(sess->ssi.local, gname, curitem->name);
4129 char *alias = aim_ssi_getalias(sess->ssi.local, gname, curitem->name); 4129 struct buddy *buddy = find_buddy(gc, curitem->name);
4130 if (buddy) {
4131 if (alias)
4132 strcpy(buddy->alias, alias);
4133 } else {
4130 debug_printf("ssi: adding buddy %s to group %s to local list\n", curitem->name, gname); 4134 debug_printf("ssi: adding buddy %s to group %s to local list\n", curitem->name, gname);
4131 add_buddy(gc, (gname ? gname : "orphans"), curitem->name, alias); 4135 add_buddy(gc, (gname ? gname : "orphans"), curitem->name, alias);
4132 free(alias);
4133 tmp++; 4136 tmp++;
4134 } 4137 }
4135 if (curitem->name && gname && aim_ssi_waitingforauth(sess->ssi.local, gname, curitem->name)) 4138 if (curitem->name && gname && aim_ssi_waitingforauth(sess->ssi.local, gname, curitem->name))
4136 gaim_auth_sendrequest(gc, curitem->name); 4139 gaim_auth_sendrequest(gc, curitem->name);
4137 4140 free(alias);
4138 } 4141 }
4139 } break; 4142 } break;
4140 4143
4141 case 0x0001: { /* Group */ 4144 case 0x0001: { /* Group */
4142 if (curitem->name && !find_group(gc, curitem->name)) 4145 /* Shouldn't add empty groups */
4143 add_group(gc, curitem->name);
4144 } break; 4146 } break;
4145 4147
4146 case 0x0002: { /* Permit buddy */ 4148 case 0x0002: { /* Permit buddy */
4147 if (curitem->name) { 4149 if (curitem->name) {
4148 /* if (!find_permdeny_by_name(gc->permit, curitem->name)) { AAA */ 4150 /* if (!find_permdeny_by_name(gc->permit, curitem->name)) { AAA */