From: Dessalines Date: Wed, 10 Feb 2021 20:43:03 +0000 (-0500) Subject: Change RSS feeds to use lemmy URL for the rss link. Fixes #1378 X-Git-Url: http://these/git/%7B%60/feeds/front/static/%7BpictrsAvatarThumbnail%28this.state.siteRes.site.icon%29%7D?a=commitdiff_plain;h=37ad9e9a099afe8852eeb5b43491423ab1a95465;p=lemmy.git Change RSS feeds to use lemmy URL for the rss link. Fixes #1378 --- diff --git a/crates/routes/src/feeds.rs b/crates/routes/src/feeds.rs index 163452a8..837e1489 100644 --- a/crates/routes/src/feeds.rs +++ b/crates/routes/src/feeds.rs @@ -376,6 +376,7 @@ fn create_post_items(posts: Vec) -> Result, LemmyError> { Settings::get().get_protocol_and_hostname(), p.post.id ); + i.link(post_url.to_owned()); i.comments(post_url.to_owned()); let guid = GuidBuilder::default() .permalink(true) @@ -393,10 +394,6 @@ fn create_post_items(posts: Vec) -> Result, LemmyError> { // TODO: for category we should just put the name of the category, but then we would have // to read each community from the db - if let Some(url) = p.post.url { - i.link(url); - } - // TODO add images let mut description = format!("submitted by {} to {}
{} points | {} comments", p.creator.actor_id, @@ -407,6 +404,12 @@ fn create_post_items(posts: Vec) -> Result, LemmyError> { post_url, p.counts.comments); + // If its a url post, add it to the description + if let Some(url) = p.post.url { + let link_html = format!("
{url}", url = url); + description.push_str(&link_html); + } + if let Some(body) = p.post.body { let html = markdown_to_html(&body); description.push_str(&html);