feat(ap): handle Undo(Like) inbound activity
This commit is contained in:
@@ -279,6 +279,20 @@ impl Activity for UndoActivity {
|
||||
tracing::info!(ap_id = %ap_id_str, "undo Add (watchlist remove)");
|
||||
}
|
||||
}
|
||||
"Like" => {
|
||||
if let Some(obj_url_str) = self.object.get("object").and_then(|o| o.as_str())
|
||||
&& let Ok(obj_url) = Url::parse(obj_url_str)
|
||||
&& obj_url.host_str().unwrap_or("") == data.domain
|
||||
{
|
||||
data.object_handler
|
||||
.on_unlike(&obj_url, self.actor.inner())
|
||||
.await
|
||||
.unwrap_or_else(|e| {
|
||||
tracing::warn!(error = %e, "failed to process unlike");
|
||||
});
|
||||
}
|
||||
tracing::info!(actor = %self.actor.inner(), "received Undo(Like)");
|
||||
}
|
||||
other => {
|
||||
tracing::debug!(kind = %other, "ignoring Undo of unknown activity type");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user