Plugins/Purple Service/AIFacebookXMPPAccountViewController.m
branchadium-1.5.11
changeset 6014 fcb71cb71a3d
parent 5941 307f53385811
parent 6013 f8d0dc659e3f
child 6016 325e2ab3406f
--- a/Plugins/Purple Service/AIFacebookXMPPAccountViewController.m	Sun Sep 04 21:31:36 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-//
-//  AIFacebookXMPPAccountViewController.m
-//  Adium
-//
-//  Created by Colin Barrett on 11/18/10.
-//  Copyright 2010 __MyCompanyName__. All rights reserved.
-//
-
-#import "AIFacebookXMPPAccount.h"
-#import "AIFacebookXMPPAccountViewController.h"
-#import <Adium/AIAccount.h>
-#import <Adium/AIAccountControllerProtocol.h>
-#import <AIUtilities/AIStringAdditions.h>
-
-#import "PurpleFacebookAccount.h"
-
-@interface AIFacebookXMPPAccountViewController ()
-- (void)authProgressDidChange:(NSNotification *)notification;
-@end
-
-@implementation AIFacebookXMPPAccountViewController
-
-@synthesize spinner, textField_OAuthStatus, button_OAuthStart, button_help;
-
-- (void)dealloc
-{
-	[[NSNotificationCenter defaultCenter] removeObserver:self];
-    [super dealloc];
-}
-
-- (NSView *)optionsView
-{
-    return nil;
-}
-
-- (NSView *)privacyView
-{
-    return nil;
-}
-
-- (NSView *)setupView
-{	
-	return view_setup;
-}
-
-- (NSString *)nibName
-{
-    return @"AIFacebookXMPPAccountView";
-}
-
-/*!
- * @brief Configure controls
- */
-- (void)configureForAccount:(AIAccount *)inAccount
-{
-	[super configureForAccount:inAccount];
-	
-	if ([[AIFacebookXMPPAccount class] uidIsValidForFacebook:account.UID] &&
-		[adium.accountController passwordForAccount:account].length) {
-		[textField_OAuthStatus setStringValue:AILocalizedString(@"Adium is authorized for Facebook Chat.", nil)];
-		[button_OAuthStart setEnabled:NO];
-	} else {
-		[textField_OAuthStatus setStringValue:@""];
-		[button_OAuthStart setEnabled:YES]; 
-	}
-	
-	[[NSNotificationCenter defaultCenter] addObserver:self
-											 selector:@selector(authProgressDidChange:)
-												 name: AIFacebookXMPPAuthProgressNotification
-											   object:inAccount];
-}
-
-- (void) authProgressDidChange:(NSNotification *)notification
-{
-	AIFacebookXMPPAuthProgressStep step = [[notification.userInfo objectForKey:KEY_FB_XMPP_AUTH_STEP] intValue];
-	
-	switch (step) {
-		case AIFacebookXMPPAuthProgressPromptingUser:
-			[textField_OAuthStatus setStringValue:[AILocalizedString(@"Requesting authorization", nil) stringByAppendingEllipsis]];
-			break;
-			
-		case AIFacebookXMPPAuthProgressContactingServer:
-			[textField_OAuthStatus setStringValue:[AILocalizedString(@"Contacting authorization server", nil) stringByAppendingEllipsis]];
-			break;
-
-		case AIFacebookXMPPAuthProgressPromotingForChat:
-			[textField_OAuthStatus setStringValue:[AILocalizedString(@"Promoting authorization for chat", nil) stringByAppendingEllipsis]];
-			break;
-
-		case AIFacebookXMPPAuthProgressSuccess:
-			[textField_OAuthStatus setStringValue:AILocalizedString(@"Adium is authorized for Facebook Chat.", nil)];
-			break;
-			
-		case AIFacebookXMPPAuthProgressFailure:
-			[textField_OAuthStatus setStringValue:AILocalizedString(@"Could not complete authorization.", nil)];
-			[button_OAuthStart setEnabled:YES];
-			break;
-	}
-}
-
-/*!
- * @brief A preference was changed
- *
- * Don't save here; merely update controls as necessary.
- */
-- (IBAction)changedPreference:(id)sender
-{
-	if (sender == button_OAuthStart) {
-		[(AIFacebookXMPPAccount *)account requestFacebookAuthorization];
-		[button_OAuthStart setEnabled:NO];
-
-	} else 
-		[super changedPreference:sender];
-}
-
-/* xxx it'd be better to link to an entry in our docs */
-- (IBAction)showHelp:(id)sender
-{
-	[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://adium.im/help/pgs/Accounts-FacebookChat.html"]];
-}
-
-@end