Skip to content

Commit

Permalink
More read later bugs squished.
Browse files Browse the repository at this point in the history
  • Loading branch information
weiran committed Aug 18, 2013
1 parent 4752681 commit 5266526
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Hackers/WZActivityManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ - (void)authoriseWithUsername:(NSString *)username password:(NSString *)password
NNPocketClient *client = [NNPocketClient sharedClient];
[client authorizeWithSuccess:^(AFHTTPRequestOperation *operation, NSString *username, NNOAuth2Credential *credential) {
[self saveCredential:credential withUsername:username];
[self sendToPinboard];
[self sendToPocket];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
[WZNotify showMessage:NSLocalizedString(@"Couldn't login to Pocket", nil) inView:[WZDefaults appDelegate].window.rootViewController.view duration:2.0f];
}];
Expand All @@ -160,12 +160,12 @@ - (void)saveCredential:(NNOAuthCredential *)credential withUsername:(NSString *)
NNOAuth2Credential *newCredential;
if (username) {
newCredential = [[NNOAuth2Credential alloc] initWithAccessToken:credential.accessToken userInfo:@{ @"AccountName" : username }];
[newCredential saveToKeychainForService:self.service account:self.service];
[newCredential saveToKeychainForService:[[NSBundle mainBundle] bundleIdentifier] account:self.service];
} else {
[credential saveToKeychainForService:self.service account:self.service];
[credential saveToKeychainForService:[[NSBundle mainBundle] bundleIdentifier] account:self.service];
}
} else if ([self.service isEqualToString:kSettingsReadability]) {
[credential saveToKeychainForService:self.service account:self.service];
[credential saveToKeychainForService:[[NSBundle mainBundle] bundleIdentifier] account:self.service];
}
}

Expand Down Expand Up @@ -207,7 +207,7 @@ - (void)sendToPinboard {

- (void)sendToPocket {
NNPocketClient *client = [NNPocketClient sharedClient];
NNOAuthCredential *credential = [NNOAuthCredential credentialFromKeychainForService:self.service account:client.name];
NNOAuthCredential *credential = [NNOAuthCredential credentialFromKeychainForService:[[NSBundle mainBundle] bundleIdentifier] account:client.name];
[client addURL:self.url title:nil withCredential:credential success:^(AFHTTPRequestOperation *operation) {
[WZNotify showMessage:@"Sent to Pocket" inView:[WZDefaults appDelegate].window.rootViewController.view duration:2.0f];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
Expand All @@ -221,7 +221,7 @@ - (void)sendToPocket {

- (void)sendToReadability {
NNReadabilityClient *client = [NNReadabilityClient sharedClient];
NNOAuthCredential *credential = [NNOAuthCredential credentialFromKeychainForService:self.service account:client.name];
NNOAuthCredential *credential = [NNOAuthCredential credentialFromKeychainForService:[[NSBundle mainBundle] bundleIdentifier] account:client.name];
[client addURL:self.url withCredential:credential success:^(AFHTTPRequestOperation *operation) {
[WZNotify showMessage:@"Sent to Readability" inView:[WZDefaults appDelegate].window.rootViewController.view duration:2.0f];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
Expand Down

0 comments on commit 5266526

Please sign in to comment.