Skip to content

Commit

Permalink
Merge pull request #1809 from barijaona/bugfixes
Browse files Browse the repository at this point in the history
Bugfixes and minor improvements
  • Loading branch information
barijaona authored Sep 8, 2024
2 parents a9997b0 + 180a95e commit 65eb73b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions Vienna/Sources/Info panel/InfoPanelController.m
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,15 @@ - (IBAction)validateURL:(id)sender {
NSURLComponents *urlComponents = [NSURLComponents componentsWithString:validatorURL];

NSString *validatedURL = self.urlField.stringValue.vna_trimmed;
// Override the text field's URL with the validated one.
self.urlField.stringValue = validatedURL;

NSCharacterSet *urlQuerySet = NSCharacterSet.URLQueryAllowedCharacterSet;
NSString *encodedURL = [validatedURL stringByAddingPercentEncodingWithAllowedCharacters:urlQuerySet];

// Override the text field's URL with the encoded one.
self.urlField.stringValue = encodedURL;

// prevent any confusion between feed's URL query string and validator's URL query string
encodedURL = [encodedURL stringByReplacingOccurrencesOfString:@"&" withString:@"%26"];
// Create the query using the encoded URL.
urlComponents.query = [NSString stringWithFormat:@"url=%@", encodedURL];
urlComponents.percentEncodedQuery = [NSString stringWithFormat:@"url=%@", encodedURL];

if (self.delegate) {
[self.delegate infoPanelControllerWillOpenURL:urlComponents.URL];
Expand Down
2 changes: 1 addition & 1 deletion Vienna/Sources/Main window/ArticleListView.m
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ -(void)scrollDownDetailsOrNextUnread
[(NSView *)articleText scrollPageDown:nil];
} else {
ArticleController * articleController = self.controller.articleController;
[articleController markReadByArray:articleController.markedArticleRange readFlag:YES];
[articleController markReadByArray:self.markedArticleRange readFlag:YES];
[articleController displayNextUnread];
}
}
Expand Down
4 changes: 2 additions & 2 deletions Vienna/Sources/Parsing/AtomFeed.m
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ - (BOOL)initAtomFeed:(NSXMLElement *)atomElement
}

// Parse item date
if (isArticleElementAtomType && ([articleItemTag isEqualToString:@"modified"] || [articleItemTag isEqualToString:@"updated"])) {
if (isArticleElementAtomType && ([articleItemTag isEqualToString:@"updated"] || [articleItemTag isEqualToString:@"modified"])) {
NSString *dateString = itemChildElement.stringValue;
NSDate *newDate = [self dateWithXMLString:dateString];
if (newFeedItem.modificationDate == nil || [newDate isGreaterThan:newFeedItem.modificationDate]) {
Expand All @@ -263,7 +263,7 @@ - (BOOL)initAtomFeed:(NSXMLElement *)atomElement
}

// Parse item date
if (isArticleElementAtomType && ([articleItemTag isEqualToString:@"created"] || [articleItemTag isEqualToString:@"published"])) {
if (isArticleElementAtomType && ([articleItemTag isEqualToString:@"published"] || [articleItemTag isEqualToString:@"created"] || [articleItemTag isEqualToString:@"issued"])) {
NSString *dateString = itemChildElement.stringValue;
NSDate *newDate = [self dateWithXMLString:dateString];
if (newFeedItem.publicationDate == nil || [newDate isLessThan:newFeedItem.publicationDate]) {
Expand Down

0 comments on commit 65eb73b

Please sign in to comment.