akkounts/app/services/nostr_manager/discover_user_profile.rb
Râu Cao 79ef9fa6d5
All checks were successful
continuous-integration/drone/push Build is passing
WIP Refactor stuff
2024-10-18 18:16:09 +02:00

22 lines
456 B
Ruby

module NostrManager
class DiscoverUserProfile < NostrManagerService
def initialize(pubkey:, relays: nil)
@pubkey = pubkey
@relays = relays.present? ? relays : Setting.nostr_discovery_relays
end
def call
filter = Nostr::Filter.new(
authors: [@pubkey],
kinds: [0],
limit: 1,
)
NostrManager::FetchLatestEvent.call(
relays: @relays,
filter: filter
)
end
end
end