Package org.ngengine.nostr4j.nip01
Class Nip01UserMetadataListener
- java.lang.Object
-
- org.ngengine.nostr4j.nip01.Nip01UserMetadataListener
-
- All Implemented Interfaces:
NostrSubEventListener
,NostrSubListener
public class Nip01UserMetadataListener extends java.lang.Object implements NostrSubEventListener
-
-
Constructor Summary
Constructors Constructor Description Nip01UserMetadataListener()
Nip01UserMetadataListener(java.util.function.Consumer<Nip01UserMetadata> consumer)
Nip01UserMetadataListener(NostrPublicKey pubkey, java.util.function.Consumer<Nip01UserMetadata> consumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onSubEvent(NostrSubscription sub, SignedNostrEvent event, boolean stored)
Called when an event matching the subscription's filter is received.
-
-
-
Constructor Detail
-
Nip01UserMetadataListener
public Nip01UserMetadataListener(NostrPublicKey pubkey, java.util.function.Consumer<Nip01UserMetadata> consumer)
-
Nip01UserMetadataListener
public Nip01UserMetadataListener(java.util.function.Consumer<Nip01UserMetadata> consumer)
-
Nip01UserMetadataListener
public Nip01UserMetadataListener()
-
-
Method Detail
-
onSubEvent
public void onSubEvent(NostrSubscription sub, SignedNostrEvent event, boolean stored)
Description copied from interface:NostrSubEventListener
Called when an event matching the subscription's filter is received.This method is invoked for each event that matches the subscription's filter criteria and passes any duplicate detection checks implemented by the subscription's event tracker.
- Specified by:
onSubEvent
in interfaceNostrSubEventListener
- Parameters:
sub
- The subscription that received the eventevent
- The signed Nostr event that was receivedstored
- Whether this event came from the relay's stored history (true) or is a new event (false)
-
-