diff --git a/notification.h b/notification.h index ad28e73..152ca02 100644 --- a/notification.h +++ b/notification.h @@ -52,6 +52,7 @@ public: const ChronoUtilities::DateTime &creationTime() const; static constexpr inline NotificationType worstNotificationType(); static void sortByTime(NotificationList ¬ifications); + bool operator==(const Notification &other) const; private: NotificationType m_type; @@ -100,6 +101,15 @@ constexpr NotificationType Notification::worstNotificationType() return NotificationType::Critical; } +/*! + * \brief Returns whether the current instance equals \a other. + * \remarks The creation time is *not* taken into account. + */ +inline bool Notification::operator==(const Notification &other) const +{ + return m_type == other.m_type && m_msg == other.m_msg && m_context == other.m_context; +} + } #endif // NOTIFICATION_H