Add 'updated' timestamp to Update activity objects for Mastodon
Mastodon requires an updated field to process post edits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -42,6 +42,9 @@ def _build_activity_json(activity: APActivity, actor: ActorProfile, domain: str)
|
||||
obj.setdefault("published", activity.published.isoformat() if activity.published else None)
|
||||
obj.setdefault("to", ["https://www.w3.org/ns/activitystreams#Public"])
|
||||
obj.setdefault("cc", [f"{actor_url}/followers"])
|
||||
if activity.activity_type == "Update":
|
||||
from datetime import datetime, timezone
|
||||
obj["updated"] = datetime.now(timezone.utc).isoformat()
|
||||
|
||||
return {
|
||||
"@context": [
|
||||
|
||||
Reference in New Issue
Block a user