Fix replying and editing from chatbox

Restore the functionality to edit or reply to the last message in the `chatbar`.

This is achieved be moving the functions `getLastLocalUserMessageEventId` and `getLatestMessageFromRow` to `NeoChatRoom` as `editLastMessage` and `replyLastMessage` as `chatbar` no longer has access to `messageEventModel`.

The functions are also simplified as they only need to find the `eventId` and always from row 0 as this was the only use of the functions.

BUG: 469733
This commit is contained in:
James Graham
2023-05-27 16:36:09 +00:00
parent 528d46be9f
commit ee53793a6d
5 changed files with 84 additions and 114 deletions

View File

@@ -3,6 +3,7 @@
#pragma once
#include <qobjectdefs.h>
#include <room.h>
#include <QCache>
@@ -735,6 +736,20 @@ public:
*/
void setSavedText(const QString &savedText);
/**
* @brief Reply to the last message sent in the timeline.
*
* @note This checks a maximum of the previous 35 message for performance reasons.
*/
Q_INVOKABLE void replyLastMessage();
/**
* @brief Edit the last message sent by the local user.
*
* @note This checks a maximum of the previous 35 message for performance reasons.
*/
Q_INVOKABLE void editLastMessage();
#ifdef QUOTIENT_07
/**
* @brief Get a PollHandler object for the given event Id.