adium 4025:ac7aa9e12a56: If the auth window closes, let the face...

commits at adium.im commits at adium.im
Sun Jun 26 19:23:00 UTC 2011


details:	http://hg.adium.im/adium/rev/ac7aa9e12a56
revision:	4025:ac7aa9e12a56
branch:		(none)
author:		Evan Schoenberg
date:		Sun Jun 26 14:22:43 2011 -0500

If the auth window closes, let the facebook account know that auth failed. Also, provide a bit more information when migrating accounts: 'The new version of Adium has a much more reliable Facebook Chat service. Log in to use your Facebook account with Adium.'

diffs (224 lines):

diff -r 88d03096ee94 -r ac7aa9e12a56 Plugins/Purple Service/AIFacebookXMPPAccount.m
--- a/Plugins/Purple Service/AIFacebookXMPPAccount.m	Sun Jun 26 19:03:02 2011 +0200
+++ b/Plugins/Purple Service/AIFacebookXMPPAccount.m	Sun Jun 26 14:22:43 2011 -0500
@@ -7,6 +7,7 @@
 //
 
 #import "AIFacebookXMPPAccount.h"
+#import "AIFacebookXMPPService.h"
 #import <Adium/AIStatus.h>
 #import <Adium/AIStatusControllerProtocol.h>
 #import <Adium/AIListContact.h>
@@ -292,7 +293,8 @@
 		 */
 		self.oAuthWC.autoFillUsername = self.UID;
 		self.oAuthWC.autoFillPassword = [adium.accountController passwordForAccount:self];
-		
+		self.oAuthWC.isMigrating = ![self.service.serviceID isEqualToString:FACEBOOK_XMPP_SERVICE_ID];
+
 		self.migrationData = [NSDictionary dictionaryWithObjectsAndKeys:
 							  self.UID, @"originalUID",
 							  self.service.serviceID, @"originalServiceID",
diff -r 88d03096ee94 -r ac7aa9e12a56 Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.h
--- a/Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.h	Sun Jun 26 19:03:02 2011 +0200
+++ b/Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.h	Sun Jun 26 14:22:43 2011 -0500
@@ -20,6 +20,9 @@
 	
 	NSString *autoFillUsername;
 	NSString *autoFillPassword;
+    BOOL     isMigrating;
+    
+    BOOL notifiedAccount;
 }
 
 @property (nonatomic, retain) IBOutlet WebView *webView;
@@ -30,5 +33,6 @@
 
 @property (nonatomic, retain) NSString *autoFillUsername;
 @property (nonatomic, retain) NSString *autoFillPassword;
+ at property (nonatomic)         BOOL     isMigrating;
 
 @end
diff -r 88d03096ee94 -r ac7aa9e12a56 Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.m
--- a/Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.m	Sun Jun 26 19:03:02 2011 +0200
+++ b/Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.m	Sun Jun 26 14:22:43 2011 -0500
@@ -23,6 +23,7 @@
 @synthesize cookies;
 @synthesize webView, spinner;
 @synthesize autoFillPassword, autoFillUsername;
+ at synthesize isMigrating;
 
 - (id)init
 {
@@ -61,6 +62,17 @@
      @"display=popup"];
 	
 	[spinner startAnimation:self];
+    
+    [self.window setTitle:AILocalizedString(@"Facebook Account Setup", nil)];
+}
+
+- (void)windowWillClose:(id)sender
+{
+    [super windowWillClose:sender];
+
+    /* The user closed; notify the account of failure */
+    if (!notifiedAccount)
+        [self.account oAuthWebViewControllerDidFail:self];
 }
 
 - (NSDictionary*)parseURLParams:(NSString *)query {
@@ -91,6 +103,15 @@
 		if ([frame.dataSource.request.URL.host isEqual:@"www.facebook.com"] && [frame.dataSource.request.URL.path isEqual:@"/login.php"]) {
 			//Set email and password
 			DOMDocument *domDoc = [frame DOMDocument];
+            
+            if (self.isMigrating) {
+                NSString *text = domDoc.body.innerHTML;
+                text = [text stringByReplacingOccurrencesOfString:@"Log in to use your Facebook account"
+                                                       withString:@"The new version of Adium has a much more reliable Facebook Chat service. Log in to use your Facebook account"];
+                domDoc.body.innerHTML = text;
+            }
+
+            
 			[[domDoc getElementById:@"email"] setValue:self.autoFillUsername];
 			[[domDoc getElementById:@"pass"] setValue:self.autoFillPassword];
 			
@@ -124,6 +145,7 @@
 
 		}		
 
+        notifiedAccount = YES;
 		[self closeWindow:nil];
 	}
 	
diff -r 88d03096ee94 -r ac7aa9e12a56 Plugins/Purple Service/AIFacebookXMPPOauthWebViewWindow.xib
--- a/Plugins/Purple Service/AIFacebookXMPPOauthWebViewWindow.xib	Sun Jun 26 19:03:02 2011 +0200
+++ b/Plugins/Purple Service/AIFacebookXMPPOauthWebViewWindow.xib	Sun Jun 26 14:22:43 2011 -0500
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
 	<data>
-		<int key="IBDocument.SystemTarget">1050</int>
-		<string key="IBDocument.SystemVersion">10J567</string>
-		<string key="IBDocument.InterfaceBuilderVersion">1305</string>
+		<int key="IBDocument.SystemTarget">1060</int>
+		<string key="IBDocument.SystemVersion">10J4138</string>
+		<string key="IBDocument.InterfaceBuilderVersion">1864</string>
 		<string key="IBDocument.AppKitVersion">1038.35</string>
-		<string key="IBDocument.HIToolboxVersion">462.00</string>
+		<string key="IBDocument.HIToolboxVersion">461.00</string>
 		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
 			<bool key="EncodedWithXMLCoder">YES</bool>
 			<object class="NSArray" key="dict.sortedKeys">
@@ -15,8 +15,8 @@
 			</object>
 			<object class="NSMutableArray" key="dict.values">
 				<bool key="EncodedWithXMLCoder">YES</bool>
-				<string>1305</string>
-				<string>30</string>
+				<string>1864</string>
+				<string>816</string>
 			</object>
 		</object>
 		<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
@@ -33,11 +33,8 @@
 			<string>com.apple.WebKitIBPlugin</string>
 		</object>
 		<object class="NSMutableDictionary" key="IBDocument.Metadata">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="NSArray" key="dict.sortedKeys" id="0">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-			</object>
-			<reference key="dict.values" ref="0"/>
+			<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+			<integer value="1" key="NS.object.0"/>
 		</object>
 		<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
 			<bool key="EncodedWithXMLCoder">YES</bool>
@@ -126,7 +123,7 @@
 							<double key="NSMaxValue">100</double>
 						</object>
 					</object>
-					<string key="NSFrame">{{7, 11}, {640, 380}}</string>
+					<string key="NSFrameSize">{640, 380}</string>
 					<reference key="NSSuperview"/>
 					<reference key="NSWindow"/>
 					<reference key="NSNextKeyView" ref="950810926"/>
@@ -179,13 +176,23 @@
 					</object>
 					<int key="connectionID">9</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">delegate</string>
+						<reference key="source" ref="1005"/>
+						<reference key="destination" ref="1001"/>
+					</object>
+					<int key="connectionID">10</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
 					<bool key="EncodedWithXMLCoder">YES</bool>
 					<object class="IBObjectRecord">
 						<int key="objectID">0</int>
-						<reference key="object" ref="0"/>
+						<object class="NSArray" key="object" id="0">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+						</object>
 						<reference key="children" ref="1000"/>
 						<nil key="parent"/>
 					</object>
@@ -242,12 +249,12 @@
 				<bool key="EncodedWithXMLCoder">YES</bool>
 				<object class="NSArray" key="dict.sortedKeys">
 					<bool key="EncodedWithXMLCoder">YES</bool>
-					<string>1.IBEditorWindowLastContentRect</string>
+					<string>-1.IBPluginDependency</string>
+					<string>-2.IBPluginDependency</string>
+					<string>-3.IBPluginDependency</string>
 					<string>1.IBPluginDependency</string>
 					<string>1.IBWindowTemplateEditedContentRect</string>
 					<string>1.NSWindowTemplate.visibleAtLaunch</string>
-					<string>1.WindowOrigin</string>
-					<string>1.editorWindowContentRectSynchronizationRect</string>
 					<string>2.IBPluginDependency</string>
 					<string>3.IBPluginDependency</string>
 					<string>3.IBViewBoundsToFrameTransform</string>
@@ -255,12 +262,12 @@
 				</object>
 				<object class="NSMutableArray" key="dict.values">
 					<bool key="EncodedWithXMLCoder">YES</bool>
-					<string>{{305, 397}, {640, 380}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>{{305, 397}, {640, 380}}</string>
 					<integer value="1"/>
-					<string>{196, 240}</string>
-					<string>{{202, 428}, {480, 270}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.WebKitIBPlugin</string>
 					<object class="NSAffineTransform">
@@ -281,7 +288,7 @@
 				<reference key="dict.values" ref="0"/>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">9</int>
+			<int key="maxID">10</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -367,10 +374,6 @@
 		</object>
 		<int key="IBDocument.localizationMode">0</int>
 		<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
-		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
-			<integer value="1050" key="NS.object.0"/>
-		</object>
 		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
 			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
 			<integer value="3000" key="NS.object.0"/>




More information about the commits mailing list