--- a/Plugins/Purple Service/AIPurpleGTalkAccount.m Wed Apr 01 15:29:11 2015 +0200
+++ b/Plugins/Purple Service/AIPurpleGTalkAccount.m Wed Apr 01 16:04:15 2015 +0200
@@ -23,6 +23,7 @@
#import <Adium/AIAccountControllerProtocol.h>
+#import <Adium/AIInterfaceControllerProtocol.h> #import "NSData+Base64.h"
@@ -116,6 +117,12 @@
+- (void)promptUpgrade:(NSNumber *)number userInfo:(id)info suppression:(NSNumber *)suppressed { + if ([number integerValue] == 1) { + [adium.accountController editAccount:self onWindow:nil notifyingTarget:self]; @@ -128,7 +135,20 @@
if (refresh_token && refresh_token.length) {
[self useRefreshToken:refresh_token];
- [self requestAccessToken];
+ if ([self preferenceForKey:KEY_GTALK_CODE group:GROUP_ACCOUNT_STATUS]) { + [self requestAccessToken]; + [adium.interfaceController displayQuestion:AILocalizedString(@"Upgrade Google Talk account", nil) + withDescription:[NSString stringWithFormat:AILocalizedString(@"Adium uses a new, more secure way to sign in to Google Talk. To use this, you must authorize your account.", nil)] + defaultButton:AILocalizedString(@"OK", nil) + alternateButton:AILocalizedString(@"Later", nil) + selector:@selector(promptUpgrade:userInfo:suppression:) @@ -238,7 +258,7 @@
- [self setLastDisconnectionError:@"Obtaining your JID failed"];
+ [self setLastDisconnectionError:AILocalizedString(@"Obtaining your JID failed", nil)]; @@ -259,12 +279,16 @@
[conn release]; conn = nil;
[response release]; response = nil;
- [self setGTalkMechEnabled:YES];
+ [self setGTalkMechEnabled:YES]; + [self serverReportedInvalidPassword]; -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
- [self setLastDisconnectionError:[NSString stringWithFormat:@"OAuth authentication failed: %@", error.description]];
+ [self setLastDisconnectionError:[NSString stringWithFormat:AILocalizedString(@"OAuth authentication failed: %@", nil), error.description]]; [self setValue:[NSNumber numberWithBool:YES] forProperty:@"isDisconnecting" notify:NotifyNow];