fix(ap): protocol compliance — actor verification, on_unlike, Move, bto/bcc
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 9m31s
test / unit (pull_request) Successful in 16m12s
test / integration (pull_request) Failing after 16m53s
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 9m31s
test / unit (pull_request) Successful in 16m12s
test / integration (pull_request) Failing after 16m53s
- Add verify() to Accept/Reject (actor must match Follow target) - Add verify() to Create/Update (actor must match attributedTo) - Add verify() to Delete (actor domain must match object domain) - Fix UpdateActivity passing wrapper id instead of object id to on_update - Implement on_unlike (was no-op stub) — publishes LikeRemoved event - BlockActivity now removes remote actor as follower, not just following - Add MoveActivity (account migration) to InboxActivities enum - Add bto/bcc fields to CreateActivity for blind DM support - http_signature_compat(true) restricted to debug mode only - Announce of non-local object logs debug instead of silent drop - postgres-federation: get_followers/get_following_page/count_following now consistently filter by status='accepted'
This commit is contained in:
@@ -117,7 +117,7 @@ impl FederationRepository for PostgresFederationRepository {
|
||||
COALESCE(r.inbox_url,'') AS inbox_url, r.shared_inbox_url, r.display_name, r.avatar_url, r.outbox_url
|
||||
FROM federation_followers f
|
||||
LEFT JOIN remote_actors r ON r.url=f.remote_actor_url
|
||||
WHERE f.local_user_id=$1"
|
||||
WHERE f.local_user_id=$1 AND f.status='accepted'"
|
||||
).bind(local_user_id).fetch_all(&self.pool).await.map_err(|e| anyhow!(e)).map(|rows| rows.into_iter().map(|r| Follower {
|
||||
actor: map_remote_actor(r.remote_actor_url, r.handle, r.inbox_url, r.shared_inbox_url, r.display_name, r.avatar_url, r.outbox_url),
|
||||
status: str_status(&r.status),
|
||||
@@ -276,7 +276,7 @@ impl FederationRepository for PostgresFederationRepository {
|
||||
COALESCE(r.inbox_url,'') AS inbox_url, r.shared_inbox_url, r.display_name, r.avatar_url, r.outbox_url
|
||||
FROM federation_following f
|
||||
LEFT JOIN remote_actors r ON r.url=f.remote_actor_url
|
||||
WHERE f.local_user_id=$1
|
||||
WHERE f.local_user_id=$1 AND f.status='accepted'
|
||||
ORDER BY f.created_at DESC LIMIT $2 OFFSET $3"
|
||||
).bind(local_user_id).bind(limit as i64).bind(offset as i64).fetch_all(&self.pool).await.map_err(|e| anyhow!(e)).map(|rows| rows.into_iter().map(|r|
|
||||
map_remote_actor(r.remote_actor_url, r.handle, r.inbox_url, r.shared_inbox_url, r.display_name, r.avatar_url, r.outbox_url)
|
||||
@@ -285,7 +285,7 @@ impl FederationRepository for PostgresFederationRepository {
|
||||
|
||||
async fn count_following(&self, local_user_id: uuid::Uuid) -> Result<usize> {
|
||||
let n: i64 =
|
||||
sqlx::query_scalar("SELECT COUNT(*) FROM federation_following WHERE local_user_id=$1")
|
||||
sqlx::query_scalar("SELECT COUNT(*) FROM federation_following WHERE local_user_id=$1 AND status='accepted'")
|
||||
.bind(local_user_id)
|
||||
.fetch_one(&self.pool)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user