Make lastEvent() take a filter function

Make `lastEvent()` take a filter function so we can remove any dependence on `NeochatConfig` from `NeoChatRoom`.
This commit is contained in:
James Graham
2025-04-04 09:27:04 +00:00
parent 88eb2223c5
commit 913b4ea923
4 changed files with 49 additions and 20 deletions

View File

@@ -211,7 +211,7 @@ public:
* @warning This function can return an empty pointer if the room does not have
* any RoomMessageEvents loaded.
*/
[[nodiscard]] const Quotient::RoomEvent *lastEvent() const;
[[nodiscard]] const Quotient::RoomEvent *lastEvent(std::function<bool(const Quotient::RoomEvent *)> filter = {}) const;
/**
* @brief Convenient way to check if the last event looks like it has spoilers.