Skip to content

Commit ca8c11e

Browse files
authored
Merge pull request #34 from kicken/v10.1.0
Release v10.1.5
2 parents 3896f97 + 6906f09 commit ca8c11e

23 files changed

+576
-5223
lines changed

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 10.1.5 (unreleased)
2+
3+
- Update to Electron 22.3.15
4+
- Update to Converse.js 10.1.5
5+
- Build universal binary for macOS
6+
- Remember window size and position
7+
- Update icon images
8+
19
## 10.0.0 (2022-11-01)
210

311
- Update to Electron 21

README.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ A basic integration of [Converse.js](https://conversejs.org/) and Electron. With
1818
[![One-to-one chat](https://user-images.githubusercontent.com/6234547/161444320-62179698-d4cb-4522-8ee4-5fd727bbff0d.jpg)](https://user-images.githubusercontent.com/6234547/161444152-8a44b284-48a6-4c8e-a16e-95399b4def16.jpg)
1919
[![Multi-user chat](https://user-images.githubusercontent.com/6234547/161444323-5fe7e478-1923-47c3-9e99-84020fb44009.jpg)](https://user-images.githubusercontent.com/6234547/161444156-eb2224a7-6082-4fe7-aa55-44eec093e04d.jpg)
2020

21-
2221
- Permanent account storage
2322
- Tray icon
2423
- Tray notifications
@@ -29,19 +28,17 @@ A basic integration of [Converse.js](https://conversejs.org/) and Electron. With
2928

3029
See [CHANGES.md](https://github.com/conversejs/converse-desktop/blob/master/CHANGES.md)
3130

32-
3331
#### Latest release installers
3432

35-
| Operation System | Download link |
36-
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
37-
| macOS | [Converse_Desktop-9.1.0_x64.dmg](https://github.com/conversejs/converse-desktop/releases/download/v9.1.0/Converse.Desktop-9.1.0.dmg) |
38-
| Windows | [Converse_Desktop_Setup-9.1.0_x64.exe](https://github.com/conversejs/converse-desktop/releases/download/v9.1.0/Converse.Desktop.Setup.9.1.0.exe) |
39-
| Linux DEB | [converse_desktop-9.1.0_amd64.deb](https://github.com/conversejs/converse-desktop/releases/download/v9.1.0/converse_desktop-9.1.0_amd64.deb) |
40-
| Linux AppImage | [converse_desktop-9.1.0_x86_64.AppImage](https://github.com/conversejs/converse-desktop/releases/download/v9.1.0/converse_desktop-9.1.0_x86_64.AppImage) |
41-
| Linux other | [converse_desktop-9.1.0_x64.tar.gz](https://github.com/conversejs/converse-desktop/releases/download/v9.1.0/converse_desktop-9.1.0_x64.tar.gz) |
42-
43-
- [All releases](https://github.com/conversejs/converse-desktop/releases)
33+
| Operation System | Download link |
34+
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
35+
| macOS | [Converse Desktop-10.1.5-universal.dmg](https://github.com/conversejs/converse-desktop/releases/download/v10.1.5/Converse.Desktop-10.1.5-universal.dmg) |
36+
| Windows | [Converse Desktop Setup 10.1.5.exe](https://github.com/conversejs/converse-desktop/releases/download/v10.1.5/Converse.Desktop.Setup.10.1.5.exe) |
37+
| Linux DEB | [converse_desktop-10.1.5_amd64.deb](https://github.com/conversejs/converse-desktop/releases/download/v10.1.5/converse_desktop-10.1.5_amd64.deb) |
38+
| Linux AppImage | [converse_desktop-10.1.5_x86_64.AppImage](https://github.com/conversejs/converse-desktop/releases/download/v10.1.5/converse_desktop-10.1.5_x86_64.AppImage) |
39+
| Linux other | [converse_desktop-10.1.5_x64.tar.gz](https://github.com/conversejs/converse-desktop/releases/download/v10.1.5/converse_desktop-10.1.5_x64.tar.gz) |
4440

41+
- [All releases](https://github.com/conversejs/converse-desktop/releases)
4542

4643
## Build from source
4744

@@ -75,9 +72,7 @@ Like Converse.js, Converse Desktop's files are released under the Mozilla Public
7572

7673
However, libsignal library, which is required for OMEMO support is released under the GPLv3. The MPLv2 license is compatible with GPLv3 and when GPLv3 code is included, the entire project effectively is licensed under the GPLv3.
7774

78-
Any custom build of Converse Desktop without libsignal included will again be licensed
79-
under the MPLv2.
80-
75+
Any custom build of Converse Desktop without libsignal included will again be licensed under the MPLv2.
8176

8277
## Acknowledgements
8378

app/converse-plugins/desktop-settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ converse.plugins.add('converse-desktop-settings', {
44
initialize () {
55
const { _converse } = this;
66
api.settings.changed(function (key, newValue) {
7-
if (['omemo_default'].indexOf(key) !== -1){
7+
if (['omemo_default'].indexOf(key) !== -1) {
88
_converse.api.settings.set(key, newValue);
99
}
1010
});

main.js

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,25 @@ const isMac = process.platform === 'darwin'
1616
const isWin = process.platform === 'win32'
1717

1818
function initApp () {
19-
if (!app.requestSingleInstanceLock()){
19+
if (!app.requestSingleInstanceLock()) {
2020
app.quit();
2121
}
2222

2323
createWindow()
2424
// Set Windows platform notifications
25-
if (isWin){
25+
if (isWin) {
2626
app.setAppUserModelId("com.denry.converseDesktop")
2727
}
2828
}
2929

3030
function createWindow () {
31+
function getSavedWindowBounds () {
32+
const winBounds = settingsService.get('winBounds');
33+
winBounds.width = Math.max(winBounds.width, 200);
34+
winBounds.height = Math.max(winBounds.height, 200);
35+
return winBounds;
36+
}
37+
3138
// Main window options
3239
const mainWindowOptions = {
3340
zoomToPageWidth: true,
@@ -36,8 +43,8 @@ function createWindow () {
3643
webPreferences: {
3744
preload: path.join(__dirname, 'preload.js')
3845
},
39-
icon: './resources/images/logo.png',
40-
...settingsService.get('winBounds'),
46+
icon: path.join(__dirname, 'resources', 'images', 'logo-48x48.png'),
47+
...getSavedWindowBounds(),
4148
}
4249

4350
// Create the browser window.
@@ -54,21 +61,28 @@ function createWindow () {
5461

5562
// Before close
5663
mainWindow.on('close', (e) => {
57-
settingsService.set('winBounds', mainWindow.getBounds());
5864
settingsService.set('isMaximized', mainWindow.isMaximized());
5965
if (mainWindow.isFullScreen()) {
6066
mainWindow.setFullScreen(false);
6167
}
62-
if (!app.isQuitting && settingsService.get('minimizeOnClose')){
68+
if (!app.isQuitting && settingsService.get('minimizeOnClose')) {
6369
e.preventDefault()
6470
mainWindow.hide()
6571
}
6672
return false;
6773
})
6874

75+
mainWindow.on('resized', () => {
76+
settingsService.set('winBounds', mainWindow.getBounds());
77+
})
78+
mainWindow.on('moved', () => {
79+
settingsService.set('winBounds', mainWindow.getBounds());
80+
})
81+
82+
6983
// Handle shutdown event on Mac with minimizeOnClose
7084
// to prevent shutdown interrupt
71-
if (isMac){
85+
if (isMac) {
7286
const { powerMonitor } = require('electron')
7387
powerMonitor.on('shutdown', () => {
7488
app.isQuitting = true
@@ -143,7 +157,7 @@ app.on('window-all-closed', function () {
143157
})
144158

145159
app.on('activate', function () {
146-
if (mainWindow === null){
160+
if (mainWindow === null) {
147161
createWindow()
148162
} else {
149163
mainWindow.show();

modules/settings-service.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ let settingsService = {}
88

99
settingsService.get = (itemKey) => {
1010
const settingValue = electronSettings.getSync(itemKey)
11-
if (typeof settingValue === 'undefined' || settingValue === null){
11+
if (typeof settingValue === 'undefined' || settingValue === null) {
1212
return false
1313
}
1414
return settingValue
1515
}
1616

1717
settingsService.set = (itemKey, settingValue) => {
1818
electronSettings.setSync(itemKey, settingValue);
19-
if (settingsService.webContents){
19+
if (settingsService.webContents) {
2020
settingsService.webContents.send('settings', 'changed', itemKey, settingValue);
2121
}
2222
}

modules/tray-service.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,27 @@
22
* Module for Tray functions.
33
*/
44

5-
const { Tray } = require('electron')
5+
const {Tray} = require('electron')
66

77
const path = require('path')
88

99
let tray = null
1010

1111
const trayService = {}
1212

13-
const getTrayServiceIcon = (iconName = 'icon') => {
14-
let iconImage;
13+
const getTrayServiceIcon = (withEnvelope = false) => {
14+
let size;
1515
if (process.platform === 'darwin' || process.platform === 'win32') {
16-
iconImage = iconName + '-16x16'
16+
size = '16x16';
1717
} else {
18-
iconImage = iconName + '-48x48'
18+
size = '48x48';
19+
}
20+
21+
if (withEnvelope) {
22+
return path.join(__dirname, '..', 'resources', 'images', 'tray', 'envelope-' + size + '.png');
23+
} else {
24+
return path.join(__dirname, '..', 'resources', 'images', 'logo-' + size + '.png');
1925
}
20-
return path.join(__dirname, '..', 'resources', 'images', iconImage + '.png')
2126
}
2227

2328
trayService.initTray = (window) => {
@@ -32,7 +37,7 @@ trayService.initTray = (window) => {
3237
}
3338

3439
trayService.showEnvelope = () => {
35-
const iconPath = getTrayServiceIcon('envelope')
40+
const iconPath = getTrayServiceIcon(true)
3641
tray.setImage(iconPath)
3742
}
3843

0 commit comments

Comments
 (0)