1. Jonathan Lyons
  2. adium-av

Commits

Evan Schoenberg  committed 147fda1

The session secret is used with each connect cycle, and it should be stable. Store it when we get it during OAuth, then retrieve it when connecting. Refs #15038 (fixing the most broken part; the account now works across restarting ADium)
(transplanted from 5807e50e35ddb940ffe7743700acadcce84a2418)

  • Participants
  • Parent commits fc1608a
  • Branches default

Comments (0)

Files changed (2)

File Plugins/Purple Service/AIFacebookXMPPAccount.m

View file
 - (void)configurePurpleAccount
 {
 	[super configurePurpleAccount];
-	
+
 	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 sessionSecret] UTF8String]);
+    purple_account_set_string(account, "fb_api_secret", [[self preferenceForKey:@"FBSessionSecret" group:GROUP_ACCOUNT_STATUS] UTF8String]);
 }
 
 - (const char *)purpleAccountName

File Plugins/Purple Service/AIFacebookXMPPAccountViewController.m

View file
     NSString *secret = [[[NSString alloc] initWithData:secretData encoding:NSUTF8StringEncoding] autorelease];
     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];
+
     [[adium accountController] setPassword:sessionKey forAccount:account];
     [account setPasswordTemporarily:sessionKey];
-    [(AIFacebookXMPPAccount *)account setSessionSecret:secret];
+	
+	[account setPreference:secret
+					forKey:@"FBSessionSecret"
+					 group:GROUP_ACCOUNT_STATUS];	
     
-	[account filterAndSetUID:uuid];
-	[account setFormattedUID:name notify:NotifyNever];
 	NSString *connectHost = @"FBXMPP";
 	
 	[account setPreference:connectHost