1
0
Fork 0
forked from alemi/upub

fix: address_to helper

This commit is contained in:
əlemi 2024-05-28 02:05:12 +02:00
parent 0c203528df
commit 0a19915773
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -216,15 +216,13 @@ impl Context {
for target in targets {
if target.ends_with("/followers") {
let target_id = target.replace("/followers", "");
model::relation::Entity::find()
.filter(model::relation::Column::Following.eq(target_id))
.select_only()
.select_column(model::relation::Column::Follower)
.into_tuple::<String>()
.all(self.db())
.await?
.into_iter()
.for_each(|x| out.push(x));
let mut followers = model::relation::Entity::followers(&target_id, self.db()).await?;
if followers.is_empty() { // stuff with zero addressing will never be seen again!!! TODO
followers.push(target_id);
}
for follower in followers {
out.push(follower);
}
} else {
out.push(target);
}