The first generation of appcasts has ended. adium-1.0 AdiumX_1.0.6
authorPeter Hosey
Tue, 14 Aug 2007 02:59:20 +0000
branchadium-1.0
changeset 1855430d173574771
parent 18552 13ba6e3d134c
child 18628 8cb8166e8a22
The first generation of appcasts has ended.

The second generation of appcasts has begun.

The difference is that generation 1 appcasts cannot have the `minimumSystemVersion` element, whereas generation 2 appcasts should (and must have the `generation=2` key in their URL query).
Source/AIAdium.m
     1.1 --- a/Source/AIAdium.m	Tue Aug 14 01:56:44 2007 +0000
     1.2 +++ b/Source/AIAdium.m	Tue Aug 14 02:59:20 2007 +0000
     1.3 @@ -1153,6 +1153,10 @@
     1.4  #define UPDATE_TYPE_DICT ([[NSUserDefaults standardUserDefaults] boolForKey:@"AIAlwaysUpdateToBetas"] ? BETA_UPDATE_DICT : RELEASE_UPDATE_DICT)
     1.5  #endif
     1.6  
     1.7 +//The first generation ended with 1.0.5 and 1.1. Our Sparkle Plus up to that point had a bug that left it unable to properly handle the sparkle:minimumSystemVersion element.
     1.8 +//The second generation began with 1.0.6 and 1.1.1, with a Sparkle Plus that can handle that element.
     1.9 +#define UPDATE_GENERATION_DICT [NSDictionary dictionaryWithObjectsAndKeys:@"generation", @"key", @"Appcast generation number", @"visibleKey", @"2", @"value", @"2", @"visibleValue", nil]
    1.10 +
    1.11  /* This method gives the delegate the opportunity to customize the information that will
    1.12   * be included with update checks.  Add or remove items from the dictionary as desired.
    1.13   * Each entry in profileInfo is an NSDictionary with the following keys:
    1.14 @@ -1166,58 +1170,55 @@
    1.15  	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    1.16  	
    1.17  	//If we're not sending profile information, return just the type of update we're looking for
    1.18 -	if (![[defaults objectForKey:SUSendProfileInfoKey] boolValue])
    1.19 -		return [NSMutableArray arrayWithObject:UPDATE_TYPE_DICT]; 
    1.20 -	
    1.21 -	int now = [[NSCalendarDate date] dayOfCommonEra];
    1.22 -
    1.23 -	if (abs([defaults integerForKey:@"AILastSubmittedProfileDate2"] - now) >= 7) {
    1.24 -		[defaults setInteger:now forKey:@"AILastSubmittedProfileDate2"];
    1.25 -		
    1.26 -		NSString *value = ([defaults boolForKey:@"AIHasSentSparkleProfileInfo"]) ? @"no" : @"yes";
    1.27 -
    1.28 -		NSDictionary *entry = [NSDictionary dictionaryWithObjectsAndKeys:
    1.29 -			@"FirstSubmission", @"key", 
    1.30 -			@"First Time Submitting Profile Information", @"visibleKey",
    1.31 -			value, @"value",
    1.32 -			value, @"visibleValue",
    1.33 -			nil];
    1.34 -		
    1.35 -		[profileInfo addObject:entry];
    1.36 -		
    1.37 -		[profileInfo addObject:UPDATE_TYPE_DICT];
    1.38 -		
    1.39 -		[defaults setBool:YES forKey:@"AIHasSentSparkleProfileInfo"];
    1.40 -		
    1.41 -		/*************** Include info about what IM services are used ************/
    1.42 -		NSMutableString *accountInfo = [NSMutableString string];
    1.43 -		NSCountedSet *condensedAccountInfo = [NSCountedSet set];
    1.44 -		NSEnumerator *accountEnu = [[[self accountController] accounts] objectEnumerator];
    1.45 -		AIAccount *account = nil;
    1.46 -		while ((account = [accountEnu nextObject])) {
    1.47 -			NSString *serviceID = [account serviceID];
    1.48 -			[accountInfo appendFormat:@"%@, ", serviceID];
    1.49 -			if([serviceID isEqualToString:@"Yahoo! Japan"]) serviceID = @"YJ";
    1.50 -			[condensedAccountInfo addObject:[NSString stringWithFormat:@"%@", [serviceID substringToIndex:2]]]; 
    1.51 -		}
    1.52 -		
    1.53 -		NSMutableString *accountInfoString = [NSMutableString string];
    1.54 -		NSEnumerator *infoEnu = [[[condensedAccountInfo allObjects] sortedArrayUsingSelector:@selector(compare:)] objectEnumerator];
    1.55 -		while ((value = [infoEnu nextObject]))
    1.56 -			[accountInfoString appendFormat:@"%@%d", value, [condensedAccountInfo countForObject:value]];
    1.57 -		
    1.58 -		entry = [NSDictionary dictionaryWithObjectsAndKeys:
    1.59 -									@"IMServices", @"key", 
    1.60 -									@"IM Services Used", @"visibleKey",
    1.61 -									accountInfoString, @"value",
    1.62 -									accountInfo, @"visibleValue",
    1.63 -									nil];
    1.64 -		[profileInfo addObject:entry];
    1.65 -		return profileInfo;
    1.66 -
    1.67 -	} else {
    1.68 -		return [NSMutableArray arrayWithObject:UPDATE_TYPE_DICT];
    1.69 -	}
    1.70 + 	if ([[defaults objectForKey:SUSendProfileInfoKey] boolValue]) {
    1.71 + 		int now = [[NSCalendarDate date] dayOfCommonEra];
    1.72 + 
    1.73 + 		if (abs([defaults integerForKey:@"AILastSubmittedProfileDate2"] - now) >= 7) {
    1.74 + 			[defaults setInteger:now forKey:@"AILastSubmittedProfileDate2"];
    1.75 + 			
    1.76 + 			NSString *value = ([defaults boolForKey:@"AIHasSentSparkleProfileInfo"]) ? @"no" : @"yes";
    1.77 + 			
    1.78 + 			NSDictionary *entry = [NSDictionary dictionaryWithObjectsAndKeys:
    1.79 + 				@"FirstSubmission", @"key", 
    1.80 + 				@"First Time Submitting Profile Information", @"visibleKey",
    1.81 + 				value, @"value",
    1.82 + 				value, @"visibleValue",
    1.83 + 				nil];
    1.84 + 			
    1.85 + 			[profileInfo addObject:entry];
    1.86 + 			
    1.87 + 			[defaults setBool:YES forKey:@"AIHasSentSparkleProfileInfo"];
    1.88 + 			
    1.89 + 			/*************** Include info about what IM services are used ************/
    1.90 + 			NSMutableString *accountInfo = [NSMutableString string];
    1.91 + 			NSCountedSet *condensedAccountInfo = [NSCountedSet set];
    1.92 + 			NSEnumerator *accountEnu = [[[self accountController] accounts] objectEnumerator];
    1.93 + 			AIAccount *account = nil;
    1.94 + 			while ((account = [accountEnu nextObject])) {
    1.95 + 				NSString *serviceID = [account serviceID];
    1.96 + 				[accountInfo appendFormat:@"%@, ", serviceID];
    1.97 + 				if([serviceID isEqualToString:@"Yahoo! Japan"]) serviceID = @"YJ";
    1.98 + 				[condensedAccountInfo addObject:[NSString stringWithFormat:@"%@", [serviceID substringToIndex:2]]]; 
    1.99 + 			}
   1.100 + 			
   1.101 + 			NSMutableString *accountInfoString = [NSMutableString string];
   1.102 + 			NSEnumerator *infoEnu = [[[condensedAccountInfo allObjects] sortedArrayUsingSelector:@selector(compare:)] objectEnumerator];
   1.103 + 			while ((value = [infoEnu nextObject]))
   1.104 + 				[accountInfoString appendFormat:@"%@%d", value, [condensedAccountInfo countForObject:value]];
   1.105 + 			
   1.106 + 			entry = [NSDictionary dictionaryWithObjectsAndKeys:
   1.107 + 				@"IMServices", @"key", 
   1.108 + 				@"IM Services Used", @"visibleKey",
   1.109 + 				accountInfoString, @"value",
   1.110 + 				accountInfo, @"visibleValue",
   1.111 + 				nil];
   1.112 + 			[profileInfo addObject:entry];
   1.113 + 		}
   1.114 + 	}
   1.115 + 
   1.116 + 	[profileInfo addObject:UPDATE_GENERATION_DICT];
   1.117 + 	[profileInfo addObject:UPDATE_TYPE_DICT];
   1.118 + 	return profileInfo;
   1.119  }
   1.120  
   1.121  - (NSComparisonResult) compareVersion:(NSString *)newVersion toVersion:(NSString *)currentVersion