Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes and minor improvements #1809

Merged
merged 3 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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