Browse files

Merge pull request #5 from mauricerkelly/experimental

Added ability to retrieve folder ID from engine:connection:didReceiveBookmarks:ofUser: message
  • Loading branch information...
2 parents 2e00f82 + e3a1f53 commit 556b0ad14e2894c142e7c9238a4a42fc21e0b050 @matthiasplappert committed Nov 8, 2011
Showing with 9 additions and 6 deletions.
  1. +1 −1 InstapaperKit/IKEngine.h
  2. +6 −3 InstapaperKit/IKEngine.m
  3. +2 −2 Test/TestAppDelegate.m
View
2 InstapaperKit/IKEngine.h
@@ -38,7 +38,7 @@
- (void)engine:(IKEngine *)engine connection:(IKURLConnection *)connection didReceiveAuthToken:(NSString *)token andTokenSecret:(NSString *)secret;
- (void)engine:(IKEngine *)engine connection:(IKURLConnection *)connection didVerifyCredentialsForUser:(IKUser *)user;
-- (void)engine:(IKEngine *)engine connection:(IKURLConnection *)connection didReceiveBookmarks:(NSArray *)bookmarks ofUser:(IKUser *)user;
+- (void)engine:(IKEngine *)engine connection:(IKURLConnection *)connection didReceiveBookmarks:(NSArray *)bookmarks ofUser:(IKUser *)user forFolder:(IKFolder *)folder;
- (void)engine:(IKEngine *)engine connection:(IKURLConnection *)connection didUpdateReadProgressOfBookmark:(IKBookmark *)bookmark;
- (void)engine:(IKEngine *)engine connection:(IKURLConnection *)connection didAddBookmark:(IKBookmark *)bookmark;
- (void)engine:(IKEngine *)engine connection:(IKURLConnection *)connection didDeleteBookmarkWithBookmarkID:(NSInteger)bookmarkID;
View
9 InstapaperKit/IKEngine.m
@@ -173,7 +173,7 @@ - (NSString *)bookmarksInFolder:(IKFolder *)folder limit:(NSUInteger)limit exist
bodyArguments:arguments
type:IKURLConnectionTypeBookmarksList
userInfo:userInfo
- context:nil];
+ context:folder];
}
- (NSString *)updateReadProgressOfBookmark:(IKBookmark *)bookmark toProgress:(CGFloat)progress userInfo:(id)userInfo
@@ -513,9 +513,12 @@ - (void)connectionDidFinishLoading:(IKURLConnection *)connection
}
}
+ // Retrieve folder ID from connection context
+ IKFolder *folder = (IKFolder *)[connection _context];
+
// Inform delegate
- if ([self.delegate respondsToSelector:@selector(engine:connection:didReceiveBookmarks:ofUser:)]) {
- [self.delegate engine:self connection:connection didReceiveBookmarks:bookmarks ofUser:user];
+ if ([self.delegate respondsToSelector:@selector(engine:connection:didReceiveBookmarks:ofUser:forFolder:)]) {
+ [self.delegate engine:self connection:connection didReceiveBookmarks:bookmarks ofUser:user forFolder:folder];
}
break;
}
View
4 Test/TestAppDelegate.m
@@ -113,9 +113,9 @@ - (void)engine:(IKEngine *)engine connection:(IKURLConnection *)connection didVe
NSLog(@"engine %@ connection %@ did verify credentials for user %@", engine, connection, user);
}
-- (void)engine:(IKEngine *)engine connection:(IKURLConnection *)connection didReceiveBookmarks:(NSArray *)bookmarks ofUser:(IKUser *)user
+- (void)engine:(IKEngine *)engine connection:(IKURLConnection *)connection didReceiveBookmarks:(NSArray *)bookmarks ofUser:(IKUser *)user forFolder:(IKFolder *)folder
{
- NSLog(@"engine %@ connection %@ did receive bookmarks %@ of user %@", engine, connection, bookmarks, user);
+ NSLog(@"engine %@ connection %@ did receive bookmarks %@ of user %@ for folder %@", engine, connection, bookmarks, user, folder);
}
- (void)engine:(IKEngine *)engine connection:(IKURLConnection *)connection didUpdateReadProgressOfBookmark:(IKBookmark *)bookmark

0 comments on commit 556b0ad

Please sign in to comment.