diff --git a/src/models/messagecontentmodel.cpp b/src/models/messagecontentmodel.cpp index aeeab3f09..67fbf5c82 100644 --- a/src/models/messagecontentmodel.cpp +++ b/src/models/messagecontentmodel.cpp @@ -588,15 +588,22 @@ QList MessageContentModel::componentsForType(MessageComponentT case MessageComponentType::Video: { if (!event.first->is()) { const auto roomMessageEvent = eventCast(event.first); - QList components; - components += MessageComponent{type, QString(), {}}; - auto body = EventHandler::rawMessageBody(*roomMessageEvent); - components += TextHandler().textComponents(body, - EventHandler::messageBodyInputFormat(*roomMessageEvent), - m_room, - roomMessageEvent, - roomMessageEvent->isReplaced()); - return components; + const auto fileContent = roomMessageEvent->get(); + if (fileContent != nullptr) { + const auto fileInfo = fileContent->commonInfo(); + const auto body = EventHandler::rawMessageBody(*roomMessageEvent); + // Do not attach the description to the image, if it's the same as the original filename. + if (fileInfo.originalName != body) { + QList components; + components += MessageComponent{type, QString(), {}}; + components += TextHandler().textComponents(body, + EventHandler::messageBodyInputFormat(*roomMessageEvent), + m_room, + roomMessageEvent, + roomMessageEvent->isReplaced()); + return components; + } + } } } default: