|
@@ -119,8 +119,21 @@ NSString *replaceTextForTitle = @"...";
|
119
|
119
|
}
|
120
|
120
|
|
121
|
121
|
-(void)readSubreddits:(id)parent {
|
122
|
|
- // TODO read subreddits (as multireddit?)
|
123
|
|
- // TODO if implemented, enable checkbox in prefs
|
|
122
|
+ NSMutableString *subs = [NSMutableString stringWithString:@"r/"];
|
|
123
|
+ for (NSUInteger i = 0; i < [subreddits count]; i++) {
|
|
124
|
+ [subs appendString:[subreddits objectAtIndex:i]];
|
|
125
|
+ if (i < ([subreddits count] - 1)) {
|
|
126
|
+ [subs appendString:@"+"];
|
|
127
|
+ }
|
|
128
|
+ }
|
|
129
|
+ NSString *url = [NSString stringWithFormat:@"%@/hot.json?limit=%ld", subs, (long)length];
|
|
130
|
+ NSHTTPURLResponse *response;
|
|
131
|
+ NSData *data = [self queryAPI:url withResponse:&response];
|
|
132
|
+ if ((data == nil) || ([response statusCode] != 200)) {
|
|
133
|
+ [parent performSelectorOnMainThread:@selector(reloadListHasSubredditsCallback:) withObject:nil waitUntilDone:false];
|
|
134
|
+ } else {
|
|
135
|
+ [parent performSelectorOnMainThread:@selector(reloadListHasSubredditsCallback:) withObject:[self convertJSONToItemArray:data] waitUntilDone:false];
|
|
136
|
+ }
|
124
|
137
|
}
|
125
|
138
|
|
126
|
139
|
-(void)isAuthenticatedNewModhash:(id)parent {
|