diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/nostr.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/nostr.hpp b/include/nostr.hpp index 62eceff..5c99bf4 100644 --- a/include/nostr.hpp +++ b/include/nostr.hpp @@ -58,6 +58,14 @@ struct Event */ static Event fromJson(nlohmann::json j); + /** + * @brief Compares two events for equality. + * @remark Two events are considered equal if they have the same ID, since the ID is uniquely + * generated from the event data. If the `id` field is empty for either event, the comparison + * function will throw an exception. + */ + bool operator==(const Event& other) const; + private: /** * @brief Validates the event. |