From a91dbc4de2380c49fec08c5af86f63b2706f4a17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Fri, 3 May 2019 14:59:33 -0400
Subject: [PATCH] conversationmodel: improve text/plain detection for SIP

Change-Id: I205e94c6e4c3674f1910408fe6367e27617cb69f
---
 src/conversationmodel.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/conversationmodel.cpp b/src/conversationmodel.cpp
index a76b5194..74573643 100644
--- a/src/conversationmodel.cpp
+++ b/src/conversationmodel.cpp
@@ -1598,7 +1598,11 @@ ConversationModelPimpl::slotNewAccountMessage(std::string& accountId,
     if (accountId != linked.owner.id)
         return;
 
-    addIncomingMessage(from, payloads["text/plain"]);
+    for (const auto &payload : payloads) {
+        if (payload.first.find("text/plain") != std::string::npos) {
+            addIncomingMessage(from, payload.second);
+        }
+    }
 }
 
 void
-- 
GitLab