Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added ability to retrieve folder ID from engine:connection:didReceive…

…Bookmarks:ofUser: message

Stores the folder ID in the context of the IKURLConnection object. This is extracted when the results are being processed and is passed to the delegate method so that the calling code can obtain it.
  • Loading branch information...
commit e3a1f531428f5cbbbac5fe428f768de4e5f7df1e 1 parent 2e00f82
@mauricerkelly mauricerkelly authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.