pidgin: fc4b6d88: oscar: Replace magic numbers with enums.

darkrain42 at pidgin.im darkrain42 at pidgin.im
Tue Nov 3 01:01:12 EST 2009


-----------------------------------------------------------------
Revision: fc4b6d88441f4d07f1219f2c1601cc45884b8b20
Ancestor: f2d2a01f65d069b6d513155a26c2e8247f00d578
Author: aman at tmm1.net
Date: 2009-11-03T05:34:36
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/fc4b6d88441f4d07f1219f2c1601cc45884b8b20

Modified files:
        libpurple/protocols/oscar/oscar.c

ChangeLog: 

oscar: Replace magic numbers with enums.

Another patch from Aman "tmm1" Gupta.

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c	c21a47ae6f26196987044c905de8ecb11f3e4f3d
+++ libpurple/protocols/oscar/oscar.c	9282145f5e8a72ec2bcc0de15e99bf7b506830ed
@@ -5276,7 +5276,7 @@ static int purple_ssi_parselist(OscarDat
 	for (curitem=od->ssi.local; curitem; curitem=curitem->next) {
 	  if ((curitem->name == NULL) || (g_utf8_validate(curitem->name, -1, NULL)))
 		switch (curitem->type) {
-			case 0x0000: { /* Buddy */
+			case AIM_SSI_TYPE_BUDDY: { /* Buddy */
 				if (curitem->name) {
 					struct aim_ssi_item *groupitem;
 					char *gname, *gname_utf8, *alias, *alias_utf8;
@@ -5342,7 +5342,7 @@ static int purple_ssi_parselist(OscarDat
 				}
 			} break;
 
-			case 0x0001: { /* Group */
+			case AIM_SSI_TYPE_GROUP: { /* Group */
 				char *gname;
 				char *gname_utf8;
 
@@ -5362,7 +5362,7 @@ static int purple_ssi_parselist(OscarDat
 				g_free(gname_utf8);
 			} break;
 
-			case 0x0002: { /* Permit buddy */
+			case AIM_SSI_TYPE_PERMIT: { /* Permit buddy */
 				if (curitem->name) {
 					/* if (!find_permdeny_by_name(gc->permit, curitem->name)) { AAA */
 					GSList *list;
@@ -5375,7 +5375,7 @@ static int purple_ssi_parselist(OscarDat
 				}
 			} break;
 
-			case 0x0003: { /* Deny buddy */
+			case AIM_SSI_TYPE_DENY: { /* Deny buddy */
 				if (curitem->name) {
 					GSList *list;
 					for (list=account->deny; (list && oscar_util_name_compare(curitem->name, list->data)); list=list->next);
@@ -5387,7 +5387,7 @@ static int purple_ssi_parselist(OscarDat
 				}
 			} break;
 
-			case 0x0004: { /* Permit/deny setting */
+			case AIM_SSI_TYPE_PDINFO: { /* Permit/deny setting */
 				/*
 				 * We don't inherit the permit/deny setting from the server
 				 * for ICQ because, for ICQ, this setting controls who can
@@ -5405,7 +5405,7 @@ static int purple_ssi_parselist(OscarDat
 				}
 			} break;
 
-			case 0x0005: { /* Presence setting */
+			case AIM_SSI_TYPE_PRESENCEPREFS: { /* Presence setting */
 				/* We don't want to change Purple's setting because it applies to all accounts */
 			} break;
 		} /* End of switch on curitem->type */


More information about the Commits mailing list