Fixing liking comment on blocked person. Fixes #2033 (#2042)

webfinger-order
Dessalines 2022-01-19 09:17:18 -05:00 committed by GitHub
parent eea3308906
commit a212f6b780
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 17 deletions

View File

@ -6,7 +6,6 @@ use lemmy_api_common::{
blocking, blocking,
check_community_ban, check_community_ban,
check_downvotes_enabled, check_downvotes_enabled,
check_person_block,
comment::*, comment::*,
get_local_user_view_from_jwt, get_local_user_view_from_jwt,
}; };
@ -167,13 +166,6 @@ impl Perform for CreateCommentLike {
) )
.await?; .await?;
check_person_block(
local_user_view.person.id,
orig_comment.get_recipient_id(),
context.pool(),
)
.await?;
// Add parent user to recipients // Add parent user to recipients
let recipient_id = orig_comment.get_recipient_id(); let recipient_id = orig_comment.get_recipient_id();
if let Ok(local_recipient) = blocking(context.pool(), move |conn| { if let Ok(local_recipient) = blocking(context.pool(), move |conn| {

View File

@ -5,7 +5,6 @@ use lemmy_api_common::{
check_community_ban, check_community_ban,
check_community_deleted_or_removed, check_community_deleted_or_removed,
check_downvotes_enabled, check_downvotes_enabled,
check_person_block,
get_local_user_view_from_jwt, get_local_user_view_from_jwt,
is_mod_or_admin, is_mod_or_admin,
mark_post_as_read, 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_ban(local_user_view.person.id, post.community_id, context.pool()).await?;
check_community_deleted_or_removed(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 { let like_form = PostLikeForm {
post_id: data.post_id, post_id: data.post_id,
person_id: local_user_view.person.id, person_id: local_user_view.person.id,

View File

@ -161,7 +161,7 @@ where
#[allow(clippy::to_string_in_display)] #[allow(clippy::to_string_in_display)]
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
// Use to_string here because Url.display is not useful for us // Use to_string here because Url.display is not useful for us
write!(f, "{}", self.0.to_string()) write!(f, "{}", self.0)
} }
} }

View File

@ -97,11 +97,7 @@ async fn get_feed_data(
let mut channel_builder = ChannelBuilder::default(); let mut channel_builder = ChannelBuilder::default();
channel_builder channel_builder
.namespaces(RSS_NAMESPACE.to_owned()) .namespaces(RSS_NAMESPACE.to_owned())
.title(&format!( .title(&format!("{} - {}", site_view.site.name, listing_type))
"{} - {}",
site_view.site.name,
listing_type.to_string()
))
.link(context.settings().get_protocol_and_hostname()) .link(context.settings().get_protocol_and_hostname())
.items(items); .items(items);