No, that’s for target
property. Here’s an example of Add.target
from Streams:
"target": {
"id": "https://streams.lndo.site/conversation/ed4775f8-18ee-46a5-821e-b2ed2dc546e8",
"type": "Collection",
"attributedTo": "https://streams.lndo.site/channel/red"
},
In my code I have a handler for Add
activity, which then sends activity to one of the other handlers:
- Add{target: featured}
- Add{target: subscribers}
- Add{target: context}
Currently I use heuristics to determine which one to use. But with Add.target.type == <meaningful type name>
the code would be simpler and less fragile.
Do you have something like that in NodeBB? I wonder how others solve this “routing” problem
@julian This pattern can also be used in Accept and Undo activities:
{ "type": "Undo", "id": "https://social.example/activities/undo/1" "object": { "type": "Like", # or "Follow" "id": "https://social.example/activities/like/1" } }