Skip to content

Commit

Permalink
Stop retrieving article when user is logged out during the checking p…
Browse files Browse the repository at this point in the history
…rocess
  • Loading branch information
clyang committed Nov 3, 2017
1 parent 0e39829 commit 6c038e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.1.0-beta</string>
<string>3.1.0-rc1</string>
<key>CFBundleSignature</key>
<string>abgK</string>
<key>CFBundleURLTypes</key>
Expand All @@ -49,7 +49,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>917</string>
<string>918</string>
<key>Fabric</key>
<dict>
<key>Kits</key>
Expand Down
3 changes: 2 additions & 1 deletion src/WLConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ - (void)monitorArticleAtBackground {
NSTextCheckingResult *result;
NSString *combinedString=@"";
for( WLArticle* article in resultArray) {
if(article.needTrack > 0 && article.astatus < 2) { // need track AND article is not delteed
if(article.needTrack > 0 && article.astatus < 2 && _connected) { // need track AND article is not delteed
STHTTPRequest *r = [STHTTPRequest requestWithURLString:[NSString stringWithFormat:@"https://www.ptt.cc/bbs/%@.html", article.url]];
[r addCookieWithName:@"over18" value:@"1"];
[r setHeaderWithName:@"User-Agent" value:@"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Safari/604.1.38"];
Expand Down Expand Up @@ -354,6 +354,7 @@ - (void)monitorArticleAtBackground {
} // end of resultArray > 0
[NSThread sleepForTimeInterval:300];
} // end for inifinte loop
return;
});
}
}
Expand Down

0 comments on commit 6c038e9

Please sign in to comment.