mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-23 21:01:23 +00:00
2016afc9db
* A first pass at user / community blocking. #426 * Adding unit tests for person and community block. * Moving migration * Fixing creator_blocked for comment queries, added tests. * Don't let a person block themselves * Fix post creator_blocked * Adding creator_blocked to PersonMentionView * Moving blocked and follows to MyUserInfo * Rename to local_user_view * Add moderates to MyUserInfo * Adding BlockCommunityResponse * Fixing name, and check_person_block * Fixing tests. * Using type in Blockable trait. * Changing recipient to target, adding unfollow to block action.
25 lines
611 B
Rust
25 lines
611 B
Rust
use crate::{
|
|
schema::community_block,
|
|
source::community::Community,
|
|
CommunityBlockId,
|
|
CommunityId,
|
|
PersonId,
|
|
};
|
|
use serde::Serialize;
|
|
|
|
#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)]
|
|
#[table_name = "community_block"]
|
|
#[belongs_to(Community)]
|
|
pub struct CommunityBlock {
|
|
pub id: CommunityBlockId,
|
|
pub person_id: PersonId,
|
|
pub community_id: CommunityId,
|
|
pub published: chrono::NaiveDateTime,
|
|
}
|
|
|
|
#[derive(Insertable, AsChangeset)]
|
|
#[table_name = "community_block"]
|
|
pub struct CommunityBlockForm {
|
|
pub person_id: PersonId,
|
|
pub community_id: CommunityId,
|
|
}
|