Move reply pane to use MessageContentModel

Move reply pane to use MessageContentModel. This means the reply pane component is no longer required.

This commit also limits the size of code and image componets in a reply to keep them from getting too huge.
This commit is contained in:
James Graham
2024-09-15 08:39:22 +00:00
parent ec6a8dd028
commit 1821d9fc04
8 changed files with 80 additions and 116 deletions

View File

@@ -8,6 +8,8 @@
#include <QQuickTextDocument>
#include <QTextCursor>
#include "models/messagecontentmodel.h"
class ChatDocumentHandler;
namespace Quotient
@@ -100,7 +102,7 @@ class ChatBarCache : public QObject
*
* @sa Quotient::RoomMember
*/
Q_PROPERTY(Quotient::RoomMember relationUser READ relationUser NOTIFY relationIdChanged)
Q_PROPERTY(Quotient::RoomMember relationAuthor READ relationAuthor NOTIFY relationIdChanged)
/**
* @brief The content of the related message.
@@ -109,6 +111,13 @@ class ChatBarCache : public QObject
*/
Q_PROPERTY(QString relationMessage READ relationMessage NOTIFY relationIdChanged)
/**
* @brief The MessageContentModel for the related message.
*
* Will be nullptr if no related message.
*/
Q_PROPERTY(MessageContentModel *relationEventContentModel READ relationEventContentModel NOTIFY relationIdChanged)
/**
* @brief Whether the chat bar is replying in a thread.
*/
@@ -154,9 +163,10 @@ public:
QString editId() const;
void setEditId(const QString &editId);
Quotient::RoomMember relationUser() const;
Quotient::RoomMember relationAuthor() const;
QString relationMessage() const;
MessageContentModel *relationEventContentModel();
bool isThreaded() const;
QString threadId() const;
@@ -206,4 +216,6 @@ private:
QString m_attachmentPath = QString();
QList<Mention> m_mentions;
QString m_savedText;
QPointer<MessageContentModel> m_relationContentModel;
};