Remove connection manager menu option.
Converse.js now includes a connection manager option on the login form so this option is not necessary.
This commit is contained in:
parent
6b9910aa13
commit
2740bac95b
|
@ -9,7 +9,7 @@ converse.plugins.add('converse-desktop-credentials', {
|
||||||
api.listen.on('afterResourceBinding', () => {
|
api.listen.on('afterResourceBinding', () => {
|
||||||
if (_converse.connection.pass) {
|
if (_converse.connection.pass) {
|
||||||
credentials.addCredentials(
|
credentials.addCredentials(
|
||||||
converse.connectionManager,
|
_converse.connection.service,
|
||||||
_converse.bare_jid,
|
_converse.bare_jid,
|
||||||
_converse.connection.pass
|
_converse.connection.pass
|
||||||
);
|
);
|
||||||
|
|
2
main.js
2
main.js
|
@ -33,7 +33,7 @@ function createWindow () {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
app.mainWindow = mainWindow = new BrowserWindow(mainWindowOptions)
|
mainWindow = new BrowserWindow(mainWindowOptions)
|
||||||
mainWindow.maximize();
|
mainWindow.maximize();
|
||||||
|
|
||||||
// Init tray
|
// Init tray
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*/
|
*/
|
||||||
const {app, Menu, MenuItem, BrowserWindow} = require('electron')
|
const {app, Menu, MenuItem, BrowserWindow} = require('electron')
|
||||||
const settingsService = require(__dirname + '/../modules/settings-service')
|
const settingsService = require(__dirname + '/../modules/settings-service')
|
||||||
const prompt = require('electron-prompt');
|
|
||||||
|
|
||||||
const menuService = {}
|
const menuService = {}
|
||||||
|
|
||||||
|
@ -32,26 +31,6 @@ menuService.createMenu = () => {
|
||||||
settingsService.set('minimizeOnClose', converse.getMenuItemById('minimize-on-close').checked);
|
settingsService.set('minimizeOnClose', converse.getMenuItemById('minimize-on-close').checked);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: 'Connection Manager...',
|
|
||||||
click: () => {
|
|
||||||
let currentValue = settingsService.get('connectionManager') || '';
|
|
||||||
prompt({
|
|
||||||
title: 'Connection manager'
|
|
||||||
, label: 'Connection manager URL:'
|
|
||||||
, value: currentValue
|
|
||||||
, resizable: true
|
|
||||||
, width: 620
|
|
||||||
, height: 180
|
|
||||||
}, app.mainWindow).then(function (newValue) {
|
|
||||||
if (newValue !== null && newValue !== currentValue) {
|
|
||||||
settingsService.set('connectionManager', newValue === '' ? null : newValue);
|
|
||||||
app.mainWindow.reload()
|
|
||||||
}
|
|
||||||
}).catch(function (ex) {
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
type: 'separator',
|
type: 'separator',
|
||||||
},
|
},
|
||||||
|
|
|
@ -29,12 +29,11 @@
|
||||||
"eslint": "^8.4.1"
|
"eslint": "^8.4.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"converse.js": "conversejs/converse.js#cb0b176",
|
"converse.js": "conversejs/converse.js#d570b60",
|
||||||
"electron-settings": "^4.0.2",
|
"electron-settings": "^4.0.2",
|
||||||
"github-buttons": "^2.8.0",
|
"github-buttons": "^2.8.0",
|
||||||
"keytar": "^7.3.0",
|
"keytar": "^7.3.0",
|
||||||
"open-iconic": "^1.1.1",
|
"open-iconic": "^1.1.1"
|
||||||
"electron-prompt": "^1.7.0"
|
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "com.denry.converse-desktop",
|
"appId": "com.denry.converse-desktop",
|
||||||
|
|
3
setup.js
3
setup.js
|
@ -7,8 +7,6 @@ async function initialize () {
|
||||||
let websocket_url, bosh_service_url;
|
let websocket_url, bosh_service_url;
|
||||||
const { connectionManager, login, password } = await getCredentials()
|
const { connectionManager, login, password } = await getCredentials()
|
||||||
|
|
||||||
converse.connectionManager = connectionManager;
|
|
||||||
|
|
||||||
if (connectionManager?.startsWith('ws')) {
|
if (connectionManager?.startsWith('ws')) {
|
||||||
websocket_url = connectionManager
|
websocket_url = connectionManager
|
||||||
} else if (connectionManager?.startsWith('http')) {
|
} else if (connectionManager?.startsWith('http')) {
|
||||||
|
@ -41,6 +39,7 @@ async function initialize () {
|
||||||
view_mode: 'fullscreen',
|
view_mode: 'fullscreen',
|
||||||
websocket_url,
|
websocket_url,
|
||||||
whitelisted_plugins: ['converse-debug', 'converse-desktop-credentials', 'converse-desktop-trayicon'],
|
whitelisted_plugins: ['converse-debug', 'converse-desktop-credentials', 'converse-desktop-trayicon'],
|
||||||
|
show_connection_url_input: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue