BubbleDownloadButtonEntity *createDownloadButtonEntity(Message::Direction direction);
private:
- BubbleEntity *createEntity(const std::string &filePath, const std::string &fileName, const std::string &mime, BubbleBgViewItem::BgType bgType, Message::Direction direction);
+ BubbleEntity *createEntity(const std::string &filePath, const std::string &fileName, std::string mime, BubbleBgViewItem::BgType bgType, Message::Direction direction);
BubbleEntityFactory(BubbleEntityFactory&) = delete;
BubbleEntityFactory& operator=(const BubbleEntityFactory&) = delete;
return new BubbleDownloadButtonEntity(direction);
}
-BubbleEntity *BubbleEntityFactory::createEntity(const std::string &filePath, const std::string &fileName, const std::string &mime, BubbleBgViewItem::BgType bgType, Message::Direction direction)
+BubbleEntity *BubbleEntityFactory::createEntity(const std::string &filePath, const std::string &fileName, std::string mime, BubbleBgViewItem::BgType bgType, Message::Direction direction)
{
+ std::transform(mime.begin(), mime.end(), mime.begin(), ::tolower);
if(FileUtils::isExists(filePath))
{
MsgMedia::Type msgMediaType = getMsgMediaTypeByMime(mime);
default:
if(mime == "text/x-vcalendar" || mime == "text/calendar")
return new BubbleCalEventEntity(filePath, fileName, bgType, direction);
- else if(mime == "text/x-vcard" || mime == "text/vcard")
+ else if(mime == "text/x-vcard" ||
+ mime == "text/vcard" ||
+ mime == "text/x-vcalendar")
return new BubbleContactEntity(m_App, filePath, fileName , bgType, direction);
else if(mime != "application/smil")
return new BubbleUnknownFileEntity(filePath, fileName, bgType, direction);