fix: send relationship info for bots (#935)

* fix: send relationship info for bots

Signed-off-by: Zomatree <me@zomatree.live>

* fix: dont allow bots to block users

Signed-off-by: Zomatree <me@zomatree.live>

* fix: always allow users to view bot's profile

Signed-off-by: Zomatree <me@zomatree.live>

---------

Signed-off-by: Zomatree <me@zomatree.live>
This commit is contained in:
Zomatree
2026-08-24 19:07:09 +01:00
committed by GitHub
parent 365572ccd8
commit 405d9bdb8c
4 changed files with 19 additions and 21 deletions

View File

@@ -1045,9 +1045,7 @@ impl crate::User {
P: Into<Option<&'a crate::User>>,
{
let perspective = perspective.into();
let (relationship, can_see_profile) = if self.bot.is_some() {
(RelationshipStatus::None, true)
} else if let Some(perspective) = perspective {
let (relationship, can_see_profile) = if let Some(perspective) = perspective {
let mut query = DatabasePermissionQuery::new(db, perspective).user(&self);
if perspective.id == self.id {
@@ -1126,9 +1124,7 @@ impl crate::User {
P: Into<Option<&'a crate::User>>,
{
let perspective = perspective.into();
let (relationship, can_see_profile) = if self.bot.is_some() {
(RelationshipStatus::None, true)
} else if let Some(perspective) = perspective {
let (relationship, can_see_profile) = if let Some(perspective) = perspective {
if perspective.id == self.id {
(RelationshipStatus::User, true)
} else {