diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-18 19:22:03 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-18 19:22:03 +0200 |
commit | e8412f167ec2c8d72055181c2c5e1df09699a94e (patch) | |
tree | 17d8abb099580ac109f1ab16dab1f5c4c02998e8 /src/ui/sidebarwidget.c | |
parent | e39a4035a622e1e9e1573cc567cb43652fdef231 (diff) |
Fixed opening heading feed entries in a tab
The heading goto fragment wasn't being stripped appropriately from the URLs.
Diffstat (limited to 'src/ui/sidebarwidget.c')
-rw-r--r-- | src/ui/sidebarwidget.c | 11 |
1 files changed, 6 insertions, 5 deletions
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) | |||
822 | else if (equal_Command(cmd, "feeds.markallread") && d->mode == feeds_SidebarMode) { | 822 | else if (equal_Command(cmd, "feeds.markallread") && d->mode == feeds_SidebarMode) { |
823 | iConstForEach(PtrArray, i, listEntries_Feeds()) { | 823 | iConstForEach(PtrArray, i, listEntries_Feeds()) { |
824 | const iFeedEntry *entry = i.ptr; | 824 | const iFeedEntry *entry = i.ptr; |
825 | const iString *url = &entry->url; | 825 | const iString *url = url_FeedEntry(entry); |
826 | if (!containsUrl_Visited(visited_App(), url)) { | 826 | if (!containsUrl_Visited(visited_App(), url)) { |
827 | visitUrl_Visited(visited_App(), url, transient_VisitedUrlFlag); | 827 | visitUrl_Visited(visited_App(), url, transient_VisitedUrlFlag); |
828 | } | 828 | } |
@@ -834,16 +834,17 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
834 | const iSidebarItem *item = d->contextItem; | 834 | const iSidebarItem *item = d->contextItem; |
835 | if (item) { | 835 | if (item) { |
836 | if (isCommand_Widget(w, ev, "feed.entry.opentab")) { | 836 | if (isCommand_Widget(w, ev, "feed.entry.opentab")) { |
837 | postCommandf_App("open newtab:1 url:%s", cstr_String(&item->url)); | 837 | postCommandString_App(feedEntryOpenCommand_String(&item->url, 1)); |
838 | return iTrue; | 838 | return iTrue; |
839 | } | 839 | } |
840 | if (isCommand_Widget(w, ev, "feed.entry.toggleread")) { | 840 | if (isCommand_Widget(w, ev, "feed.entry.toggleread")) { |
841 | iVisited *vis = visited_App(); | 841 | iVisited *vis = visited_App(); |
842 | if (containsUrl_Visited(vis, &item->url)) { | 842 | const iString *url = urlFragmentStripped_String(&item->url); |
843 | removeUrl_Visited(vis, &item->url); | 843 | if (containsUrl_Visited(vis, url)) { |
844 | removeUrl_Visited(vis, url); | ||
844 | } | 845 | } |
845 | else { | 846 | else { |
846 | visitUrl_Visited(vis, &item->url, transient_VisitedUrlFlag); | 847 | visitUrl_Visited(vis, url, transient_VisitedUrlFlag); |
847 | } | 848 | } |
848 | postCommand_App("visited.changed"); | 849 | postCommand_App("visited.changed"); |
849 | return iTrue; | 850 | return iTrue; |