feat: refactor user profile handling and integrate ApProfileField structure

This commit is contained in:
2026-05-13 22:59:38 +02:00
parent 815178e6a4
commit fdd61ae701
11 changed files with 94 additions and 51 deletions

View File

@@ -13,6 +13,7 @@ use url::Url;
use crate::data::FederationData;
use crate::error::Error;
use crate::repository::RemoteActor;
use crate::user::ApProfileField;
#[derive(Debug, Clone)]
pub struct DbActor {
@@ -31,7 +32,7 @@ pub struct DbActor {
pub banner_url: Option<Url>,
pub also_known_as: Option<String>,
pub profile_url: Option<Url>,
pub attachment: Vec<domain::models::ProfileField>,
pub attachment: Vec<ApProfileField>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]

View File

@@ -24,4 +24,4 @@ pub use repository::{
BlockedDomain, FederationRepository, Follower, FollowerStatus, FollowingStatus, RemoteActor,
};
pub use service::ActivityPubService;
pub use user::{ApUser, ApUserRepository};
pub use user::{ApProfileField, ApUser, ApUserRepository};

View File

@@ -1,6 +1,12 @@
use async_trait::async_trait;
use url::Url;
#[derive(Debug, Clone)]
pub struct ApProfileField {
pub name: String,
pub value: String,
}
#[derive(Debug, Clone)]
pub struct ApUser {
pub id: uuid::Uuid,
@@ -10,7 +16,7 @@ pub struct ApUser {
pub banner_url: Option<Url>,
pub also_known_as: Option<String>,
pub profile_url: Option<Url>,
pub attachment: Vec<domain::models::ProfileField>,
pub attachment: Vec<ApProfileField>,
}
#[async_trait]