fix(ap): visibility-aware addressing — correct to/cc outbound, parse inbound to/cc
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 9m25s
test / unit (pull_request) Successful in 16m39s
test / integration (pull_request) Failing after 17m35s

This commit is contained in:
2026-05-14 19:34:43 +02:00
parent a5ea97bbaa
commit 8602614e7c
5 changed files with 45 additions and 3 deletions

View File

@@ -187,11 +187,12 @@ impl ActivityPubRepository for PgActivityPubRepository {
published: DateTime<Utc>,
sensitive: bool,
content_warning: Option<String>,
visibility: &str,
) -> Result<(), DomainError> {
let capped: String = content.chars().take(500).collect();
sqlx::query(
"INSERT INTO thoughts(id,user_id,content,ap_id,visibility,sensitive,local,content_warning,created_at)
VALUES($1,$2,$3,$4,'public',$5,false,$6,$7) ON CONFLICT(ap_id) DO NOTHING",
VALUES($1,$2,$3,$4,$8,$5,false,$6,$7) ON CONFLICT(ap_id) DO NOTHING",
)
.bind(uuid::Uuid::new_v4())
.bind(author_id.as_uuid())
@@ -200,6 +201,7 @@ impl ActivityPubRepository for PgActivityPubRepository {
.bind(sensitive)
.bind(content_warning)
.bind(published)
.bind(visibility)
.execute(&self.pool)
.await
.map_err(|e| DomainError::Internal(e.to_string()))
@@ -275,6 +277,7 @@ mod tests {
chrono::Utc::now(),
false,
None,
"public",
)
.await
.unwrap();