this post was submitted on 19 Feb 2025
0 points (NaN% liked)
ActivityPub
0 readers
1 users here now
Focused discussion related to ActivityPub integration in NodeBB
This is a forum category containing topical discussion. You can start new discussions by mentioning this category.
founded 2 months ago
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
@rikudou As far as I understand things, a 'private message' in ActivityPub is Create / ChatMessage, not Create / Note. I think NodeBB wouldn't be the only software to complain if 'cc' is missing from either part of Create / Note (although it's not expected in either part of Create / ChatMessage).
@freamon As others have said, ChatMessage is non-standard. The Create/Note is not particularly great for private messages, but whatever. Anyway, cc is not a required field of Note nor Create, so any software that would complain has a bug.
@rikudou Yeah, sorry, I didn't mean to derail this thread. The GitHub issue was intended to only really be about the 'cc' problem, because it looks like PieFed will have to start sending Create/Note to non-Lemmy platforms anyway, but it'd easier if 'cc' doesn't have to be artificially included to keep NodeBB happy.
@freamon @rikudou
https://github.com/NodeBB/NodeBB/issues/13202
In a bit of code that is too clever for my own good, I collapse
to
andcc
into a single deduplicated array with:const recipients = new Set([...object.to, ...object.cc]);
Which of course assumes that both properties are iterable. That has now been changed to an even clever-er (and less readable):
const recipients = new Set([...(object.to || []), ...(object.cc || [])]);
:sunglasses:
@julian Wouldn't
??
be better?@rikudou maybe? Nullish coalescing sounds really cool, but I've avoided it for years because of browser compatibility.
Node has had support forever (since v14, I've discovered), but I just don't know how to use it is all :smile: