From 79bc9c938bc8a55ae0a80eac6c230e49747d0b79 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 11 May 2024 22:50:39 +0200 Subject: [PATCH] fix: process emojireacts as likes for now --- Cargo.toml | 2 +- src/routes/activitypub/inbox.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 94874641..7b6fb614 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ sea-orm = { version = "0.12", features = ["macros", "sqlx-sqlite", "runtime-toki reqwest = { version = "0.12", features = ["json"] } axum = "0.7" tower-http = { version = "0.5", features = ["cors", "trace"] } -apb = { path = "apb", features = ["unstructured", "orm", "activitypub-fe", "activitypub-counters"] } +apb = { path = "apb", features = ["unstructured", "orm", "activitypub-fe", "activitypub-counters", "litepub"] } # nodeinfo = "0.0.2" # the version on crates.io doesn't re-export necessary types to build the struct!!! nodeinfo = { git = "https://codeberg.org/thefederationinfo/nodeinfo-rs", rev = "e865094804" } # migrations diff --git a/src/routes/activitypub/inbox.rs b/src/routes/activitypub/inbox.rs index df0bda33..4612eecc 100644 --- a/src/routes/activitypub/inbox.rs +++ b/src/routes/activitypub/inbox.rs @@ -73,8 +73,9 @@ pub async fn post( Err(StatusCode::UNPROCESSABLE_ENTITY.into()) // won't ingest useless stuff }, + // TODO emojireacts are NOT likes, but let's process them like ones for now maybe? + ActivityType::Like | ActivityType::EmojiReact => Ok(ctx.like(server, activity).await?), ActivityType::Create => Ok(ctx.create(server, activity).await?), - ActivityType::Like => Ok(ctx.like(server, activity).await?), ActivityType::Follow => Ok(ctx.follow(server, activity).await?), ActivityType::Announce => Ok(ctx.announce(server, activity).await?), ActivityType::Accept(_) => Ok(ctx.accept(server, activity).await?),