From e8412f167ec2c8d72055181c2c5e1df09699a94e Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Mon, 18 Jan 2021 19:22:03 +0200 Subject: Fixed opening heading feed entries in a tab The heading goto fragment wasn't being stripped appropriately from the URLs. --- src/ui/sidebarwidget.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/ui/sidebarwidget.c') diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 56b8d097..32dcf61f 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c @@ -822,7 +822,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) else if (equal_Command(cmd, "feeds.markallread") && d->mode == feeds_SidebarMode) { iConstForEach(PtrArray, i, listEntries_Feeds()) { const iFeedEntry *entry = i.ptr; - const iString *url = &entry->url; + const iString *url = url_FeedEntry(entry); if (!containsUrl_Visited(visited_App(), url)) { visitUrl_Visited(visited_App(), url, transient_VisitedUrlFlag); } @@ -834,16 +834,17 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) const iSidebarItem *item = d->contextItem; if (item) { if (isCommand_Widget(w, ev, "feed.entry.opentab")) { - postCommandf_App("open newtab:1 url:%s", cstr_String(&item->url)); + postCommandString_App(feedEntryOpenCommand_String(&item->url, 1)); return iTrue; } if (isCommand_Widget(w, ev, "feed.entry.toggleread")) { iVisited *vis = visited_App(); - if (containsUrl_Visited(vis, &item->url)) { - removeUrl_Visited(vis, &item->url); + const iString *url = urlFragmentStripped_String(&item->url); + if (containsUrl_Visited(vis, url)) { + removeUrl_Visited(vis, url); } else { - visitUrl_Visited(vis, &item->url, transient_VisitedUrlFlag); + visitUrl_Visited(vis, url, transient_VisitedUrlFlag); } postCommand_App("visited.changed"); return iTrue; -- cgit v1.2.3