Content Model Author

Make sure that the Author in the content model is only ever updated int he following circumstacnes:
- The member updates their displayname or avatar
- A previously hidden author line is shown

This is done by only doing a full reset on initialisation or when a previously hidden author is shown. The rest of the time we only reset the other content in the message, i.e. everything below the author line.
This commit is contained in:
James Graham
2024-07-13 16:01:42 +00:00
parent b211f46e3e
commit 0392a33b54
2 changed files with 55 additions and 27 deletions

View File

@@ -124,7 +124,9 @@ private:
void initializeModel();
QList<MessageComponent> m_components;
void updateComponents(bool isEditing = false);
void resetModel();
void resetContent(bool isEditing = false);
QList<MessageComponent> messageContentComponents(bool isEditing = false);
QPointer<MessageContentModel> m_replyModel;
void updateReplyModel();
@@ -133,7 +135,7 @@ private:
QList<MessageComponent> componentsForType(MessageComponentType::Type type);
MessageComponent linkPreviewComponent(const QUrl &link);
void addLinkPreviews();
QList<MessageComponent> addLinkPreviews(QList<MessageComponent> inputComponents);
QList<QUrl> m_removedLinkPreviews;