Update(Person) vocabulary and the live now-playing actor field (phase 4, step 2)
CI / validate-monitoring (push) Successful in 15s
CI / lint (push) Successful in 16s
CI / federation-interop (push) Successful in 1m47s
CI / test (push) Successful in 3m51s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 6s
CI / validate-monitoring (push) Successful in 15s
CI / lint (push) Successful in 16s
CI / federation-interop (push) Successful in 1m47s
CI / test (push) Successful in 3m51s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 6s
vocab.update() wraps a document as an Update, addressed explicitly (unlike undo(), which derives `to` from the undone activity - an actor document has no `to` of its own). New actors.py builds the actor document body, shared by GET /users/<u> (live) and the coming Update(Person) push (throttled) so both render the same shape without web.py depending on the worker-side module or vice versa. now_playing_field() reads core's get_now_playing() directly - never federation's own throttled push state - so a fetch always shows the truth, whatever the last proactive push said. GET /users/<u> now includes a "Now playing" PropertyValue attachment whenever something unexpired is playing, and omits it otherwise. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
This commit is contained in:
1 parent
cb8f9c997e
commit
c38e2e392a
6 files changed
+108
-13
No files matched your search
@@ -221,6 +221,19 @@ def undo(activity_id: str, actor_id: str, undone: dict) -> dict:
|
||||
}
|
||||
|
||||
|
||||
def update(activity_id: str, actor_id: str, obj: dict, *, to: list[str]) -> dict:
|
||||
"""Tells already-following servers something about the actor changed (their now
|
||||
playing field, here), so they don't have to re-fetch it to notice."""
|
||||
return {
|
||||
"@context": AS_CONTEXT,
|
||||
"id": activity_id,
|
||||
"type": "Update",
|
||||
"actor": actor_id,
|
||||
"object": obj,
|
||||
"to": list(to),
|
||||
}
|
||||
|
||||
|
||||
def hashtag(name: str) -> dict:
|
||||
"""A Hashtag tag, e.g. #Scrobbler. No href: we don't serve tag pages, and Mastodon
|
||||
still recognises and indexes the tag from `name` alone."""
|
||||
|
||||
Reference in new issue
Block a user