Mercurial > pidgin
comparison libpurple/protocols/oscar/oscar.c @ 28489:05fd23db0a68
oscar: Replace magic numbers with enums.
Another patch from Aman "tmm1" Gupta.
committer: Paul Aurich <paul@darkrain42.org>
author | aman@tmm1.net |
---|---|
date | Tue, 03 Nov 2009 05:34:36 +0000 |
parents | 807c73d10f7e |
children | 45583f271c02 |
comparison
equal
deleted
inserted
replaced
28488:807c73d10f7e | 28489:05fd23db0a68 |
---|---|
5274 | 5274 |
5275 /* Add from server list to local list */ | 5275 /* Add from server list to local list */ |
5276 for (curitem=od->ssi.local; curitem; curitem=curitem->next) { | 5276 for (curitem=od->ssi.local; curitem; curitem=curitem->next) { |
5277 if ((curitem->name == NULL) || (g_utf8_validate(curitem->name, -1, NULL))) | 5277 if ((curitem->name == NULL) || (g_utf8_validate(curitem->name, -1, NULL))) |
5278 switch (curitem->type) { | 5278 switch (curitem->type) { |
5279 case 0x0000: { /* Buddy */ | 5279 case AIM_SSI_TYPE_BUDDY: { /* Buddy */ |
5280 if (curitem->name) { | 5280 if (curitem->name) { |
5281 struct aim_ssi_item *groupitem; | 5281 struct aim_ssi_item *groupitem; |
5282 char *gname, *gname_utf8, *alias, *alias_utf8; | 5282 char *gname, *gname_utf8, *alias, *alias_utf8; |
5283 | 5283 |
5284 groupitem = aim_ssi_itemlist_find(od->ssi.local, curitem->gid, 0x0000); | 5284 groupitem = aim_ssi_itemlist_find(od->ssi.local, curitem->gid, 0x0000); |
5340 g_free(gname_utf8); | 5340 g_free(gname_utf8); |
5341 g_free(alias_utf8); | 5341 g_free(alias_utf8); |
5342 } | 5342 } |
5343 } break; | 5343 } break; |
5344 | 5344 |
5345 case 0x0001: { /* Group */ | 5345 case AIM_SSI_TYPE_GROUP: { /* Group */ |
5346 char *gname; | 5346 char *gname; |
5347 char *gname_utf8; | 5347 char *gname_utf8; |
5348 | 5348 |
5349 gname = curitem->name; | 5349 gname = curitem->name; |
5350 if (gname != NULL) { | 5350 if (gname != NULL) { |
5360 purple_blist_add_group(g, NULL); | 5360 purple_blist_add_group(g, NULL); |
5361 } | 5361 } |
5362 g_free(gname_utf8); | 5362 g_free(gname_utf8); |
5363 } break; | 5363 } break; |
5364 | 5364 |
5365 case 0x0002: { /* Permit buddy */ | 5365 case AIM_SSI_TYPE_PERMIT: { /* Permit buddy */ |
5366 if (curitem->name) { | 5366 if (curitem->name) { |
5367 /* if (!find_permdeny_by_name(gc->permit, curitem->name)) { AAA */ | 5367 /* if (!find_permdeny_by_name(gc->permit, curitem->name)) { AAA */ |
5368 GSList *list; | 5368 GSList *list; |
5369 for (list=account->permit; (list && oscar_util_name_compare(curitem->name, list->data)); list=list->next); | 5369 for (list=account->permit; (list && oscar_util_name_compare(curitem->name, list->data)); list=list->next); |
5370 if (!list) { | 5370 if (!list) { |
5373 purple_privacy_permit_add(account, curitem->name, TRUE); | 5373 purple_privacy_permit_add(account, curitem->name, TRUE); |
5374 } | 5374 } |
5375 } | 5375 } |
5376 } break; | 5376 } break; |
5377 | 5377 |
5378 case 0x0003: { /* Deny buddy */ | 5378 case AIM_SSI_TYPE_DENY: { /* Deny buddy */ |
5379 if (curitem->name) { | 5379 if (curitem->name) { |
5380 GSList *list; | 5380 GSList *list; |
5381 for (list=account->deny; (list && oscar_util_name_compare(curitem->name, list->data)); list=list->next); | 5381 for (list=account->deny; (list && oscar_util_name_compare(curitem->name, list->data)); list=list->next); |
5382 if (!list) { | 5382 if (!list) { |
5383 purple_debug_info("oscar", | 5383 purple_debug_info("oscar", |
5385 purple_privacy_deny_add(account, curitem->name, TRUE); | 5385 purple_privacy_deny_add(account, curitem->name, TRUE); |
5386 } | 5386 } |
5387 } | 5387 } |
5388 } break; | 5388 } break; |
5389 | 5389 |
5390 case 0x0004: { /* Permit/deny setting */ | 5390 case AIM_SSI_TYPE_PDINFO: { /* Permit/deny setting */ |
5391 /* | 5391 /* |
5392 * We don't inherit the permit/deny setting from the server | 5392 * We don't inherit the permit/deny setting from the server |
5393 * for ICQ because, for ICQ, this setting controls who can | 5393 * for ICQ because, for ICQ, this setting controls who can |
5394 * see your online status when you are invisible. Thus it is | 5394 * see your online status when you are invisible. Thus it is |
5395 * a part of your status and not really related to blocking. | 5395 * a part of your status and not really related to blocking. |
5403 account->perm_deny = perm_deny; | 5403 account->perm_deny = perm_deny; |
5404 } | 5404 } |
5405 } | 5405 } |
5406 } break; | 5406 } break; |
5407 | 5407 |
5408 case 0x0005: { /* Presence setting */ | 5408 case AIM_SSI_TYPE_PRESENCEPREFS: { /* Presence setting */ |
5409 /* We don't want to change Purple's setting because it applies to all accounts */ | 5409 /* We don't want to change Purple's setting because it applies to all accounts */ |
5410 } break; | 5410 } break; |
5411 } /* End of switch on curitem->type */ | 5411 } /* End of switch on curitem->type */ |
5412 } /* End of for loop */ | 5412 } /* End of for loop */ |
5413 | 5413 |