From 56b8981e19fc4792b363e1b424ff975ed5ca7dac Mon Sep 17 00:00:00 2001
From: kkostiuk <kateryna.kostiuk@savoirfairelinux.com>
Date: Mon, 31 May 2021 12:10:49 -0400
Subject: [PATCH] UI: fix plugins view in call

Change-Id: I103814433a8ca87adc9201d75f38504b4b60438a
---
 src/ChoosePluginHandlerVC.mm | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/ChoosePluginHandlerVC.mm b/src/ChoosePluginHandlerVC.mm
index 0a13b085..c4bf8ace 100644
--- a/src/ChoosePluginHandlerVC.mm
+++ b/src/ChoosePluginHandlerVC.mm
@@ -75,11 +75,16 @@ CGFloat PLUGIN_ROW_HEIGHT = 35;
     NSTextField* textField = [[NSTextField alloc] init];
     CGFloat maxWidth = 0;
     NSFont *fontName = [NSFont systemFontOfSize: 13.0 weight: NSFontWeightMedium];
-    for (auto plugin : availableHandlers) {
-        NSDictionary *attrs= [NSDictionary dictionaryWithObjectsAndKeys:
-                                   fontName, NSFontAttributeName,
-                                   nil];
-        NSAttributedString* attributed = [[NSAttributedString alloc] initWithString:plugin.toNSString() attributes: attrs];
+    NSDictionary *attrs= [NSDictionary dictionaryWithObjectsAndKeys:
+                               fontName, NSFontAttributeName,
+                               nil];
+    for (auto handler : availableHandlers) {
+        lrc::api::plugin::PluginHandlerDetails handlerDetails;
+        if (handlerType == FROM_CALL)
+            handlerDetails = pluginModel->getCallMediaHandlerDetails(handler);
+        else
+            handlerDetails = pluginModel->getChatHandlerDetails(handler);
+        NSAttributedString* attributed = [[NSAttributedString alloc] initWithString:handlerDetails.name.toNSString() attributes: attrs];
         textField.attributedStringValue = attributed;
         [textField sizeToFit];
         if (textField.frame.size.width > maxWidth) {
-- 
GitLab