Add "Invite to call" action for inviting users into an existing call

This commit is contained in:
Hadi Nategh 2020-04-28 18:35:25 +02:00
parent 42b78ab708
commit 79f8079150
3 changed files with 29 additions and 2 deletions

View File

@ -592,6 +592,13 @@ class addressbook_ui extends addressbook_bo
'onExecute' => 'javaScript:app.addressbook.videoconference_actionCall',
'enabled' => 'javaScript:app.addressbook.videoconference_isUserOnline'
],
'invite' => [
'caption' => lang('Invite to Call'),
'icon' => 'status/videoconference_join',
'allowOnMultiple' => true,
'onExecute' => 'javaScript:app.addressbook.videoconference_actionCall',
'enabled' => 'javaScript:app.addressbook.videoconference_isThereAnyCall'
],
'schedule_call' => [
'caption' => lang('Schedule a video conference'),
'icon' => 'calendar',

View File

@ -1104,6 +1104,9 @@ var AddressbookApp = /** @class */ (function (_super) {
}
return true;
};
AddressbookApp.prototype.videoconference_isThereAnyCall = function (_action, _selected) {
return this.videoconference_isUserOnline(_action, _selected) && egw.getSessionItem('status', 'videoconference-session');
};
/**
* Call action
* @param _action
@ -1119,7 +1122,12 @@ var AddressbookApp = /** @class */ (function (_super) {
avatar: "account:" + row.data.account_id
});
}
app.status.makeCall(data);
if (_action.id == 'invite') {
app.status.inviteToCall(data, egw.getSessionItem('status', 'videoconference-session'));
}
else {
app.status.makeCall(data);
}
};
return AddressbookApp;
}(egw_app_1.EgwApp));

View File

@ -1343,6 +1343,11 @@ class AddressbookApp extends EgwApp
return true;
}
private videoconference_isThereAnyCall(_action, _selected)
{
return this.videoconference_isUserOnline(_action, _selected) && egw.getSessionItem('status', 'videoconference-session');
}
/**
* Call action
* @param _action
@ -1360,7 +1365,14 @@ class AddressbookApp extends EgwApp
avatar: "account:"+row.data.account_id
});
}
app.status.makeCall(data);
if (_action.id == 'invite')
{
app.status.inviteToCall(data, egw.getSessionItem('status', 'videoconference-session'));
}
else
{
app.status.makeCall(data);
}
}
}