Commit cfaf2907 authored by Aline Gondim Santos's avatar Aline Gondim Santos

plugins: add plugins choice to calls and conversations

Change-Id: Ic77d3936e69c1b8e25d93b7e62443f0262d2e0cf
parent 32956532
......@@ -180,6 +180,8 @@ SET(ringclient_CONTROLLERS
src/RecordFileVC.h
src/ChooseContactVC.mm
src/ChooseContactVC.h
src/ChoosePluginHandlerVC.mm
src/ChoosePluginHandlerVC.h
src/CallInConferenceVC.mm
src/CallInConferenceVC.h
src/ConnectToAccManagerVC.mm
......@@ -302,6 +304,7 @@ SET(ringclient_XIBS
LeaveMessageVC
RecordFileVC
ChooseContactVC
ChoosePluginHandlerVC
CallInConferenceVC
ConnectToAccManagerVC
AccountBackupVC
......
/*
* Copyright (C) 2021 Savoir-faire Linux Inc.
* Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#import <Cocoa/Cocoa.h>
#include <qstring.h>
typedef enum {
FROM_CALL = 1,
FROM_CHAT
} PluginPickerType;
namespace lrc {
namespace api {
class PluginModel;
}
}
@interface ChoosePluginHandlerVC : NSViewController
@property (nonatomic) lrc::api::PluginModel* pluginModel;
-(void) setupForCall:(const QString&)callID;
-(void) setupForChat:(const QString&)convID accountID:(const QString&)accountID;
@end
/*
* Copyright (C) 2021 Savoir-faire Linux Inc.
* Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#import "ChoosePluginHandlerVC.h"
#import "views/RingTableView.h"
#import "views/HoverTableRowView.h"
#import "utils.h"
//LRC
#import <api/pluginmodel.h>
@interface ChoosePluginHandlerVC () {
__unsafe_unretained IBOutlet RingTableView* pluginHandlersView;
}
@end
@implementation ChoosePluginHandlerVC
@synthesize pluginModel;
PluginPickerType handlerType;
QString currentCall;
QString currentPeerID;
QString currentAccount;
QVector<QString> availableHandlers;
QVector<QString> activeHandlers;
// Tags for views
NSInteger const ICON_TAG = 100;
NSInteger const HANDLER_NAME_TAG = 200;
NSInteger const HANDLER_STATUS_TAG = 300;
- (void) reloadView
{
[pluginHandlersView reloadData];
}
-(void)viewDidLoad {
[super viewDidLoad];
if (@available(macOS 11.0, *)) {
pluginHandlersView.style = NSTableViewStylePlain;
}
[self reloadView];
}
-(void)setupForCall:(const QString&)callID {
handlerType = FROM_CALL;
if (pluginModel == nil) {
return;
}
currentCall = callID;
availableHandlers = pluginModel->getCallMediaHandlers();
activeHandlers = pluginModel->getCallMediaHandlerStatus(currentCall);
[self reloadView];
}
-(void)setupForChat:(const QString&)convID accountID:(const QString&)accountID {
handlerType = FROM_CHAT;
if (pluginModel == nil) {
return;
}
currentPeerID = convID;
currentAccount = accountID;
availableHandlers = pluginModel->getChatHandlers();
activeHandlers = pluginModel->getChatHandlerStatus(currentAccount, currentPeerID);
[self reloadView];
}
-(void)updateHandlerStatus:(NSInteger)row {
if (handlerType == FROM_CALL)
activeHandlers = pluginModel->getCallMediaHandlerStatus(currentCall);
else
activeHandlers = pluginModel->getChatHandlerStatus(currentAccount, currentPeerID);
NSIndexSet* rowsToUpdate = [[NSIndexSet alloc] initWithIndex:row];
NSIndexSet* colsToUpdate = [[NSIndexSet alloc] initWithIndex:0];
[pluginHandlersView reloadDataForRowIndexes:rowsToUpdate columnIndexes:colsToUpdate];
}
#pragma mark - IBAction
-(IBAction)toggleHandler:(id)sender
{
NSInteger row = [pluginHandlersView rowForView:sender];
if(row < 0) {
return;
}
bool toggle = [sender state];
if (handlerType == FROM_CALL)
pluginModel->toggleCallMediaHandler(availableHandlers[row], currentCall, toggle);
else
pluginModel->toggleChatHandler(availableHandlers[row], currentAccount, currentPeerID, toggle);
[self updateHandlerStatus:row];
}
#pragma mark - NSTableViewDelegate methods
- (NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row
{
HoverTableRowView *howerRow = [tableView makeViewWithIdentifier:@"HoverRowView" owner:nil];
[howerRow setBlurType:7];
return howerRow;
}
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
if (tableView != pluginHandlersView || row < 0 || row >= availableHandlers.size()) {
return nil;
}
NSTableCellView* handlerCell = [tableView makeViewWithIdentifier:@"MainCell" owner:tableView];
NSTextField* pluginHandlerName = [handlerCell viewWithTag:HANDLER_NAME_TAG];
NSImageView* iconView = [handlerCell viewWithTag:ICON_TAG];
NSSwitch* handlerStatusView = [handlerCell viewWithTag:HANDLER_STATUS_TAG];
auto handler = availableHandlers[row];
auto handlerStatus = false;
lrc::api::plugin::PluginHandlerDetails handlerDetails;
if (handlerType == FROM_CALL)
handlerDetails = pluginModel->getCallMediaHandlerDetails(handler);
else
handlerDetails = pluginModel->getChatHandlerDetails(handler);
for (const auto& item : activeHandlers) {
if (item == handler) {
handlerStatus = true;
break;
}
}
[handlerStatusView setState:handlerStatus];
[handlerStatusView setAction:@selector(toggleHandler:)];
if (handlerDetails.iconPath.endsWith(".svg")) {
handlerDetails.iconPath.replace(".svg", ".png");
}
NSString* pathIcon = handlerDetails.iconPath.toNSString();
NSImage *image = [[NSImage alloc] initWithContentsOfFile:pathIcon];
if (image)
[iconView setImage: image];
[pluginHandlerName setStringValue: handlerDetails.name.toNSString()];
return handlerCell;
}
#pragma mark - NSTableDataSource methods
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
{
return availableHandlers.size();
}
@end
......@@ -19,11 +19,13 @@
#import <Cocoa/Cocoa.h>
#import <qstring.h>
#import "ChoosePluginHandlerVC.h"
namespace lrc {
namespace api {
class AVModel;
class ConversationModel;
class PluginModel;
}
}
@class RingWindowController;
......@@ -36,7 +38,7 @@ namespace lrc {
-(void) showWithAnimation:(BOOL)animate;
-(void) hideWithAnimation:(BOOL)animate;
- (void) setConversationUid:(const QString&)convUid model:(lrc::api::ConversationModel*)model;
- (void) setConversationUid:(const QString&)convUid model:(lrc::api::ConversationModel*)model pluginModel:(lrc::api::PluginModel*)pluginModel;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil delegate:(RingWindowController*) mainWindow aVModel:(lrc::api::AVModel*) avModel;
- (void) presentLeaveMessageView;
......
......@@ -38,7 +38,9 @@
#import "NSString+Extensions.h"
#import "LeaveMessageVC.h"
@interface ConversationVC () <QLPreviewPanelDataSource, QLPreviewPanelDelegate>{
#import <api/pluginmodel.h>
@interface ConversationVC () <QLPreviewPanelDataSource, QLPreviewPanelDelegate, NSPopoverDelegate>{
__unsafe_unretained IBOutlet NSTextField* conversationTitle;
__unsafe_unretained IBOutlet NSTextField *conversationID;
......@@ -55,6 +57,7 @@
QString convUid_;
const lrc::api::conversation::Info* cachedConv_;
lrc::api::ConversationModel* convModel_;
lrc::api::PluginModel* pluginModel_;
RingWindowController* delegate;
NSMutableArray* leaveMessageConversations;
......@@ -64,14 +67,21 @@
QMetaObject::Connection modelSortedConnection_, filterChangedConnection_, newConversationConnection_, conversationRemovedConnection_;
}
@property (unsafe_unretained) IBOutlet IconButton* pluginButton;
@property QMetaObject::Connection pluginButtonVisibilityChange;
@property (strong) NSPopover* brokerPopoverVC;
@end
NSInteger const MEESAGE_MARGIN = 21;
NSInteger const SEND_PANEL_DEFAULT_HEIGHT = 60;
NSInteger const SEND_PANEL_MAX_HEIGHT = 120;
@implementation ConversationVC
@synthesize pluginButton, brokerPopoverVC;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil delegate:(RingWindowController*) mainWindow aVModel:(lrc::api::AVModel*) avModel
{
if (self = [self initWithNibName:nibNameOrNil bundle:nibBundleOrNil])
......@@ -125,16 +135,20 @@ NSInteger const SEND_PANEL_MAX_HEIGHT = 120;
return cachedConv_;
}
-(void) setConversationUid:(const QString&)convUid model:(lrc::api::ConversationModel *)model {
-(void) setConversationUid:(const QString&)convUid model:(lrc::api::ConversationModel *)model pluginModel:(lrc::api::PluginModel*)pluginModel{
if (convUid_ == convUid && convModel_ == model)
return;
[self clearData];
cachedConv_ = nil;
convUid_ = convUid;
convModel_ = model;
pluginModel_ = pluginModel;
[messagesViewVC setConversationUid:convUid_ model:convModel_];
if (!pluginModel_->getPluginsEnabled() || pluginModel_->getChatHandlers().size() <= 0)
[pluginButton setHidden:YES];
if (convUid_.isEmpty() || convModel_ == nil)
return;
if([leaveMessageConversations containsObject:convUid_.toNSString()]) {
......@@ -149,6 +163,16 @@ NSInteger const SEND_PANEL_MAX_HEIGHT = 120;
QObject::disconnect(filterChangedConnection_);
QObject::disconnect(newConversationConnection_);
QObject::disconnect(conversationRemovedConnection_);
QObject::disconnect(self.pluginButtonVisibilityChange);
self.pluginButtonVisibilityChange == QObject::connect(pluginModel_,
&lrc::api::PluginModel::chatHandlerStatusUpdated,
[self](bool status) { // this should not be used
if(pluginModel_->getPluginsEnabled() && pluginModel_->getChatHandlers().size() != 0)
[pluginButton setHidden:NO];
else
[pluginButton setHidden:YES];
});
modelSortedConnection_ = QObject::connect(convModel_, &lrc::api::ConversationModel::modelChanged,
[self](){
cachedConv_ = nil;
......@@ -227,6 +251,24 @@ NSInteger const SEND_PANEL_MAX_HEIGHT = 120;
[messagesViewVC clearData];
}
- (IBAction)choosePlugin:(id)sender {
if (brokerPopoverVC != nullptr) {
[brokerPopoverVC performClose:self];
brokerPopoverVC = NULL;
} else {
auto* pluginHandlerSelectorVC = [[ChoosePluginHandlerVC alloc] initWithNibName:@"ChoosePluginHandlerVC" bundle:nil];
pluginHandlerSelectorVC.pluginModel = pluginModel_;
auto* conv = [self getCurrentConversation];
[pluginHandlerSelectorVC setupForChat:conv->participants.first() accountID:conv->accountId];
brokerPopoverVC = [[NSPopover alloc] init];
[brokerPopoverVC setContentViewController:pluginHandlerSelectorVC];
[brokerPopoverVC setAnimates:YES];
[brokerPopoverVC setBehavior:NSPopoverBehaviorTransient];
[brokerPopoverVC setDelegate:self];
[brokerPopoverVC showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge];
}
}
# pragma mark private IN/OUT animations
-(void) showWithAnimation:(BOOL)animate
......
......@@ -24,12 +24,14 @@
#import <api/account.h>
#import "ChooseContactVC.h"
#import "ChoosePluginHandlerVC.h"
#import "CallInConferenceVC.h"
#import "views/ConferenceOverlayView.h"
namespace lrc {
namespace api {
class AVModel;
class PluginModel;
}
}
......@@ -52,5 +54,6 @@ namespace lrc {
-(void) setCurrentCall:(const QString&)callUid
conversation:(const QString&)convUid
account:(const lrc::api::account::Info*)account
avModel:(lrc::api::AVModel *)avModel;
avModel:(lrc::api::AVModel *)avModel
pluginModel:(lrc::api::PluginModel*)pluginModel;
@end
......@@ -37,6 +37,7 @@ extern "C" {
#import <api/call.h>
#import <api/conversationmodel.h>
#import <api/avmodel.h>
#import <api/pluginmodel.h>
#import <globalinstances.h>
#import "AppDelegate.h"
......@@ -58,6 +59,7 @@ extern "C" {
QString callUid_;
QString confUid_;
const lrc::api::account::Info *accountInfo_;
lrc::api::PluginModel *pluginModel_;
NSTimer* refreshDurationTimer;
}
......@@ -92,6 +94,7 @@ extern "C" {
@property (unsafe_unretained) IBOutlet IconButton* muteVideoButton;
@property (unsafe_unretained) IBOutlet IconButton* transferButton;
@property (unsafe_unretained) IBOutlet IconButton* addParticipantButton;
@property (unsafe_unretained) IBOutlet IconButton* pluginButton;
@property (unsafe_unretained) IBOutlet IconButton* chatButton;
@property (unsafe_unretained) IBOutlet IconButton* qualityButton;
......@@ -110,6 +113,7 @@ extern "C" {
@property QMetaObject::Connection messageConnection;
@property QMetaObject::Connection profileUpdatedConnection;
@property QMetaObject::Connection participantsChangedConnection;
@property QMetaObject::Connection pluginButtonVisibilityChange;
//conference
@property (unsafe_unretained) IBOutlet NSStackView *callingWidgetsContainer;
......@@ -122,6 +126,7 @@ extern "C" {
@implementation CurrentCallVC
lrc::api::AVModel* mediaModel;
lrc::api::PluginModel* pluginModel_;
NSMutableDictionary *connectingCalls;
NSMutableDictionary *participantsOverlays;
NSSize framesize;
......@@ -131,7 +136,7 @@ NSInteger const PREVIEW_HEIGHT = 130;
NSInteger const HIDE_PREVIEW_BUTTON_SIZE = 25;
NSInteger const PREVIEW_MARGIN = 20;
@synthesize holdOnOffButton, hangUpButton, recordOnOffButton, pickUpButton, chatButton, transferButton, addParticipantButton, timeSpentLabel, muteVideoButton, muteAudioButton, controlsPanel, headerContainer, videoView, previewView, splitView, loadingIndicator, backgroundImage, bluerBackgroundEffect, hidePreviewButton, hidePreviewBackground, movableBaseForView, infoContainer, contactPhoto, contactNameLabel, callStateLabel, contactIdLabel, cancelCallButton, headerGradientView, controlsStackView, callingWidgetsContainer, brokerPopoverVC;
@synthesize holdOnOffButton, hangUpButton, recordOnOffButton, pickUpButton, chatButton, pluginButton, transferButton, addParticipantButton, timeSpentLabel, muteVideoButton, muteAudioButton, controlsPanel, headerContainer, videoView, previewView, splitView, loadingIndicator, backgroundImage, bluerBackgroundEffect, hidePreviewButton, hidePreviewBackground, movableBaseForView, infoContainer, contactPhoto, contactNameLabel, callStateLabel, contactIdLabel, cancelCallButton, headerGradientView, controlsStackView, callingWidgetsContainer, brokerPopoverVC;
@synthesize renderConnections;
CVPixelBufferPoolRef pixelBufferPoolDistantView;
......@@ -146,12 +151,14 @@ CVPixelBufferRef pixelBufferPreview;
-(void) setCurrentCall:(const QString&)callUid
conversation:(const QString&)convUid
account:(const lrc::api::account::Info*)account
avModel:(lrc::api::AVModel *)avModel;
avModel:(lrc::api::AVModel *)avModel
pluginModel:(lrc::api::PluginModel *)pluginModel;
{
if(account == nil)
return;
mediaModel = avModel;
pluginModel_ = pluginModel;
auto* callModel = account->callModel.get();
if (not callModel->hasCall(callUid)){
......@@ -187,7 +194,7 @@ CVPixelBufferRef pixelBufferPreview;
participantsOverlays[call.peerUri.toNSString()] = nil;
if (![self isCurrentCall: callID]) {
[self updateCall];
[self setCurrentCall: callUid_ conversation:convUid_ account:accountInfo_ avModel:mediaModel];
[self setCurrentCall: callUid_ conversation:convUid_ account:accountInfo_ avModel:mediaModel pluginModel:pluginModel_];
}
}
break;
......@@ -230,6 +237,15 @@ CVPixelBufferRef pixelBufferPreview;
-(void) connectSignals {
auto* callModel = accountInfo_->callModel.get();
auto* convModel = accountInfo_->conversationModel.get();
QObject::disconnect(self.pluginButtonVisibilityChange);
self.pluginButtonVisibilityChange == QObject::connect(pluginModel_,
&lrc::api::PluginModel::chatHandlerStatusUpdated,
[self](bool status) { // this should not be used
if(pluginModel_->getPluginsEnabled() && pluginModel_->getCallMediaHandlers().size() != 0)
[pluginButton setHidden:NO];
else
[pluginButton setHidden:YES];
});
QObject::disconnect(self.participantsChangedConnection);
self.participantsChangedConnection = QObject::connect(callModel,
&lrc::api::NewCallModel::onParticipantsChanged,
......@@ -559,6 +575,8 @@ CVPixelBufferRef pixelBufferPreview;
[headerContainer setHidden:NO];
[headerGradientView setHidden:NO];
[controlsPanel setHidden:NO];
if(!pluginModel_->getPluginsEnabled() || pluginModel_->getCallMediaHandlers().size() == 0)
[pluginButton setHidden:YES];
[controlsStackView setHidden:NO];
if(currentCall.isAudioOnly) {
[self setUpAudioOnlyView];
......@@ -853,6 +871,7 @@ CVPixelBufferRef pixelBufferPreview;
QObject::disconnect(self.messageConnection);
[self.chatButton setPressed:NO];
[self.pluginButton setPressed:NO];
[self collapseRightView];
[timeSpentLabel setStringValue:@""];
......@@ -1087,6 +1106,23 @@ CVPixelBufferRef pixelBufferPreview;
}
}
- (IBAction)choosePlugin:(id)sender {
if (brokerPopoverVC != nullptr) {
[brokerPopoverVC performClose:self];
brokerPopoverVC = NULL;
} else {
auto* pluginHandlerSelectorVC = [[ChoosePluginHandlerVC alloc] initWithNibName:@"ChoosePluginHandlerVC" bundle:nil];
pluginHandlerSelectorVC.pluginModel = pluginModel_;
[pluginHandlerSelectorVC setupForCall: [self getcallID]];
brokerPopoverVC = [[NSPopover alloc] init];
[brokerPopoverVC setContentViewController:pluginHandlerSelectorVC];
[brokerPopoverVC setAnimates:YES];
[brokerPopoverVC setBehavior:NSPopoverBehaviorTransient];
[brokerPopoverVC setDelegate:self];
[brokerPopoverVC showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge];
}
}
- (IBAction)hidePreview:(id)sender {
CGRect previewFrame = previewView.frame;
CGRect newPreviewFrame;
......
......@@ -70,6 +70,7 @@ NS_ENUM(NSInteger, tablesViews1) {
- (IBAction)toggleEnablePluginsButton:(NSButton *)sender {
bool enabled = [sender state]==NSOnState;
self.pluginModel->setPluginsEnabled(enabled);
self.pluginModel->chatHandlerStatusUpdated(false);
[self update];
}
......@@ -83,6 +84,7 @@ NS_ENUM(NSInteger, tablesViews1) {
if ([[panel URLs] lastObject] == nil) return;
NSString * path = [[[panel URLs] lastObject] path];
bool status = self.pluginModel->installPlugin(QString::fromNSString(path), true);
self.pluginModel->chatHandlerStatusUpdated(false);
[self update];
}
......@@ -102,6 +104,7 @@ NS_ENUM(NSInteger, tablesViews1) {
self.pluginModel->unloadPlugin(plugin);
} else
self.pluginModel->loadPlugin(plugin);
self.pluginModel->chatHandlerStatusUpdated(false);
[self update];
}
......
......@@ -265,9 +265,10 @@ typedef NS_ENUM(NSInteger, ViewState) {
[currentCallVC setCurrentCall:convInfo.callId
conversation:convInfo.uid
account:accInfo
avModel: avModel];
avModel: avModel
pluginModel: self.pluginModel];
[self changeViewTo:SHOW_CALL_SCREEN];
[conversationVC setConversationUid:convInfo.uid model:accInfo->conversationModel.get()];
[conversationVC setConversationUid:convInfo.uid model:accInfo->conversationModel.get() pluginModel:pluginModel];
} catch (std::out_of_range& e) {
NSLog(@"contact out of range");
}
......@@ -302,10 +303,11 @@ typedef NS_ENUM(NSInteger, ViewState) {
[currentCallVC setCurrentCall:convInfo.callId
conversation:convInfo.uid
account:accInfo
avModel: avModel];
avModel: avModel
pluginModel:self.pluginModel];
[smartViewVC selectConversation: convInfo model:accInfo->conversationModel.get()];
[self changeViewTo:SHOW_CALL_SCREEN];
[conversationVC setConversationUid:convInfo.uid model:accInfo->conversationModel.get()];
[conversationVC setConversationUid:convInfo.uid model:accInfo->conversationModel.get() pluginModel:pluginModel];
} catch (std::out_of_range& e) {
NSLog(@"contact out of range");
}
......@@ -320,7 +322,7 @@ typedef NS_ENUM(NSInteger, ViewState) {
auto convOpt = getConversationFromUid(convUid, *convModel);
if (!convOpt.has_value()) { return; }
lrc::api::conversation::Info& convInfo = *convOpt;
[conversationVC setConversationUid:convInfo.uid model:accInfo.conversationModel.get()];
[conversationVC setConversationUid:convInfo.uid model:accInfo.conversationModel.get() pluginModel:pluginModel];
[smartViewVC selectConversation: convInfo model:accInfo.conversationModel.get()];
[self changeViewTo:SHOW_CONVERSATION_SCREEN];
});
......@@ -333,7 +335,7 @@ typedef NS_ENUM(NSInteger, ViewState) {
auto convOpt = getConversationFromUid(convUid, *convModel);
if (!convOpt.has_value()) { return; }
lrc::api::conversation::Info& convInfo = *convOpt;
[conversationVC setConversationUid:convInfo.uid model:accInfo.conversationModel.get()];
[conversationVC setConversationUid:convInfo.uid model:accInfo.conversationModel.get() pluginModel:pluginModel];
[smartViewVC selectConversation: convInfo model:accInfo.conversationModel.get()];
[self changeViewTo:LEAVE_MESSAGE];
});
......@@ -674,7 +676,7 @@ typedef NS_ENUM(NSInteger, ViewState) {
return;
}
lrc::api::conversation::Info& convInfo = *convOpt;
[conversationVC setConversationUid:convInfo.uid model:accInfo.conversationModel.get()];
[conversationVC setConversationUid:convInfo.uid model:accInfo.conversationModel.get() pluginModel:pluginModel];
[smartViewVC selectConversation: convInfo model:accInfo.conversationModel.get()];
accInfo.conversationModel.get()->clearUnreadInteractions(QString::fromNSString(conversationId));
[self changeViewTo:SHOW_CONVERSATION_SCREEN];
......@@ -701,7 +703,8 @@ typedef NS_ENUM(NSInteger, ViewState) {
[currentCallVC setCurrentCall:QString::fromNSString(callId)
conversation:QString::fromNSString(conversationId)
account:&accInfo
avModel:avModel];
avModel:avModel
pluginModel:self.pluginModel];
[self changeViewTo:SHOW_CALL_SCREEN];
}
......@@ -715,7 +718,7 @@ typedef NS_ENUM(NSInteger, ViewState) {
auto convOpt = getConversationFromURI(QString::fromNSString(uri), *accInfo.conversationModel.get());
if (convOpt.has_value()) {
lrc::api::conversation::Info& conversation = *convOpt;
[conversationVC setConversationUid:conversation.uid model:accInfo.conversationModel.get()];
[conversationVC setConversationUid:conversation.uid model:accInfo.conversationModel.get() pluginModel:pluginModel];
[smartViewVC selectConversation: conversation model:accInfo.conversationModel.get()];
}
[self changeViewTo:SHOW_CONVERSATION_SCREEN];
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>