adium-1.4 3519:2bd99c8bd47d: Facebook accounts are registered by...

commits at adium.im commits at adium.im
Fri Jun 24 19:21:02 UTC 2011


details:	http://hg.adium.im/adium-1.4/rev/2bd99c8bd47d
revision:	3519:2bd99c8bd47d
branch:		facebook-xmpp
author:		Evan Schoenberg
date:		Fri Jun 24 13:22:08 2011 -0500

Facebook accounts are registered by email address; returning nil here is wrong and makes the setup wizard, at a minimum, break
Subject: adium-1.4 3520:da2a143f9168: Update to our new app id, api key, and app secret. Also, prevent a crash by not returning nil within the webView willLoadResource method.

details:	http://hg.adium.im/adium-1.4/rev/da2a143f9168
revision:	3520:da2a143f9168
branch:		facebook-xmpp
author:		Evan Schoenberg
date:		Fri Jun 24 14:20:49 2011 -0500

Update to our new app id, api key, and app secret. Also, prevent a crash by not returning nil within the webView willLoadResource method.

diffs (102 lines):

diff -r 67194db10c73 -r da2a143f9168 Plugins/Purple Service/AIFacebookXMPPAccount.h
--- a/Plugins/Purple Service/AIFacebookXMPPAccount.h	Fri Jun 24 13:14:02 2011 -0500
+++ b/Plugins/Purple Service/AIFacebookXMPPAccount.h	Fri Jun 24 14:20:49 2011 -0500
@@ -10,6 +10,10 @@
 
 @class AIFacebookXMPPOAuthWebViewWindowController;
 
+#define APP_ID "164063256994618"
+#define API_KEY "add7b04ecedcd84645f3c32e7884682d"
+#define APP_SECRET "bb9d2d9771790e69a0e943771ddf33c8"
+
 @interface AIFacebookXMPPAccount : CBPurpleAccount {
 	AIFacebookXMPPOAuthWebViewWindowController *oAuthWC;
 	AIAccount *migratingAccount; // weak
diff -r 67194db10c73 -r da2a143f9168 Plugins/Purple Service/AIFacebookXMPPAccount.m
--- a/Plugins/Purple Service/AIFacebookXMPPAccount.m	Fri Jun 24 13:14:02 2011 -0500
+++ b/Plugins/Purple Service/AIFacebookXMPPAccount.m	Fri Jun 24 14:20:49 2011 -0500
@@ -87,8 +87,10 @@
 
 	purple_account_set_username(account, self.purpleAccountName);
 	purple_account_set_string(account, "connection_security", "");
-    purple_account_set_string(account, "fb_api_key", "819fd0b010d15eac1b36648f0126ece3");
-    purple_account_set_string(account, "fb_api_secret", [[self preferenceForKey:@"FBSessionSecret" group:GROUP_ACCOUNT_STATUS] UTF8String]);
+    purple_account_set_string(account, "fb_api_key", API_KEY);
+    purple_account_set_string(account, "fb_api_secret", APP_SECRET
+							  
+							  /*[[self preferenceForKey:@"FBSessionSecret" group:GROUP_ACCOUNT_STATUS] UTF8String]*/);
 }
 
 - (const char *)purpleAccountName
diff -r 67194db10c73 -r da2a143f9168 Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.m
--- a/Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.m	Fri Jun 24 13:14:02 2011 -0500
+++ b/Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.m	Fri Jun 24 14:20:49 2011 -0500
@@ -11,6 +11,7 @@
 #import "AIFacebookXMPPAccount.h"
 #import "JSONKit.h"
 
+
 @interface AIFacebookXMPPOAuthWebViewWindowController ()
 - (void)addCookiesFromResponse:(NSHTTPURLResponse *)response;
 - (void)addCookiesToRequest:(NSMutableURLRequest *)request;
@@ -35,9 +36,10 @@
 {
 	self.account = nil;
 	self.cookies = nil;
+	
+	[self.webView close];
 	self.webView = nil;
 	self.spinner = nil;
-
     
     [super dealloc];
 }
@@ -52,7 +54,7 @@
     [super showWindow:sender];
 
     [webView setMainFrameURL:@"https://graph.facebook.com/oauth/authorize?"
-     @"client_id=176717249009197&"
+     @"client_id=" APP_ID "&"
      @"redirect_uri=http%3A%2F%2Fwww.facebook.com%2Fconnect%2Flogin_success.html&"
 	 @"scope=xmpp_login,offline_access&"
      @"type=user_agent&"
@@ -73,6 +75,7 @@
 	return params;
 }
 
+
 - (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame
 {
 	[spinner startAnimation:self];
@@ -112,14 +115,14 @@
 		} else {
 			/* Got a bad token, or the user canceled */
 		}		
-		
+
 		[self closeWindow:nil];
-		return nil;
 	}
 	
 	return mutableRequest;
 }
 
+
 - (void)webView:(WebView *)sender resource:(id)identifier didReceiveResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)dataSource;
 {
     if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
diff -r 67194db10c73 -r da2a143f9168 Plugins/Purple Service/AIFacebookXMPPService.m
--- a/Plugins/Purple Service/AIFacebookXMPPService.m	Fri Jun 24 13:14:02 2011 -0500
+++ b/Plugins/Purple Service/AIFacebookXMPPService.m	Fri Jun 24 14:20:49 2011 -0500
@@ -73,9 +73,8 @@
     return @"Facebook (XMPP)";
 }
 
-- (NSString *)userNameLabel
-{
-	return nil;
+- (NSString *)userNameLabel{
+    return AILocalizedString(@"Email",nil);
 }
 
 - (NSCharacterSet *)allowedCharacters{




More information about the commits mailing list