From d6faf6c815611450d1b61045b53525d7f25ac5c9 Mon Sep 17 00:00:00 2001 From: buttercat1791 Date: Tue, 7 May 2024 09:22:21 -0500 Subject: Remove 'RelayList' type alias --- include/nostr.hpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'include') diff --git a/include/nostr.hpp b/include/nostr.hpp index e76d1e5..e5b29c7 100644 --- a/include/nostr.hpp +++ b/include/nostr.hpp @@ -21,8 +21,6 @@ namespace nostr { -typedef std::vector RelayList; - class ISigner; class NostrService; @@ -135,12 +133,12 @@ public: std::shared_ptr appender, std::shared_ptr client, std::shared_ptr signer, - RelayList relays); + std::vector relays); ~NostrService(); - RelayList defaultRelays() const; + std::vector defaultRelays() const; - RelayList activeRelays() const; + std::vector activeRelays() const; std::unordered_map> subscriptions() const; @@ -149,13 +147,13 @@ public: * the constructor. * @return A list of the relay URLs to which connections were successfully opened. */ - RelayList openRelayConnections(); + std::vector openRelayConnections(); /** * @brief Opens connections to the specified Nostr relays. * @returns A list of the relay URLs to which connections were successfully opened. */ - RelayList openRelayConnections(RelayList relays); + std::vector openRelayConnections(std::vector relays); /** * @brief Closes all open relay connections. @@ -165,15 +163,15 @@ public: /** * @brief Closes any open connections to the specified Nostr relays. */ - void closeRelayConnections(RelayList relays); + void closeRelayConnections(std::vector relays); /** * @brief Publishes a Nostr event to all open relay connections. - * @returns A tuple of `RelayList` objects, of the form ``, indicating + * @returns A tuple of `std::vector` objects, of the form ``, indicating * to which relays the event was published successfully, and to which relays the event failed * to publish. */ - std::tuple publishEvent(std::shared_ptr event); + std::tuple, std::vector> publishEvent(std::shared_ptr event); /** * @brief Queries all open relay connections for events matching the given set of filters, and @@ -211,11 +209,11 @@ public: /** * @brief Closes the subscription with the given ID on all open relay connections. - * @returns A tuple of `RelayList` objects, of the form ``, indicating + * @returns A tuple of `std::vector` objects, of the form ``, indicating * to which relays the message was sent successfully, and which relays failed to receive the * message. */ - std::tuple closeSubscription(std::string subscriptionId); + std::tuple, std::vector> closeSubscription(std::string subscriptionId); /** * @brief Closes the subscription with the given ID on the given relay. @@ -235,7 +233,7 @@ public: * @brief Closes all open subscriptions on the given relays. * @returns A list of any subscription IDs that failed to close. */ - std::vector closeSubscriptions(RelayList relays); + std::vector closeSubscriptions(std::vector relays); private: ///< The maximum number of events the service will store for each subscription. @@ -249,9 +247,9 @@ private: ///< A mutex to protect the instance properties. std::mutex _propertyMutex; ///< The default set of Nostr relays to which the service will attempt to connect. - RelayList _defaultRelays; + std::vector _defaultRelays; ///< The set of Nostr relays to which the service is currently connected. - RelayList _activeRelays; + std::vector _activeRelays; ///< A map from subscription IDs to the relays on which each subscription is open. std::unordered_map> _subscriptions; @@ -259,13 +257,13 @@ private: * @brief Determines which of the given relays are currently connected. * @returns A list of the URIs of currently-open relay connections from the given list. */ - RelayList getConnectedRelays(RelayList relays); + std::vector getConnectedRelays(std::vector relays); /** * @brief Determines which of the given relays are not currently connected. * @returns A list of the URIs of currently-unconnected relays from the given list. */ - RelayList getUnconnectedRelays(RelayList relays); + std::vector getUnconnectedRelays(std::vector relays); /** * @brief Determines whether the given relay is currently connected. -- cgit