mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-01-27 12:26:06 +00:00
add local filter to community follower view
This commit is contained in:
parent
de50f37a39
commit
5c686f75c4
1 changed files with 2 additions and 1 deletions
|
@ -18,7 +18,7 @@ use lemmy_db_schema::{
|
||||||
type CommunityFollowerViewTuple = (Community, Person);
|
type CommunityFollowerViewTuple = (Community, Person);
|
||||||
|
|
||||||
impl CommunityFollowerView {
|
impl CommunityFollowerView {
|
||||||
/// return a list of community ids and inboxes that at least one user of the given instance has followed
|
/// return a list of local community ids and remote inboxes that at least one user of the given instance has followed
|
||||||
pub async fn get_instance_followed_community_inboxes(
|
pub async fn get_instance_followed_community_inboxes(
|
||||||
pool: &mut DbPool<'_>,
|
pool: &mut DbPool<'_>,
|
||||||
instance_id: InstanceId,
|
instance_id: InstanceId,
|
||||||
|
@ -30,6 +30,7 @@ impl CommunityFollowerView {
|
||||||
.inner_join(community::table)
|
.inner_join(community::table)
|
||||||
.inner_join(person::table)
|
.inner_join(person::table)
|
||||||
.filter(person::instance_id.eq(instance_id))
|
.filter(person::instance_id.eq(instance_id))
|
||||||
|
.filter(community::local) // this should be a no-op since community_followers table only has local-person+remote-community or remote-person+local-community
|
||||||
.filter(not(person::local))
|
.filter(not(person::local))
|
||||||
.filter(community_follower::published.gt(published_since.naive_utc()))
|
.filter(community_follower::published.gt(published_since.naive_utc()))
|
||||||
.select((
|
.select((
|
||||||
|
|
Loading…
Reference in a new issue