Skip to content

Commit d31b485

Browse files
committed
(TBR)added a boilerplate modal for jingle call
1 parent fb84f10 commit d31b485

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/plugins/jingle/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
* @license Mozilla Public License (MPLv2)
55
*/
66

7-
import { _converse, converse } from '@converse/headless/core';
7+
import { _converse, converse, api } from '@converse/headless/core';
88
import 'plugins/modal/index.js';
99
import { __ } from 'i18n';
1010
import { html } from "lit";
11+
import AddJingleModal from "./modal/jingle-call-modal.js"
1112

1213

1314
converse.plugins.add('converse-jingle', {
@@ -23,16 +24,16 @@ converse.plugins.add('converse-jingle', {
2324
*/
2425
dependencies: ['converse-chatview'],
2526

26-
initialize: function () {
27+
initialize: function (o) {
2728
/* The initialize function gets called as soon as the plugin is
2829
* loaded by converse.js's plugin machinery.
2930
*/
30-
_converse.api.listen.on('getToolbarButtons', (toolbar_el, buttons) => {
31+
_converse.api.listen.on('getToolbarButtons', (buttons) => {
3132
if (!this.is_groupchat) {
3233
const color = '--chat-toolbar-btn-color';
3334
const i18n_start_call = __('Start a call');
3435
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}">
3637
<converse-icon color="var(${color})" class="fa fa-phone" size="1em"></converse-icon>
3738
</button>`
3839
);

0 commit comments

Comments
 (0)