Limit number of relays to publish zap receipts to
This commit is contained in:
@@ -169,6 +169,9 @@ class Setting < RailsSettings::Base
|
||||
field :nostr_public_key, type: :string,
|
||||
default: ENV["NOSTR_PUBLIC_KEY"].presence
|
||||
|
||||
field :nostr_zaps_relay_limit, type: :integer,
|
||||
default: 12
|
||||
|
||||
#
|
||||
# OpenCollective
|
||||
#
|
||||
|
||||
@@ -7,8 +7,7 @@ module NostrManager
|
||||
def call
|
||||
tags = parse_tags(@zap.request_event.tags)
|
||||
|
||||
# TODO limit to 15 or so relays
|
||||
tags[:relays].each do |relay_url|
|
||||
tags[:relays].take(Setting.nostr_zaps_relay_limit).each do |relay_url|
|
||||
if @delayed
|
||||
NostrPublishEventJob.perform_later(event: @zap.receipt, relay: relay_url)
|
||||
else
|
||||
|
||||
@@ -19,5 +19,15 @@
|
||||
title: "Public key",
|
||||
description: "The corresponding public key of the accounts service"
|
||||
) %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</section>
|
||||
<section>
|
||||
<h3>Zaps</h3>
|
||||
<ul role="list">
|
||||
<%= render FormElements::FieldsetResettableSettingComponent.new(
|
||||
key: :nostr_zaps_relay_limit,
|
||||
title: "Relay limit",
|
||||
description: "The maximum number of relays to publish zap receipts to"
|
||||
) %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user