4
4
* @license Mozilla Public License (MPLv2)
5
5
*/
6
6
7
- import { _converse , converse } from '@converse/headless/core' ;
7
+ import { _converse , converse , api } from '@converse/headless/core' ;
8
8
import 'plugins/modal/index.js' ;
9
9
import { __ } from 'i18n' ;
10
10
import { html } from "lit" ;
11
+ import AddJingleModal from "./modal/jingle-call-modal.js"
11
12
12
13
13
14
converse . plugins . add ( 'converse-jingle' , {
@@ -23,16 +24,16 @@ converse.plugins.add('converse-jingle', {
23
24
*/
24
25
dependencies : [ 'converse-chatview' ] ,
25
26
26
- initialize : function ( ) {
27
+ initialize : function ( o ) {
27
28
/* The initialize function gets called as soon as the plugin is
28
29
* loaded by converse.js's plugin machinery.
29
30
*/
30
- _converse . api . listen . on ( 'getToolbarButtons' , ( toolbar_el , buttons ) => {
31
+ _converse . api . listen . on ( 'getToolbarButtons' , ( buttons ) => {
31
32
if ( ! this . is_groupchat ) {
32
33
const color = '--chat-toolbar-btn-color' ;
33
34
const i18n_start_call = __ ( 'Start a call' ) ;
34
35
buttons . push ( html `
35
- < button class ="toggle-call " @click =${ this . toggleCall } title ="${ i18n_start_call } ">
36
+ < button class ="toggle-call " @click =${ ( ev ) => api . modal . show ( AddJingleModal , { 'model' : o . model } , ev ) } title ="${ i18n_start_call } ">
36
37
< converse-icon color ="var(${ color } ) " class ="fa fa-phone " size ="1em "> </ converse-icon >
37
38
</ button > `
38
39
) ;
0 commit comments