Further refactor MessageContentModel

Further refactor MessageContentModel. Move away from special casing certian MessageContentTypes. Use forEachComponentOfType more
This commit is contained in:
James Graham
2025-07-16 18:27:03 +01:00
parent a17aa2c6fa
commit 7a5de25885
4 changed files with 75 additions and 75 deletions

View File

@@ -570,8 +570,8 @@ QVariantMap TextHandler::getAttributes(const QString &tag, const QString &tagStr
QList<MessageComponent>
TextHandler::textComponents(QString string, Qt::TextFormat inputFormat, const NeoChatRoom *room, const Quotient::RoomEvent *event, bool isEdited)
{
if (string.isEmpty()) {
return {};
if (string.trimmed().isEmpty()) {
return {MessageComponent{MessageComponentType::Text, i18n("<i>This event does not have any content.</i>"), {}}};
}
// Strip mx-reply if present.