From 53b5add8e771c13e72263493be41adfb837afd85 Mon Sep 17 00:00:00 2001
From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
Date: Mon, 16 Aug 2021 13:10:14 -0400
Subject: [PATCH] chatview: make participant avatars available in the webview

Gitlab: #492
Change-Id: Ia9df04b26d80b9178993d73bb6ec3f8d187178f9
---
 src/messagesadapter.cpp | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/messagesadapter.cpp b/src/messagesadapter.cpp
index 93b7e6fdf..e714306f1 100644
--- a/src/messagesadapter.cpp
+++ b/src/messagesadapter.cpp
@@ -330,19 +330,13 @@ MessagesAdapter::userIsComposing(bool isComposing)
 void
 MessagesAdapter::setConversationProfileData(const conversation::Info& convInfo)
 {
-    auto& accInfo = lrcInstance_->getCurrentAccountInfo();
-    if (convInfo.participants.isEmpty()) {
-        return;
+    // make the all the participant avatars available within the web view
+    for (const auto& participant : convInfo.participants) {
+        QByteArray ba;
+        QBuffer bu(&ba);
+        Utils::conversationAvatar(lrcInstance_, convInfo.uid).save(&bu, "PNG");
+        setSenderImage(participant, QString::fromLocal8Bit(ba.toBase64()));
     }
-
-    auto title = accInfo.conversationModel->title(convInfo.uid);
-
-    // make the conversation avatar available within the web view
-    auto avatar = Utils::conversationAvatar(lrcInstance_, convInfo.uid);
-    QByteArray ba;
-    QBuffer bu(&ba);
-    avatar.save(&bu, "PNG");
-    setSenderImage(title, QString::fromLocal8Bit(ba.toBase64()));
 }
 
 void
-- 
GitLab