fix: pluralization

This commit is contained in:
Alejandro Gómez
2026-02-27 17:14:00 +01:00
parent 6d3d225b47
commit 0b132624ff

View File

@@ -1105,9 +1105,10 @@ export class Nip29Adapter extends ChatProtocolAdapter {
let content = "";
if (event.kind === 9000) {
// put-user: admin adds someone
// If p-tag has a role (3rd element), show "is now <role>" instead of "joined"
// If p-tag has a role (3rd element), show "is/are now <role>" instead of "joined"
const role = pTags[0]?.[2];
content = role ? `is now ${role}` : "joined";
const verb = pTags.length > 1 ? "are" : "is";
content = role ? `${verb} now ${role}` : "joined";
} else if (event.kind === 9001) {
// remove-user: admin removes someone
content = "left";