adium-1.4 3394:fa5325ebbbfd: Specify a host for network-reachabi...

commits at adium.im commits at adium.im
Wed Mar 9 06:08:07 UTC 2011


details:	http://hg.adium.im/adium-1.4/rev/fa5325ebbbfd
revision:	3394:fa5325ebbbfd
branch:		facebook-xmpp
author:		Evan Schoenberg
date:		Tue Mar 08 23:50:22 2011 -0600

Specify a host for network-reachability-code purposes
Subject: adium-1.4 3395:06dc28223b62: Use 'KEY_FORMATTED_UID' as per implicit coding style

details:	http://hg.adium.im/adium-1.4/rev/06dc28223b62
revision:	3395:06dc28223b62
branch:		facebook-xmpp
author:		Evan Schoenberg
date:		Wed Mar 09 00:04:23 2011 -0600

Use 'KEY_FORMATTED_UID' as per implicit coding style
Subject: adium-1.4 3396:85f1f82bb56f: An account needs to store its formatted UID for use later.  This was being done manually in some places, and since an API exists (in AIListObject) it should be overridden to just do the right thing.

details:	http://hg.adium.im/adium-1.4/rev/85f1f82bb56f
revision:	3396:85f1f82bb56f
branch:		facebook-xmpp
author:		Evan Schoenberg
date:		Wed Mar 09 00:05:25 2011 -0600

An account needs to store its formatted UID for use later.  This was being done manually in some places, and since an API exists (in AIListObject) it should be overridden to just do the right thing.
Subject: adium-1.4 3397:7a7d72afcd48: Properly store and restore the formatted UID that we're given by Facebook - that is, our name. Fixes #15038

details:	http://hg.adium.im/adium-1.4/rev/7a7d72afcd48
revision:	3397:7a7d72afcd48
branch:		facebook-xmpp
author:		Evan Schoenberg
date:		Wed Mar 09 00:06:34 2011 -0600

Properly store and restore the formatted UID that we're given by Facebook - that is, our name. Fixes #15038
Subject: adium-1.4 3398:3409e80ebced: Use the setFormattedUID:notify: setter rather than setting values manually; reduces fragility

details:	http://hg.adium.im/adium-1.4/rev/3409e80ebced
revision:	3398:3409e80ebced
branch:		facebook-xmpp
author:		Evan Schoenberg
date:		Wed Mar 09 00:07:00 2011 -0600

Use the setFormattedUID:notify: setter rather than setting values manually; reduces fragility
Subject: adium-1.4 3399:92acd521a497: Turn on building independent targets in parallel. Organize some FB files to be with their FB brethren.

details:	http://hg.adium.im/adium-1.4/rev/92acd521a497
revision:	3399:92acd521a497
branch:		facebook-xmpp
author:		Evan Schoenberg
date:		Wed Mar 09 00:07:47 2011 -0600

Turn on building independent targets in parallel. Organize some FB files to be with their FB brethren.

diffs (303 lines):

diff -r 5807e50e35dd -r 92acd521a497 Adium.xcodeproj/project.pbxproj
--- a/Adium.xcodeproj/project.pbxproj	Tue Mar 08 23:44:01 2011 -0600
+++ b/Adium.xcodeproj/project.pbxproj	Wed Mar 09 00:07:47 2011 -0600
@@ -1847,7 +1847,7 @@
 		0C27C8640C75A23A002AA363 /* NSStringScriptingAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSStringScriptingAdditions.m; path = Source/NSStringScriptingAdditions.m; sourceTree = "<group>"; };
 		0C79A2D60C5E633F005AE6FA /* AIMoveCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIMoveCommand.h; path = Source/AIMoveCommand.h; sourceTree = "<group>"; };
 		0C79A2D70C5E633F005AE6FA /* AIMoveCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIMoveCommand.m; path = Source/AIMoveCommand.m; sourceTree = "<group>"; };
-		0CAC6A130C0C657A0090AE95 /* Adium.sdef */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.sdef; name = Adium.sdef; path = Resources/Adium.sdef; sourceTree = "<group>"; };
+		0CAC6A130C0C657A0090AE95 /* Adium.sdef */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; name = Adium.sdef; path = Resources/Adium.sdef; sourceTree = "<group>"; };
 		0CD3C3AA0C43C8CC003E637C /* NSWindowScriptingAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSWindowScriptingAdditions.h; path = Source/NSWindowScriptingAdditions.h; sourceTree = "<group>"; };
 		0CD3C3AB0C43C8CC003E637C /* NSWindowScriptingAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSWindowScriptingAdditions.m; path = Source/NSWindowScriptingAdditions.m; sourceTree = "<group>"; };
 		0CD41C6E0C2776540082F83B /* AICreateCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AICreateCommand.h; path = Source/AICreateCommand.h; sourceTree = "<group>"; };
@@ -3137,10 +3137,10 @@
 		346C9C1E0E70E1F8002314EE /* hu */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = hu; path = Resources/hu.lproj/StatusPreferences.nib; sourceTree = "<group>"; };
 		346C9C1F0E70E1F8002314EE /* hu */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = hu; path = Resources/hu.lproj/StatusSortConfiguration.nib; sourceTree = "<group>"; };
 		346C9C200E70E1F8002314EE /* hu */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = hu; path = "Plugins/WebKit Message View/hu.lproj/WebKitPreferencesView.nib"; sourceTree = "<group>"; };
-		346CE8051294B53F00439BF2 /* fbapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fbapi.c; sourceTree = "<group>"; };
-		346CE8061294B53F00439BF2 /* fbapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fbapi.h; sourceTree = "<group>"; };
-		346CE8091294B59900439BF2 /* auth_fb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = auth_fb.c; sourceTree = "<group>"; };
-		346CE80D1294B5B000439BF2 /* auth_fb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = auth_fb.h; sourceTree = "<group>"; };
+		346CE8051294B53F00439BF2 /* fbapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = fbapi.c; path = "Plugins/Purple Service/libpurple_extensions/fbapi.c"; sourceTree = "<group>"; };
+		346CE8061294B53F00439BF2 /* fbapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fbapi.h; path = "Plugins/Purple Service/libpurple_extensions/fbapi.h"; sourceTree = "<group>"; };
+		346CE8091294B59900439BF2 /* auth_fb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = auth_fb.c; path = "Plugins/Purple Service/libpurple_extensions/auth_fb.c"; sourceTree = "<group>"; };
+		346CE80D1294B5B000439BF2 /* auth_fb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = auth_fb.h; path = "Plugins/Purple Service/libpurple_extensions/auth_fb.h"; sourceTree = "<group>"; };
 		346CFDC4087B7836009711C8 /* AdiumIdleManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AdiumIdleManager.h; path = Source/AdiumIdleManager.h; sourceTree = "<group>"; };
 		346CFDC5087B7836009711C8 /* AdiumIdleManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AdiumIdleManager.m; path = Source/AdiumIdleManager.m; sourceTree = "<group>"; };
 		346F5CB308A418FB0055C610 /* CurrentTunes.scpt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.scpt; name = CurrentTunes.scpt; path = Resources/CurrentTunes.scpt; sourceTree = "<group>"; };
@@ -5184,10 +5184,6 @@
 		11EE1B480CDCFAF40097F246 /* libpurple_extensions */ = {
 			isa = PBXGroup;
 			children = (
-				346CE8091294B59900439BF2 /* auth_fb.c */,
-				346CE80D1294B5B000439BF2 /* auth_fb.h */,
-				346CE8051294B53F00439BF2 /* fbapi.c */,
-				346CE8061294B53F00439BF2 /* fbapi.h */,
 				11EE1B490CDCFAF40097F246 /* oscar-adium.c */,
 				11EE1B4A0CDCFAF40097F246 /* oscar-adium.h */,
 				811033500CDE170B00EC6038 /* ssl-cdsa.m */,
@@ -8770,6 +8766,10 @@
 		EFA39B5C1294F9FB00B36EBB /* FB XMPP */ = {
 			isa = PBXGroup;
 			children = (
+				346CE8091294B59900439BF2 /* auth_fb.c */,
+				346CE80D1294B5B000439BF2 /* auth_fb.h */,
+				346CE8051294B53F00439BF2 /* fbapi.c */,
+				346CE8061294B53F00439BF2 /* fbapi.h */,
 				5A5B62A2130714120039B155 /* f_logo_small.png */,
 				5A5B62A0130712520039B155 /* f_logo.png */,
 				EFA39C031296658B00B36EBB /* AIFacebookXMPPAccount.h */,
@@ -9665,7 +9665,7 @@
 		29B97313FDCFA39411CA2CEA /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				BuildIndependentTargetsInParallel = NO;
+				BuildIndependentTargetsInParallel = YES;
 			};
 			buildConfigurationList = DADE8E3A085507450062B664 /* Build configuration list for PBXProject "Adium" */;
 			compatibilityVersion = "Xcode 3.1";
@@ -12987,7 +12987,9 @@
 			buildSettings = {
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.5;
 				RUN_CLANG_STATIC_ANALYZER = NO;
+				SDKROOT = macosx10.5;
 			};
 			name = Debug;
 		};
@@ -12998,6 +13000,7 @@
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				GCC_WARN_UNINITIALIZED_AUTOS = YES;
 				MACOSX_DEPLOYMENT_TARGET = 10.5;
+				SDKROOT = macosx10.5;
 			};
 			name = Release;
 		};
@@ -13008,6 +13011,8 @@
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
 				IBC_STRIP_NIBS = NO;
+				MACOSX_DEPLOYMENT_TARGET = 10.5;
+				SDKROOT = macosx10.5;
 			};
 			name = "Release-Debug";
 		};
diff -r 5807e50e35dd -r 92acd521a497 Frameworks/Adium Framework/Source/AIAbstractAccount.m
--- a/Frameworks/Adium Framework/Source/AIAbstractAccount.m	Tue Mar 08 23:44:01 2011 -0600
+++ b/Frameworks/Adium Framework/Source/AIAbstractAccount.m	Wed Mar 09 00:07:47 2011 -0600
@@ -310,9 +310,7 @@
 
 	//Set our formatted UID if necessary
 	if (![newProposedFormattedUID isEqualToString:self.formattedUID]) {
-		[self setPreference:newProposedFormattedUID
-					 forKey:@"FormattedUID"
-					  group:GROUP_ACCOUNT_STATUS];
+		[self setFormattedUID:newProposedFormattedUID notify:NotifyNow];
 	}
 	
 	if (didChangeUID) {
@@ -471,6 +469,22 @@
 }
 
 /*!
+ * @brief Set the way our UID is displayed to the user
+ *
+ * For accounts, this is stored as a preference in addition to being set as an in-memory property
+ */
+- (void)setFormattedUID:(NSString *)inFormattedUID notify:(NotifyTiming)notify
+{
+	[self setPreference:inFormattedUID
+				 forKey:KEY_FORMATTED_UID
+				  group:GROUP_ACCOUNT_STATUS];
+	
+	[self setValue:inFormattedUID
+	   forProperty:KEY_FORMATTED_UID
+			notify:notify];	
+}
+
+/*!
  * @brief Handle common account status updates
  *
  * We handle some common account status updates here for convenience.  Things that the majority of protocols will use
@@ -518,7 +532,7 @@
 		}
 
 	} else if ([key isEqualToString:@"FormattedUID"]) {
-		//Transfer formatted UID to status dictionary
+		//Transfer formatted UID from the stored preference to an in-memory property
 		[self setValue:[self preferenceForKey:@"FormattedUID" group:GROUP_ACCOUNT_STATUS]
 					   forProperty:@"FormattedUID"
 					   notify:NotifyNow];
diff -r 5807e50e35dd -r 92acd521a497 Frameworks/Adium Framework/Source/AIListObject.h
--- a/Frameworks/Adium Framework/Source/AIListObject.h	Tue Mar 08 23:44:01 2011 -0600
+++ b/Frameworks/Adium Framework/Source/AIListObject.h	Wed Mar 09 00:07:47 2011 -0600
@@ -22,6 +22,8 @@
 #define	KEY_ORDER_INDEX		@"Order Index"
 #define KEY_IS_BLOCKED		@"isBlocked"
 
+#define KEY_FORMATTED_UID	@"FormattedUID"
+
 typedef enum {
 	AIAvailableStatus = 'avaL',
 	AIAwayStatus = 'awaY',
diff -r 5807e50e35dd -r 92acd521a497 Frameworks/Adium Framework/Source/AIListObject.m
--- a/Frameworks/Adium Framework/Source/AIListObject.m	Tue Mar 08 23:44:01 2011 -0600
+++ b/Frameworks/Adium Framework/Source/AIListObject.m	Wed Mar 09 00:07:47 2011 -0600
@@ -32,7 +32,6 @@
 #define Key					@"Key"
 #define Group				@"Group"
 #define DisplayServiceID	@"DisplayServiceID"
-#define FormattedUID		@"FormattedUID"
 #define AlwaysVisible		@"AlwaysVisible"
 
 @interface AIListObject ()
@@ -328,7 +327,7 @@
 - (void)setFormattedUID:(NSString *)inFormattedUID notify:(NotifyTiming)notify
 {
 	[self setValue:inFormattedUID
-				   forProperty:FormattedUID
+				   forProperty:KEY_FORMATTED_UID
 				   notify:notify];
 }
 
@@ -370,7 +369,7 @@
  */
 - (NSString *)formattedUID
 {
-	NSString  *outName = [self valueForProperty:FormattedUID];
+	NSString  *outName = [self valueForProperty:KEY_FORMATTED_UID];
 	return outName ? outName : UID;	
 }
 
diff -r 5807e50e35dd -r 92acd521a497 Plugins/Purple Service/AIFacebookXMPPAccount.h
--- a/Plugins/Purple Service/AIFacebookXMPPAccount.h	Tue Mar 08 23:44:01 2011 -0600
+++ b/Plugins/Purple Service/AIFacebookXMPPAccount.h	Wed Mar 09 00:07:47 2011 -0600
@@ -10,9 +10,9 @@
 
 
 @interface AIFacebookXMPPAccount : CBPurpleAccount {
-    NSString *sessionSecret;
+
 }
 
- at property (retain) NSString *sessionSecret;
+- (void)setName:(NSString *)name UID:(NSString *)inUID;
 
 @end
diff -r 5807e50e35dd -r 92acd521a497 Plugins/Purple Service/AIFacebookXMPPAccount.m
--- a/Plugins/Purple Service/AIFacebookXMPPAccount.m	Tue Mar 08 23:44:01 2011 -0600
+++ b/Plugins/Purple Service/AIFacebookXMPPAccount.m	Wed Mar 09 00:07:47 2011 -0600
@@ -17,8 +17,6 @@
 
 @implementation AIFacebookXMPPAccount
 
- at synthesize sessionSecret;
-
 - (void)connect
 {
 	AILog(@"trying to connect");
@@ -41,6 +39,12 @@
 	return @"@chat.facebook.com";
 }
 
+/* Specify a host for network-reachability-code purposes */
+- (NSString *)host
+{
+	return @"chat.facebook.com";
+}
+
 - (void)configurePurpleAccount
 {
 	[super configurePurpleAccount];
@@ -129,4 +133,13 @@
 	return NO;
 }
 
+#pragma mark -
+
+- (void)setName:(NSString *)name UID:(NSString *)inUID
+{
+	[self filterAndSetUID:inUID];
+	
+	[self setFormattedUID:name notify:NotifyNever];
+}
+
 @end
diff -r 5807e50e35dd -r 92acd521a497 Plugins/Purple Service/AIFacebookXMPPAccountViewController.m
--- a/Plugins/Purple Service/AIFacebookXMPPAccountViewController.m	Tue Mar 08 23:44:01 2011 -0600
+++ b/Plugins/Purple Service/AIFacebookXMPPAccountViewController.m	Wed Mar 09 00:07:47 2011 -0600
@@ -96,21 +96,14 @@
     secret = [secret substringWithRange:NSMakeRange(1, [secret length] - 2)]; // strip off the quotes
     
 	/* Passwords are keyed by UID, so we need to make this change before storing the password */
-	[account filterAndSetUID:uuid];
-	[account setFormattedUID:name notify:NotifyNever];
+	[(AIFacebookXMPPAccount *)account setName:name UID:uuid];
 
     [[adium accountController] setPassword:sessionKey forAccount:account];
     [account setPasswordTemporarily:sessionKey];
 	
 	[account setPreference:secret
 					forKey:@"FBSessionSecret"
-					 group:GROUP_ACCOUNT_STATUS];	
-    
-	NSString *connectHost = @"FBXMPP";
-	
-	[account setPreference:connectHost
-					forKey:KEY_CONNECT_HOST
-					 group:GROUP_ACCOUNT_STATUS];
+					 group:GROUP_ACCOUNT_STATUS];	    
     NSLog(@"token %@", token);
 	NSLog(@"fUID %@", account.formattedUID);
 	NSLog(@"UID %@", account.UID);
diff -r 5807e50e35dd -r 92acd521a497 Plugins/Purple Service/CBPurpleAccount.m
--- a/Plugins/Purple Service/CBPurpleAccount.m	Tue Mar 08 23:44:01 2011 -0600
+++ b/Plugins/Purple Service/CBPurpleAccount.m	Wed Mar 09 00:07:47 2011 -0600
@@ -148,9 +148,7 @@
 	//If the name we were passed differs from the current formatted UID of the contact, it's itself a formatted UID
 	//This is important since we may get an alias ("Evan Schoenberg") from the server but also want the formatted name
 	if (![contactName isEqualToString:theContact.formattedUID] && ![contactName isEqualToString:theContact.UID]) {
-		[theContact setValue:contactName
-							 forProperty:@"FormattedUID"
-							 notify:NotifyLater];
+		[theContact setFormattedUID:contactName notify:NotifyLater];
 	}
 	
 	if (groupName && [groupName isEqualToString:@PURPLE_ORPHANS_GROUP_NAME]) {
@@ -185,9 +183,7 @@
 	NSString	*normalizedUID = [self.service normalizeUID:newUID removeIgnoredCharacters:YES];
 	
 	if ([normalizedUID isEqualToString:theContact.UID]) {
-		[theContact setValue:newUID
-							 forProperty:@"FormattedUID"
-							 notify:NotifyLater];		
+		[theContact setFormattedUID:newUID notify:NotifyLater];
 	} else {
 		[theContact setUID:newUID];		
 	}
diff -r 5807e50e35dd -r 92acd521a497 Plugins/Purple Service/ESPurpleAIMAccount.m
--- a/Plugins/Purple Service/ESPurpleAIMAccount.m	Tue Mar 08 23:44:01 2011 -0600
+++ b/Plugins/Purple Service/ESPurpleAIMAccount.m	Wed Mar 09 00:07:47 2011 -0600
@@ -168,7 +168,7 @@
 		(listContact = [self contactWithUID:contactName])) {
 		
 		if (!namesAreCaseSensitive) {
-			[listContact setValue:contactName forProperty:@"FormattedUID" notify:NotifyNow];
+			[listContact setFormattedUID:contactName notify:NotifyNow];
 		}
 		
 		/* Purple incorrectly flags group chat participants as being on a mobile device... we're just going
diff -r 5807e50e35dd -r 92acd521a497 Plugins/Purple Service/ESPurpleJabberAccount.m
--- a/Plugins/Purple Service/ESPurpleJabberAccount.m	Tue Mar 08 23:44:01 2011 -0600
+++ b/Plugins/Purple Service/ESPurpleJabberAccount.m	Wed Mar 09 00:07:47 2011 -0600
@@ -81,7 +81,8 @@
 
 			//Clear the preference and then set the UID so we don't perform this upgrade again
 			[self setPreference:nil forKey:@"Jabber:Host" group:GROUP_ACCOUNT_STATUS];
-			[self setPreference:correctUID forKey:@"FormattedUID" group:GROUP_ACCOUNT_STATUS];
+			
+			[self setFormattedUID:correctUID notify:NotifyNow];
 
 		} else {
 			//Append [self serverSuffix] (e.g. @jabber.org) to a Jabber account with no server




More information about the commits mailing list