Skip to content

Commit

Permalink
Merge 0448634 into 27a5d43
Browse files Browse the repository at this point in the history
  • Loading branch information
amritbrar authored Sep 8, 2021
2 parents 27a5d43 + 0448634 commit 596a4dd
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/itemviewformaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,14 @@ bool ItemViewFormAction::process_operation(Operation op,
do_redraw = true;
break;
case OP_ENQUEUE: {
if (item->enclosure_url().length() > 0 &&
utils::is_http_url(item->enclosure_url())) {
if (item->enclosure_url().empty()) {
v->get_statusline().show_error(_("Item has no enclosures."));
return false;
} else if (!utils::is_http_url(item->enclosure_url())) {
v->get_statusline().show_error(strprintf::fmt(
_("Item's enclosure has non-http link: '%s'"), item->enclosure_url()));
return false;
} else {
const EnqueueResult result = v->get_ctrl()->enqueue_url(item, feed);
rsscache->update_rssitem_unread_and_enqueued(item, feed->rssurl());
switch (result.status) {
Expand All @@ -228,10 +234,6 @@ bool ItemViewFormAction::process_operation(Operation op,
strprintf::fmt(_("Failed to open queue file: %s."), result.extra_info));
return false;
}
} else {
v->get_statusline().show_error(strprintf::fmt(
_("Invalid URL: '%s'"), item->enclosure_url()));
return false;
}
}
break;
Expand Down

0 comments on commit 596a4dd

Please sign in to comment.