diff options
Diffstat (limited to 'include/nostr.hpp')
-rw-r--r-- | include/nostr.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/nostr.hpp b/include/nostr.hpp index 3e60d7b..2b04862 100644 --- a/include/nostr.hpp +++ b/include/nostr.hpp @@ -170,7 +170,7 @@ public: * events returned from the relay for the given filters. The service will not store the * events, and they will not be accessible via `getNewEvents`. */ - std::string queryRelays(Filters filters, std::function<void(std::string, Event)> responseHandler); + std::string queryRelays(Filters filters, std::function<void(const std::string&, Event)> responseHandler); /** * @brief Get any new events received since the last call to this method, across all @@ -285,6 +285,11 @@ private: bool hasSubscription(std::string relay, std::string subscriptionId); /** + * @brief Parses messages received from the relay and invokes the appropriate message handler. + */ + void onMessage(std::string message, std::function<void(const std::string&, Event)> eventHandler); + + /** * @brief A default message handler for events returned from relay queries. * @param subscriptionId The ID of the subscription for which the event was received. * @param event The event received from the relay. |