feat(ap): broadcast Update(Actor) when user updates their profile

This commit is contained in:
2026-05-15 05:32:25 +02:00
parent d360e506db
commit ca1ebc4b68
7 changed files with 45 additions and 1 deletions

View File

@@ -1561,6 +1561,15 @@ impl domain::ports::OutboundFederationPort for ActivityPubService {
.await
.map_err(|e| domain::errors::DomainError::Internal(e.to_string()))
}
async fn broadcast_actor_update(
&self,
user_id: &domain::value_objects::UserId,
) -> Result<(), domain::errors::DomainError> {
self.broadcast_actor_update(user_id.as_uuid())
.await
.map_err(|e| domain::errors::DomainError::Internal(e.to_string()))
}
}
#[async_trait::async_trait]

View File

@@ -68,6 +68,9 @@ pub enum EventPayload {
UserRegistered {
user_id: String,
},
ProfileUpdated {
user_id: String,
},
FetchRemoteActorPosts {
actor_ap_url: String,
outbox_url: String,
@@ -98,6 +101,7 @@ impl EventPayload {
Self::UserBlocked { .. } => "users.blocked",
Self::UserUnblocked { .. } => "users.unblocked",
Self::UserRegistered { .. } => "users.registered",
Self::ProfileUpdated { .. } => "users.profile_updated",
Self::FetchRemoteActorPosts { .. } => "federation.fetch_outbox",
Self::FetchActorConnections { .. } => "federation.fetch_connections",
}
@@ -209,6 +213,9 @@ impl From<&DomainEvent> for EventPayload {
DomainEvent::UserRegistered { user_id } => Self::UserRegistered {
user_id: user_id.to_string(),
},
DomainEvent::ProfileUpdated { user_id } => Self::ProfileUpdated {
user_id: user_id.to_string(),
},
DomainEvent::FetchRemoteActorPosts {
actor_ap_url,
outbox_url,
@@ -345,6 +352,9 @@ impl TryFrom<EventPayload> for DomainEvent {
EventPayload::UserRegistered { user_id } => DomainEvent::UserRegistered {
user_id: UserId::from_uuid(parse_uuid(&user_id, "user_id")?),
},
EventPayload::ProfileUpdated { user_id } => DomainEvent::ProfileUpdated {
user_id: UserId::from_uuid(parse_uuid(&user_id, "user_id")?),
},
EventPayload::FetchRemoteActorPosts {
actor_ap_url,
outbox_url,