From a212f6b78053e3c3d225bb5921c8166f1fcdb4a6 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 19 Jan 2022 09:17:18 -0500 Subject: [PATCH] Fixing liking comment on blocked person. Fixes #2033 (#2042) --- crates/api/src/comment.rs | 8 -------- crates/api/src/post.rs | 3 --- crates/apub_lib/src/object_id.rs | 2 +- crates/routes/src/feeds.rs | 6 +----- 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/crates/api/src/comment.rs b/crates/api/src/comment.rs index ac066227..64bb7310 100644 --- a/crates/api/src/comment.rs +++ b/crates/api/src/comment.rs @@ -6,7 +6,6 @@ use lemmy_api_common::{ blocking, check_community_ban, check_downvotes_enabled, - check_person_block, comment::*, get_local_user_view_from_jwt, }; @@ -167,13 +166,6 @@ impl Perform for CreateCommentLike { ) .await?; - check_person_block( - local_user_view.person.id, - orig_comment.get_recipient_id(), - context.pool(), - ) - .await?; - // Add parent user to recipients let recipient_id = orig_comment.get_recipient_id(); if let Ok(local_recipient) = blocking(context.pool(), move |conn| { diff --git a/crates/api/src/post.rs b/crates/api/src/post.rs index 64c3a930..0b77bb95 100644 --- a/crates/api/src/post.rs +++ b/crates/api/src/post.rs @@ -5,7 +5,6 @@ use lemmy_api_common::{ check_community_ban, check_community_deleted_or_removed, check_downvotes_enabled, - check_person_block, get_local_user_view_from_jwt, is_mod_or_admin, mark_post_as_read, @@ -59,8 +58,6 @@ impl Perform for CreatePostLike { check_community_ban(local_user_view.person.id, post.community_id, context.pool()).await?; check_community_deleted_or_removed(post.community_id, context.pool()).await?; - check_person_block(local_user_view.person.id, post.creator_id, context.pool()).await?; - let like_form = PostLikeForm { post_id: data.post_id, person_id: local_user_view.person.id, diff --git a/crates/apub_lib/src/object_id.rs b/crates/apub_lib/src/object_id.rs index b2be92e5..41b18ef9 100644 --- a/crates/apub_lib/src/object_id.rs +++ b/crates/apub_lib/src/object_id.rs @@ -161,7 +161,7 @@ where #[allow(clippy::to_string_in_display)] fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { // Use to_string here because Url.display is not useful for us - write!(f, "{}", self.0.to_string()) + write!(f, "{}", self.0) } } diff --git a/crates/routes/src/feeds.rs b/crates/routes/src/feeds.rs index eaa1041f..7b668d7e 100644 --- a/crates/routes/src/feeds.rs +++ b/crates/routes/src/feeds.rs @@ -97,11 +97,7 @@ async fn get_feed_data( let mut channel_builder = ChannelBuilder::default(); channel_builder .namespaces(RSS_NAMESPACE.to_owned()) - .title(&format!( - "{} - {}", - site_view.site.name, - listing_type.to_string() - )) + .title(&format!("{} - {}", site_view.site.name, listing_type)) .link(context.settings().get_protocol_and_hostname()) .items(items); -- 2.44.1