adium-1.4 3566:84fb6840e22c: -hash has no guarantee to be unique...

commits at adium.im commits at adium.im
Sun Jul 10 23:31:09 UTC 2011


details:	http://hg.adium.im/adium-1.4/rev/84fb6840e22c
revision:	3566:84fb6840e22c
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Mon Jul 11 01:30:53 2011 +0200

-hash has no guarantee to be unique. Use [account UID] here instead.

diffs (32 lines):

diff -r d84669ba22b8 -r 84fb6840e22c Source/AIAutomaticStatus.m
--- a/Source/AIAutomaticStatus.m	Thu Jun 30 00:00:23 2011 +0200
+++ b/Source/AIAutomaticStatus.m	Mon Jul 11 01:30:53 2011 +0200
@@ -326,8 +326,8 @@
 	for (AIAccount *account in adium.accountController.accounts) {
 		AIStatus	*currentStatusState = account.statusState;
 		
-// Store the state of the account if there is no previous one saved
-		if (![previousStatus objectForKey:[NSNumber numberWithUnsignedInteger:[account hash]]]) {
+		// Store the state of the account if there is no previous one saved
+		if (![previousStatus objectForKey:[account UID]]) {
 			
 			// Don't modify or store the status of (originally!) non-available accounts
 			if (currentStatusState.statusType != AIAvailableStatusType) {
@@ -335,7 +335,7 @@
 			}
 			
 			[previousStatus setObject:currentStatusState
-							   forKey:[NSNumber numberWithUnsignedInteger:[account hash]]];
+							   forKey:[account UID]];
  		}
 		
 		AILogWithSignature(@"Setting %@ to status %@", account, targetStatusState);
@@ -365,7 +365,7 @@
 - (void)returnFromAutoAway
 {
 	for (AIAccount *account in adium.accountController.accounts) {
-		AIStatus *previousStatusState = [previousStatus objectForKey:[NSNumber numberWithUnsignedInt:[account hash]]];
+		AIStatus *previousStatusState = [previousStatus objectForKey:[account UID]];
 		
 		// Skip accounts without stored information.
 		if (!previousStatusState) {




More information about the commits mailing list