Send "CLOSED: auth-required" rather than partial results

This commit is contained in:
Mike Dilger 2025-02-21 09:05:29 +13:00
parent fb1bf64062
commit add3a9da9c
No known key found for this signature in database
GPG Key ID: 47581A78D4329BA4

View File

@ -180,6 +180,19 @@ impl WebSocketService {
redacted = redacted || was_redacted;
}
// New policy Feb 2025: Redactions trigger a "CLOSED: auth-required" because
// some clients will not AUTH otherwise.
if redacted {
// They need to AUTH first
let reply = NostrReply::Closed(
subid,
NostrReplyPrefix::AuthRequired,
"At least one matching event requires AUTH".to_owned(),
);
self.send(Message::text(reply.as_json())).await?;
return Ok(());
}
// sort
events.sort_by_key(|e| std::cmp::Reverse(e.created_at()));