Fixed: mime for vcalendar event. 85/87985/2
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Mon, 12 Sep 2016 11:28:07 +0000 (14:28 +0300)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Mon, 12 Sep 2016 11:28:47 +0000 (04:28 -0700)
Change-Id: Ifdb60123e83b5a92933d7c2db45f67b0f0b60ccc
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
src/Conversation/ConvList/Controller/inc/BubbleEntityFactory.h
src/Conversation/ConvList/Controller/src/BubbleEntityFactory.cpp

index fe2b33e..9a3bd55 100644 (file)
@@ -49,7 +49,7 @@ namespace Msg
             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;
index 6364b13..6d5389f 100644 (file)
@@ -75,8 +75,9 @@ BubbleDownloadButtonEntity *BubbleEntityFactory::createDownloadButtonEntity(Mess
     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);
@@ -91,7 +92,9 @@ BubbleEntity *BubbleEntityFactory::createEntity(const std::string &filePath, con
             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);