mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-26 04:41:31 +00:00
Make it so the signed in user can see if they're banned from a community (#4458)
* Make it so the signed in user can see if they're banned from a community * Use more appropriate field name --------- Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
This commit is contained in:
parent
5d551e6da5
commit
39345466da
2 changed files with 10 additions and 0 deletions
|
@ -17,6 +17,7 @@ use lemmy_db_schema::{
|
|||
community_aggregates,
|
||||
community_block,
|
||||
community_follower,
|
||||
community_person_ban,
|
||||
instance_block,
|
||||
local_user,
|
||||
},
|
||||
|
@ -58,6 +59,13 @@ fn queries<'a>() -> Queries<
|
|||
.and(community_block::person_id.eq(person_id_join)),
|
||||
),
|
||||
)
|
||||
.left_join(
|
||||
community_person_ban::table.on(
|
||||
community::id
|
||||
.eq(community_person_ban::community_id)
|
||||
.and(community_person_ban::person_id.eq(person_id_join)),
|
||||
),
|
||||
)
|
||||
};
|
||||
|
||||
let selection = (
|
||||
|
@ -65,6 +73,7 @@ fn queries<'a>() -> Queries<
|
|||
CommunityFollower::select_subscribed_type(),
|
||||
community_block::community_id.nullable().is_not_null(),
|
||||
community_aggregates::all_columns,
|
||||
community_person_ban::person_id.nullable().is_not_null(),
|
||||
);
|
||||
|
||||
let not_removed_or_deleted = community::removed
|
||||
|
|
|
@ -80,6 +80,7 @@ pub struct CommunityView {
|
|||
pub subscribed: SubscribedType,
|
||||
pub blocked: bool,
|
||||
pub counts: CommunityAggregates,
|
||||
pub banned_from_community: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
|
|
Loading…
Reference in a new issue