Allow opening message menus for out-of-room events
These are more common than we thought, good examples are pinned or searched messages - which are not going to be in the room's history unless you happen to have them loaded. But currently our message menu infrastructure expects them to be, since its looked up by the room + event ID. To fix this is simple, we now move the job of finding the event to the caller which may use a model instead. I didn't fix all existing call-sites yet, mainly the message menu opening one since that was the most obvious bug. But this opens up the door for other assumptions about room history to be fixed too. I had to do a bit of C++ re-jiggering in order to expose useful functions to QML.
This commit is contained in:
@@ -115,9 +115,13 @@ public:
|
||||
/**
|
||||
* @brief Get the QModelIndex of the given event ID in the model, returning an invalid QModelIndex if no matches were found.
|
||||
*/
|
||||
Q_INVOKABLE QModelIndex indexforEventId(const QString &eventId) const;
|
||||
Q_INVOKABLE QModelIndex indexForEventId(const QString &eventId) const;
|
||||
|
||||
/**
|
||||
* @brief Finds the event of the given event ID in the model, returning nullptr if no matches were found.
|
||||
*/
|
||||
Q_INVOKABLE const Quotient::RoomEvent *findEvent(const QString &eventId) const;
|
||||
|
||||
static void setHiddenFilter(std::function<bool(const Quotient::RoomEvent *)> hiddenFilter);
|
||||
|
||||
static void setThreadsEnabled(bool enableThreads);
|
||||
|
||||
Reference in New Issue
Block a user