0
Sending a private message without cc causes a 500 error
(community.nodebb.org)
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.
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: