mirror of
https://github.com/mikedilger/chorus.git
synced 2026-04-03 06:41:16 +00:00
Send "CLOSED: auth-required" rather than partial results
This commit is contained in:
parent
fb1bf64062
commit
add3a9da9c
13
src/nostr.rs
13
src/nostr.rs
@ -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()));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user