From e97e444ea13ddda87e7a2d147c2d32e6ddfbd70e Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Thu, 22 Jun 2023 14:40:00 +0200 Subject: [PATCH] Update hookshot patch --- modules/services/matrix/hookshot-atom-links.patch | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/services/matrix/hookshot-atom-links.patch b/modules/services/matrix/hookshot-atom-links.patch index 531eb88b..61e834ae 100644 --- a/modules/services/matrix/hookshot-atom-links.patch +++ b/modules/services/matrix/hookshot-atom-links.patch @@ -6,10 +6,10 @@ index 0000000..63f29a9 @@ -0,0 +1 @@ +Feeds now tries to find an HTML-type link before falling back to the first link when parsing atom feeds diff --git a/src/feeds/parser.rs b/src/feeds/parser.rs -index c7f59ec..4f1ca71 100644 +index c7f59ec..473ef88 100644 --- a/src/feeds/parser.rs +++ b/src/feeds/parser.rs -@@ -81,7 +81,13 @@ fn parse_feed_to_js_result(feed: &Feed) -> JsRssChannel { +@@ -81,7 +81,12 @@ fn parse_feed_to_js_result(feed: &Feed) -> JsRssChannel { .iter() .map(|item| FeedItem { title: Some(item.title().value.clone()), @@ -17,8 +17,7 @@ index c7f59ec..4f1ca71 100644 + link: item + .links() + .iter() -+ .filter(|l| l.mime_type.as_ref().map_or(false, |t| t == "text/html")) -+ .next() ++ .find(|l| l.mime_type.as_ref().map_or(false, |t| t == "text/html")) + .or_else(|| item.links().first()) + .map(|f| f.href.clone()), id: Some(item.id.clone()),