mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-11-04 05:53:21 +00:00 
			
		
		
		
	Compare commits
	
		
			53 Commits
		
	
	
		
			snap-fix
			...
			dock-bounc
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					3091bd5be8 | ||
| 
						 | 
					5d113c611f | ||
| 
						 | 
					acf7c5a238 | ||
| 
						 | 
					da22f75300 | ||
| 
						 | 
					df35ffc3b0 | ||
| 
						 | 
					eeb0b4a666 | ||
| 
						 | 
					0a893c97c7 | ||
| 
						 | 
					99a1711bb0 | ||
| 
						 | 
					a27cf9e0e7 | ||
| 
						 | 
					22d6c6a2f3 | ||
| 
						 | 
					c742591471 | ||
| 
						 | 
					339a415d60 | ||
| 
						 | 
					f7696cc04d | ||
| 
						 | 
					1eabf5c5a2 | ||
| 
						 | 
					4d020c639b | ||
| 
						 | 
					85a6cf6890 | ||
| 
						 | 
					ef1ad820aa | ||
| 
						 | 
					10f6d80e5f | ||
| 
						 | 
					50ef02c324 | ||
| 
						 | 
					deed18d75f | ||
| 
						 | 
					0e3c6bceeb | ||
| 
						 | 
					c2e138c16a | ||
| 
						 | 
					8d1b027b0e | ||
| 
						 | 
					7bb8d78973 | ||
| 
						 | 
					a7c7791bf8 | ||
| 
						 | 
					5d120b4416 | ||
| 
						 | 
					ceaf13dee2 | ||
| 
						 | 
					f81381dfec | ||
| 
						 | 
					dbe89cdd09 | ||
| 
						 | 
					14c59bdae1 | ||
| 
						 | 
					0ac3e3f6d3 | ||
| 
						 | 
					d69c1339e6 | ||
| 
						 | 
					fe56a20334 | ||
| 
						 | 
					cfc97c9b73 | ||
| 
						 | 
					2e70b515da | ||
| 
						 | 
					51e414a508 | ||
| 
						 | 
					8e7a9bf230 | ||
| 
						 | 
					6493ddb8ec | ||
| 
						 | 
					31edbe0d67 | ||
| 
						 | 
					9980fee785 | ||
| 
						 | 
					ff9986ec6b | ||
| 
						 | 
					f3423d394c | ||
| 
						 | 
					a1da199627 | ||
| 
						 | 
					537fbe8f9e | ||
| 
						 | 
					3fccb33fca | ||
| 
						 | 
					5638590c8b | ||
| 
						 | 
					29ed00981d | ||
| 
						 | 
					d7638c0b95 | ||
| 
						 | 
					7fadbe877b | ||
| 
						 | 
					32a21889fb | ||
| 
						 | 
					c4a961f9da | ||
| 
						 | 
					ceaa898570 | ||
| 
						 | 
					73fe17041d | 
@@ -15,7 +15,7 @@ addons:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
language: node_js
 | 
					language: node_js
 | 
				
			||||||
node_js:
 | 
					node_js:
 | 
				
			||||||
- '6'
 | 
					- '8'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
before_install:
 | 
					before_install:
 | 
				
			||||||
  - ./scripts/travis-xvfb.sh
 | 
					  - ./scripts/travis-xvfb.sh
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,7 +12,7 @@ Zulip-Desktop app is built on top of [Electron](http://electron.atom.io/). If yo
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
* The whole Zulip documentation, such as setting up a development environment, setting up with the Zulip webapp project, and testing, can be read [here](https://zulip.readthedocs.io).
 | 
					* The whole Zulip documentation, such as setting up a development environment, setting up with the Zulip webapp project, and testing, can be read [here](https://zulip.readthedocs.io).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* If you have any questions regarding zulip-electron, open an [issue](https://github.com/zulip/zulip-electron/issues/new/) or ask it on [chat.zulip.org](https://chat.zulip.org/#narrow/stream/electron).
 | 
					* If you have any questions regarding zulip-electron, open an [issue](https://github.com/zulip/zulip-electron/issues/new/) or ask it on [chat.zulip.org](https://chat.zulip.org/#narrow/stream/16-desktop).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Issue
 | 
					## Issue
 | 
				
			||||||
Ensure the bug was not already reported by searching on GitHub under [issues](https://github.com/zulip/zulip-electron/issues). If you're unable to find an open issue addressing the bug, open a [new issue](https://github.com/zulip/zulip-electron/issues/new).
 | 
					Ensure the bug was not already reported by searching on GitHub under [issues](https://github.com/zulip/zulip-electron/issues). If you're unable to find an open issue addressing the bug, open a [new issue](https://github.com/zulip/zulip-electron/issues/new).
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,11 @@
 | 
				
			|||||||
'use strict';
 | 
					'use strict';
 | 
				
			||||||
const { app, dialog } = require('electron');
 | 
					const { app, dialog, shell } = require('electron');
 | 
				
			||||||
const { autoUpdater } = require('electron-updater');
 | 
					const { autoUpdater } = require('electron-updater');
 | 
				
			||||||
const isDev = require('electron-is-dev');
 | 
					const isDev = require('electron-is-dev');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const ConfigUtil = require('./../renderer/js/utils/config-util.js');
 | 
					const ConfigUtil = require('./../renderer/js/utils/config-util.js');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function appUpdater() {
 | 
					function appUpdater(updateFromMenu = false) {
 | 
				
			||||||
	// Don't initiate auto-updates in development
 | 
						// Don't initiate auto-updates in development
 | 
				
			||||||
	if (isDev) {
 | 
						if (isDev) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
@@ -17,6 +17,8 @@ function appUpdater() {
 | 
				
			|||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						let updateAvailable = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Create Logs directory
 | 
						// Create Logs directory
 | 
				
			||||||
	const LogsDir = `${app.getPath('userData')}/Logs`;
 | 
						const LogsDir = `${app.getPath('userData')}/Logs`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -28,7 +30,58 @@ function appUpdater() {
 | 
				
			|||||||
	autoUpdater.logger = log;
 | 
						autoUpdater.logger = log;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Handle auto updates for beta/pre releases
 | 
						// Handle auto updates for beta/pre releases
 | 
				
			||||||
	autoUpdater.allowPrerelease = ConfigUtil.getConfigItem('betaUpdate') || false;
 | 
						const isBetaUpdate = ConfigUtil.getConfigItem('betaUpdate');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						autoUpdater.allowPrerelease = isBetaUpdate || false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						const eventsListenerRemove = ['update-available', 'update-not-available'];
 | 
				
			||||||
 | 
						autoUpdater.on('update-available', info => {
 | 
				
			||||||
 | 
							if (updateFromMenu) {
 | 
				
			||||||
 | 
								dialog.showMessageBox({
 | 
				
			||||||
 | 
									message: `A new version ${info.version}, of Zulip Desktop is available`,
 | 
				
			||||||
 | 
									detail: 'The update will be downloaded in the background. You will be notified when it is ready to be installed.'
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								updateAvailable = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// This is to prevent removal of 'update-downloaded' and 'error' event listener.
 | 
				
			||||||
 | 
								eventsListenerRemove.forEach(event => {
 | 
				
			||||||
 | 
									autoUpdater.removeAllListeners(event);
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						autoUpdater.on('update-not-available', () => {
 | 
				
			||||||
 | 
							if (updateFromMenu) {
 | 
				
			||||||
 | 
								dialog.showMessageBox({
 | 
				
			||||||
 | 
									message: 'No updates available',
 | 
				
			||||||
 | 
									detail: `You are running the latest version of Zulip Desktop.\nVersion: ${app.getVersion()}`
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								// Remove all autoUpdator listeners so that next time autoUpdator is manually called these
 | 
				
			||||||
 | 
								// listeners don't trigger multiple times.
 | 
				
			||||||
 | 
								autoUpdater.removeAllListeners();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						autoUpdater.on('error', error => {
 | 
				
			||||||
 | 
							if (updateFromMenu) {
 | 
				
			||||||
 | 
								const messageText = (updateAvailable) ? ('Unable to download the updates') : ('Unable to check for updates');
 | 
				
			||||||
 | 
								dialog.showMessageBox({
 | 
				
			||||||
 | 
									type: 'error',
 | 
				
			||||||
 | 
									buttons: ['Manual Download', 'Cancel'],
 | 
				
			||||||
 | 
									message: messageText,
 | 
				
			||||||
 | 
									detail: (error).toString() + `\n\nThe latest version of Zulip Desktop is available at -\nhttps://zulipchat.com/apps/.\n
 | 
				
			||||||
 | 
					Current Version: ${app.getVersion()}`
 | 
				
			||||||
 | 
								}, response => {
 | 
				
			||||||
 | 
									if (response === 0) {
 | 
				
			||||||
 | 
										shell.openExternal('https://zulipchat.com/apps/');
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								// Remove all autoUpdator listeners so that next time autoUpdator is manually called these
 | 
				
			||||||
 | 
								// listeners don't trigger multiple times.
 | 
				
			||||||
 | 
								autoUpdater.removeAllListeners();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Ask the user if update is available
 | 
						// Ask the user if update is available
 | 
				
			||||||
	// eslint-disable-next-line no-unused-vars
 | 
						// eslint-disable-next-line no-unused-vars
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,7 +7,7 @@ const crashHandler = () => {
 | 
				
			|||||||
		productName: 'zulip-electron',
 | 
							productName: 'zulip-electron',
 | 
				
			||||||
		companyName: 'Kandra Labs, Inc.',
 | 
							companyName: 'Kandra Labs, Inc.',
 | 
				
			||||||
		submitURL: 'https://zulip-sentry.herokuapp.com/crashreport',
 | 
							submitURL: 'https://zulip-sentry.herokuapp.com/crashreport',
 | 
				
			||||||
		autoSubmit: true
 | 
							uploadToServer: true
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@ const { app, ipcMain } = electron;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const BadgeSettings = require('./../renderer/js/pages/preference/badge-settings.js');
 | 
					const BadgeSettings = require('./../renderer/js/pages/preference/badge-settings.js');
 | 
				
			||||||
const ConfigUtil = require('./../renderer/js/utils/config-util.js');
 | 
					const ConfigUtil = require('./../renderer/js/utils/config-util.js');
 | 
				
			||||||
 | 
					const ProxyUtil = require('./../renderer/js/utils/proxy-util.js');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Adds debug features like hotkeys for triggering dev tools and reload
 | 
					// Adds debug features like hotkeys for triggering dev tools and reload
 | 
				
			||||||
// in development mode
 | 
					// in development mode
 | 
				
			||||||
@@ -53,7 +54,8 @@ function createMainWindow() {
 | 
				
			|||||||
	// Load the previous state with fallback to defaults
 | 
						// Load the previous state with fallback to defaults
 | 
				
			||||||
	const mainWindowState = windowStateKeeper({
 | 
						const mainWindowState = windowStateKeeper({
 | 
				
			||||||
		defaultWidth: 1100,
 | 
							defaultWidth: 1100,
 | 
				
			||||||
		defaultHeight: 720
 | 
							defaultHeight: 720,
 | 
				
			||||||
 | 
							path: `${app.getPath('userData')}/config`
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Let's keep the window position global so that we can access it in other process
 | 
						// Let's keep the window position global so that we can access it in other process
 | 
				
			||||||
@@ -131,6 +133,10 @@ function createMainWindow() {
 | 
				
			|||||||
// Decrease load on GPU (experimental)
 | 
					// Decrease load on GPU (experimental)
 | 
				
			||||||
app.disableHardwareAcceleration();
 | 
					app.disableHardwareAcceleration();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Temporary fix for Electron render colors differently
 | 
				
			||||||
 | 
					// More info here - https://github.com/electron/electron/issues/10732
 | 
				
			||||||
 | 
					app.commandLine.appendSwitch('force-color-profile', 'srgb');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// eslint-disable-next-line max-params
 | 
					// eslint-disable-next-line max-params
 | 
				
			||||||
app.on('certificate-error', (event, webContents, url, error, certificate, callback) => {
 | 
					app.on('certificate-error', (event, webContents, url, error, certificate, callback) => {
 | 
				
			||||||
	event.preventDefault();
 | 
						event.preventDefault();
 | 
				
			||||||
@@ -149,6 +155,12 @@ app.on('ready', () => {
 | 
				
			|||||||
	});
 | 
						});
 | 
				
			||||||
	mainWindow = createMainWindow();
 | 
						mainWindow = createMainWindow();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						const isSystemProxy = ConfigUtil.getConfigItem('useSystemProxy');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (isSystemProxy) {
 | 
				
			||||||
 | 
							ProxyUtil.resolveSystemProxy(mainWindow);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const page = mainWindow.webContents;
 | 
						const page = mainWindow.webContents;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	page.on('dom-ready', () => {
 | 
						page.on('dom-ready', () => {
 | 
				
			||||||
@@ -161,7 +173,9 @@ app.on('ready', () => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	page.once('did-frame-finish-load', () => {
 | 
						page.once('did-frame-finish-load', () => {
 | 
				
			||||||
		// Initate auto-updates on MacOS and Windows
 | 
							// Initate auto-updates on MacOS and Windows
 | 
				
			||||||
		appUpdater();
 | 
							if (ConfigUtil.getConfigItem('autoUpdate')) {
 | 
				
			||||||
 | 
								appUpdater();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		crashHandler();
 | 
							crashHandler();
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,12 @@ const request = require('request');
 | 
				
			|||||||
const semver = require('semver');
 | 
					const semver = require('semver');
 | 
				
			||||||
const ConfigUtil = require('../renderer/js/utils/config-util');
 | 
					const ConfigUtil = require('../renderer/js/utils/config-util');
 | 
				
			||||||
const LinuxUpdateUtil = require('../renderer/js/utils/linux-update-util');
 | 
					const LinuxUpdateUtil = require('../renderer/js/utils/linux-update-util');
 | 
				
			||||||
 | 
					const Logger = require('../renderer/js/utils/logger-util');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const logger = new Logger({
 | 
				
			||||||
 | 
						file: 'linux-update-util.log',
 | 
				
			||||||
 | 
						timestamp: true
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function linuxUpdateNotification() {
 | 
					function linuxUpdateNotification() {
 | 
				
			||||||
	let	url = 'https://api.github.com/repos/zulip/zulip-electron/releases';
 | 
						let	url = 'https://api.github.com/repos/zulip/zulip-electron/releases';
 | 
				
			||||||
@@ -17,7 +23,8 @@ function linuxUpdateNotification() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	request(options, (error, response, body) => {
 | 
						request(options, (error, response, body) => {
 | 
				
			||||||
		if (error) {
 | 
							if (error) {
 | 
				
			||||||
			console.log('Error:', error);
 | 
								logger.error('Linux update error.');
 | 
				
			||||||
 | 
								logger.error(error);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (response.statusCode < 400) {
 | 
							if (response.statusCode < 400) {
 | 
				
			||||||
@@ -32,7 +39,7 @@ function linuxUpdateNotification() {
 | 
				
			|||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			console.log('Status:', response.statusCode);
 | 
								logger.log('Linux update response status: ', response.statusCode);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,11 +4,20 @@ const path = require('path');
 | 
				
			|||||||
const { app, shell, BrowserWindow, Menu, dialog } = require('electron');
 | 
					const { app, shell, BrowserWindow, Menu, dialog } = require('electron');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const fs = require('fs-extra');
 | 
					const fs = require('fs-extra');
 | 
				
			||||||
 | 
					const AdmZip = require('adm-zip');
 | 
				
			||||||
 | 
					const { appUpdater } = require('./autoupdater');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const ConfigUtil = require(__dirname + '/../renderer/js/utils/config-util.js');
 | 
					const ConfigUtil = require(__dirname + '/../renderer/js/utils/config-util.js');
 | 
				
			||||||
 | 
					const DNDUtil = require(__dirname + '/../renderer/js/utils/dnd-util.js');
 | 
				
			||||||
 | 
					const Logger = require(__dirname + '/../renderer/js/utils/logger-util.js');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const appName = app.getName();
 | 
					const appName = app.getName();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const logger = new Logger({
 | 
				
			||||||
 | 
						file: 'errors.log',
 | 
				
			||||||
 | 
						timestamp: true
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class AppMenu {
 | 
					class AppMenu {
 | 
				
			||||||
	getHistorySubmenu() {
 | 
						getHistorySubmenu() {
 | 
				
			||||||
		return [{
 | 
							return [{
 | 
				
			||||||
@@ -133,13 +142,26 @@ class AppMenu {
 | 
				
			|||||||
			}, {
 | 
								}, {
 | 
				
			||||||
				label: 'Show App Logs',
 | 
									label: 'Show App Logs',
 | 
				
			||||||
				click() {
 | 
									click() {
 | 
				
			||||||
					shell.openItem(app.getPath('userData'));
 | 
										const zip = new AdmZip();
 | 
				
			||||||
 | 
										let date = new Date();
 | 
				
			||||||
 | 
										date = date.toLocaleDateString().replace(/\//g, '-');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										// Create a zip file of all the logs and config data
 | 
				
			||||||
 | 
										zip.addLocalFolder(`${app.getPath('appData')}/${appName}/Logs`);
 | 
				
			||||||
 | 
										zip.addLocalFolder(`${app.getPath('appData')}/${appName}/config`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										// Put the log file in downloads folder
 | 
				
			||||||
 | 
										const logFilePath = `${app.getPath('downloads')}/Zulip-logs-${date}.zip`;
 | 
				
			||||||
 | 
										zip.writeZip(logFilePath);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										// Open and select the log file
 | 
				
			||||||
 | 
										shell.showItemInFolder(logFilePath);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}, {
 | 
								}, {
 | 
				
			||||||
				label: 'Report an Issue...',
 | 
									label: 'Report an Issue...',
 | 
				
			||||||
				click() {
 | 
									click() {
 | 
				
			||||||
          // the goal is to notify the main.html BrowserWindow
 | 
										// the goal is to notify the main.html BrowserWindow
 | 
				
			||||||
          // which may not be the focused window.
 | 
										// which may not be the focused window.
 | 
				
			||||||
					BrowserWindow.getAllWindows().forEach(window => {
 | 
										BrowserWindow.getAllWindows().forEach(window => {
 | 
				
			||||||
						window.webContents.send('open-feedback-modal');
 | 
											window.webContents.send('open-feedback-modal');
 | 
				
			||||||
					});
 | 
										});
 | 
				
			||||||
@@ -194,6 +216,11 @@ class AppMenu {
 | 
				
			|||||||
						AppMenu.sendAction('open-about');
 | 
											AppMenu.sendAction('open-about');
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
								}, {
 | 
				
			||||||
 | 
									label: `Check for Update`,
 | 
				
			||||||
 | 
									click() {
 | 
				
			||||||
 | 
										AppMenu.checkForUpdate();
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			}, {
 | 
								}, {
 | 
				
			||||||
				type: 'separator'
 | 
									type: 'separator'
 | 
				
			||||||
			}, {
 | 
								}, {
 | 
				
			||||||
@@ -214,6 +241,13 @@ class AppMenu {
 | 
				
			|||||||
				}
 | 
									}
 | 
				
			||||||
			}, {
 | 
								}, {
 | 
				
			||||||
				type: 'separator'
 | 
									type: 'separator'
 | 
				
			||||||
 | 
								}, {
 | 
				
			||||||
 | 
									label: 'Toggle Do Not Disturb',
 | 
				
			||||||
 | 
									accelerator: 'Command+Shift+M',
 | 
				
			||||||
 | 
									click() {
 | 
				
			||||||
 | 
										const dndUtil = DNDUtil.toggle();
 | 
				
			||||||
 | 
										AppMenu.sendAction('toggle-dnd', dndUtil.dnd, dndUtil.newSettings);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			}, {
 | 
								}, {
 | 
				
			||||||
				label: 'Reset App Settings',
 | 
									label: 'Reset App Settings',
 | 
				
			||||||
				accelerator: 'Command+Shift+D',
 | 
									accelerator: 'Command+Shift+D',
 | 
				
			||||||
@@ -294,6 +328,11 @@ class AppMenu {
 | 
				
			|||||||
						AppMenu.sendAction('open-about');
 | 
											AppMenu.sendAction('open-about');
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
								}, {
 | 
				
			||||||
 | 
									label: `Check for Update`,
 | 
				
			||||||
 | 
									click() {
 | 
				
			||||||
 | 
										AppMenu.checkForUpdate();
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			}, {
 | 
								}, {
 | 
				
			||||||
				type: 'separator'
 | 
									type: 'separator'
 | 
				
			||||||
			}, {
 | 
								}, {
 | 
				
			||||||
@@ -316,6 +355,13 @@ class AppMenu {
 | 
				
			|||||||
				}
 | 
									}
 | 
				
			||||||
			}, {
 | 
								}, {
 | 
				
			||||||
				type: 'separator'
 | 
									type: 'separator'
 | 
				
			||||||
 | 
								}, {
 | 
				
			||||||
 | 
									label: 'Toggle Do Not Disturb',
 | 
				
			||||||
 | 
									accelerator: 'Ctrl+Shift+M',
 | 
				
			||||||
 | 
									click() {
 | 
				
			||||||
 | 
										const dndUtil = DNDUtil.toggle();
 | 
				
			||||||
 | 
										AppMenu.sendAction('toggle-dnd', dndUtil.dnd, dndUtil.newSettings);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			}, {
 | 
								}, {
 | 
				
			||||||
				label: 'Reset App Settings',
 | 
									label: 'Reset App Settings',
 | 
				
			||||||
				accelerator: 'Ctrl+Shift+D',
 | 
									accelerator: 'Ctrl+Shift+D',
 | 
				
			||||||
@@ -384,11 +430,14 @@ class AppMenu {
 | 
				
			|||||||
		win.webContents.send(action, ...params);
 | 
							win.webContents.send(action, ...params);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						static checkForUpdate() {
 | 
				
			||||||
 | 
							appUpdater(true);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	static resetAppSettings() {
 | 
						static resetAppSettings() {
 | 
				
			||||||
		const resetAppSettingsMessage = 'By proceeding you will be removing all connected organizations and preferences from Zulip.';
 | 
							const resetAppSettingsMessage = 'By proceeding you will be removing all connected organizations and preferences from Zulip.';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// We save App's settings/configurations in following files
 | 
							// We save App's settings/configurations in following files
 | 
				
			||||||
		const settingFiles = ['window-state.json', 'domain.json', 'settings.json'];
 | 
							const settingFiles = ['config/window-state.json', 'config/domain.json', 'config/settings.json', 'config/certificates.json'];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		dialog.showMessageBox({
 | 
							dialog.showMessageBox({
 | 
				
			||||||
			type: 'warning',
 | 
								type: 'warning',
 | 
				
			||||||
@@ -402,7 +451,8 @@ class AppMenu {
 | 
				
			|||||||
					const getSettingFilesPath = path.join(app.getPath('appData'), appName, settingFileName);
 | 
										const getSettingFilesPath = path.join(app.getPath('appData'), appName, settingFileName);
 | 
				
			||||||
					fs.access(getSettingFilesPath, error => {
 | 
										fs.access(getSettingFilesPath, error => {
 | 
				
			||||||
						if (error) {
 | 
											if (error) {
 | 
				
			||||||
							console.log(error);
 | 
												logger.error('Error while resetting app settings.');
 | 
				
			||||||
 | 
												logger.error(error);
 | 
				
			||||||
						} else {
 | 
											} else {
 | 
				
			||||||
							fs.unlink(getSettingFilesPath, () => {
 | 
												fs.unlink(getSettingFilesPath, () => {
 | 
				
			||||||
								AppMenu.sendAction('clear-app-data');
 | 
													AppMenu.sendAction('clear-app-data');
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										829
									
								
								app/package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										829
									
								
								app/package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,7 +1,7 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "zulip",
 | 
					  "name": "zulip",
 | 
				
			||||||
  "productName": "Zulip",
 | 
					  "productName": "Zulip",
 | 
				
			||||||
  "version": "2.0.0",
 | 
					  "version": "2.3.2",
 | 
				
			||||||
  "description": "Zulip Desktop App",
 | 
					  "description": "Zulip Desktop App",
 | 
				
			||||||
  "license": "Apache-2.0",
 | 
					  "license": "Apache-2.0",
 | 
				
			||||||
  "copyright": "Kandra Labs, Inc.",
 | 
					  "copyright": "Kandra Labs, Inc.",
 | 
				
			||||||
@@ -27,19 +27,20 @@
 | 
				
			|||||||
  ],
 | 
					  ],
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "@electron-elements/send-feedback": "1.0.7",
 | 
					    "@electron-elements/send-feedback": "1.0.7",
 | 
				
			||||||
    "auto-launch": "5.0.1",
 | 
					    "escape-html": "1.0.3",
 | 
				
			||||||
 | 
					    "auto-launch": "5.0.5",
 | 
				
			||||||
    "electron-is-dev": "0.3.0",
 | 
					    "electron-is-dev": "0.3.0",
 | 
				
			||||||
    "electron-log": "2.2.7",
 | 
					    "electron-log": "2.2.14",
 | 
				
			||||||
    "electron-spellchecker": "1.1.2",
 | 
					    "electron-spellchecker": "1.1.2",
 | 
				
			||||||
    "electron-updater": "2.21.4",
 | 
					    "electron-updater": "2.23.3",
 | 
				
			||||||
    "electron-window-state": "4.1.1",
 | 
					    "electron-window-state": "4.1.1",
 | 
				
			||||||
    "is-online": "7.0.0",
 | 
					    "is-online": "7.0.0",
 | 
				
			||||||
    "node-json-db": "0.7.3",
 | 
					    "node-json-db": "0.7.3",
 | 
				
			||||||
    "request": "2.81.0",
 | 
					    "request": "2.85.0",
 | 
				
			||||||
    "semver": "5.4.1",
 | 
					    "semver": "5.4.1",
 | 
				
			||||||
    "wurl": "2.5.0"
 | 
					    "wurl": "2.5.0"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "optionalDependencies": {
 | 
					  "optionalDependencies": {
 | 
				
			||||||
    "node-mac-notifier": "0.0.13"
 | 
					    "node-mac-notifier": "0.1.0"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,9 +13,6 @@ body {
 | 
				
			|||||||
#content {
 | 
					#content {
 | 
				
			||||||
    display: flex;
 | 
					    display: flex;
 | 
				
			||||||
    height: 100%;
 | 
					    height: 100%;
 | 
				
			||||||
    background: #fff url(../img/ic_loading.gif) no-repeat;
 | 
					 | 
				
			||||||
    background-size: 60px 60px;
 | 
					 | 
				
			||||||
    background-position: center;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.toggle-sidebar {
 | 
					.toggle-sidebar {
 | 
				
			||||||
@@ -46,7 +43,7 @@ body {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#view-controls-container {
 | 
					#view-controls-container {
 | 
				
			||||||
	height: calc(100% - 156px);
 | 
						height: calc(100% - 208px);
 | 
				
			||||||
	overflow-y: hidden;
 | 
						overflow-y: hidden;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -273,6 +270,25 @@ body {
 | 
				
			|||||||
    width: 100%;
 | 
					    width: 100%;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/*Pseudo element for loading indicator*/
 | 
				
			||||||
 | 
					#webviews-container::before {
 | 
				
			||||||
 | 
					    content: "";
 | 
				
			||||||
 | 
					    position: absolute;
 | 
				
			||||||
 | 
					    z-index: 1;
 | 
				
			||||||
 | 
					    background: #fff url(../img/ic_loading.gif) no-repeat;
 | 
				
			||||||
 | 
					    background-size: 60px 60px;
 | 
				
			||||||
 | 
					    background-position: center;
 | 
				
			||||||
 | 
					    width: 100%;
 | 
				
			||||||
 | 
					    height: 100%;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/*When the active webview is loaded*/
 | 
				
			||||||
 | 
					#webviews-container.loaded::before {
 | 
				
			||||||
 | 
					    opacity: 0;
 | 
				
			||||||
 | 
					    z-index: -1;
 | 
				
			||||||
 | 
					    visibility: hidden;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
webview {
 | 
					webview {
 | 
				
			||||||
    /* transition: opacity 0.3s ease-in; */
 | 
					    /* transition: opacity 0.3s ease-in; */
 | 
				
			||||||
    flex-grow: 1;
 | 
					    flex-grow: 1;
 | 
				
			||||||
@@ -284,11 +300,6 @@ webview {
 | 
				
			|||||||
    flex-direction: column;
 | 
					    flex-direction: column;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
webview.download-webview {
 | 
					 | 
				
			||||||
  z-index: -1;
 | 
					 | 
				
			||||||
  pointer-events: none;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
webview.onload {
 | 
					webview.onload {
 | 
				
			||||||
    transition: opacity 1s cubic-bezier(0.95, 0.05, 0.795, 0.035);
 | 
					    transition: opacity 1s cubic-bezier(0.95, 0.05, 0.795, 0.035);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -309,6 +320,7 @@ webview.focus {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* Tooltip styling */
 | 
					/* Tooltip styling */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#dnd-tooltip,
 | 
				
			||||||
#back-tooltip,
 | 
					#back-tooltip,
 | 
				
			||||||
#reload-tooltip,
 | 
					#reload-tooltip,
 | 
				
			||||||
#setting-tooltip {
 | 
					#setting-tooltip {
 | 
				
			||||||
@@ -326,6 +338,7 @@ webview.focus {
 | 
				
			|||||||
    font-size: 14px;
 | 
					    font-size: 14px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#dnd-tooltip:after,
 | 
				
			||||||
#back-tooltip:after,
 | 
					#back-tooltip:after,
 | 
				
			||||||
#reload-tooltip:after,
 | 
					#reload-tooltip:after,
 | 
				
			||||||
#setting-tooltip:after {
 | 
					#setting-tooltip:after {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -258,8 +258,8 @@ img.server-info-icon {
 | 
				
			|||||||
    border: #4EBFAC 2px solid;
 | 
					    border: #4EBFAC 2px solid;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.setting-block {
 | 
					.manual-proxy-block {
 | 
				
			||||||
    width: 100%;
 | 
					    width: 96%;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.actions-container {
 | 
					.actions-container {
 | 
				
			||||||
@@ -557,6 +557,47 @@ input.toggle-round:checked+label:after {
 | 
				
			|||||||
    background: #329588;
 | 
					    background: #329588;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.certificates-card {
 | 
				
			||||||
 | 
					     width:70%
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.certificate-input {
 | 
				
			||||||
 | 
					     width:100%;
 | 
				
			||||||
 | 
					     margin-top: 10px; 
 | 
				
			||||||
 | 
					     display:inline-flex;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.certificate-input div {
 | 
				
			||||||
 | 
					    align-self:center;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.certificate-input .setting-input-value {
 | 
				
			||||||
 | 
					    margin-left:10px;
 | 
				
			||||||
 | 
					    max-width: 100%;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#add-certificate-button {
 | 
				
			||||||
 | 
					    width:20%;
 | 
				
			||||||
 | 
					    margin-right:0px;
 | 
				
			||||||
 | 
					    height: 35px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.tip {
 | 
				
			||||||
 | 
					    background-color: hsl(46,63%,95%);
 | 
				
			||||||
 | 
					    border: 1px solid hsl(46,63%,84%);
 | 
				
			||||||
 | 
					    border-radius: 4px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.md-14 {
 | 
				
			||||||
 | 
					    font-size: 14px;
 | 
				
			||||||
 | 
					    vertical-align: middle;
 | 
				
			||||||
 | 
					    padding-right: 6px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#open-hotkeys-link {
 | 
				
			||||||
 | 
					    text-decoration: underline;
 | 
				
			||||||
 | 
					    cursor: pointer;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* responsive grid */
 | 
					/* responsive grid */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,6 @@
 | 
				
			|||||||
const { shell } = require('electron').remote;
 | 
					const { shell } = require('electron').remote;
 | 
				
			||||||
const LinkUtil = require('../utils/link-util');
 | 
					const LinkUtil = require('../utils/link-util');
 | 
				
			||||||
const DomainUtil = require('../utils/domain-util');
 | 
					const DomainUtil = require('../utils/domain-util');
 | 
				
			||||||
const hiddenWebView = require('../components/hidden-webview');
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
function handleExternalLink(event) {
 | 
					function handleExternalLink(event) {
 | 
				
			||||||
	const { url } = event;
 | 
						const { url } = event;
 | 
				
			||||||
@@ -16,12 +15,12 @@ function handleExternalLink(event) {
 | 
				
			|||||||
	if (isWhiteListURL) {
 | 
						if (isWhiteListURL) {
 | 
				
			||||||
		event.preventDefault();
 | 
							event.preventDefault();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // only open the  pdf, mp3, mp4 etc.. in hidden webview since opening the
 | 
					    // download txt, pdf, mp3, mp4 etc.. by using downloadURL in the
 | 
				
			||||||
    // image in webview will do nothing and will not save it
 | 
					    // main process which allows the user to save the files to their desktop
 | 
				
			||||||
    // whereas the pdf will be saved to user desktop once openened in
 | 
					    // and not trigger webview reload while image in webview will
 | 
				
			||||||
    // in the hidden webview and will not trigger webview reload
 | 
					    // do nothing and will not save it
 | 
				
			||||||
		if (!LinkUtil.isImage(url) && isUploadsURL) {
 | 
							if (!LinkUtil.isImage(url) && isUploadsURL) {
 | 
				
			||||||
			hiddenWebView.loadURL(url);
 | 
								this.$el.downloadURL(url);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,9 +0,0 @@
 | 
				
			|||||||
// this hidden webview will be used to open pdf url and
 | 
					 | 
				
			||||||
// save it to user's computer without triggering a reload
 | 
					 | 
				
			||||||
// when navigating to pdf url to download it.
 | 
					 | 
				
			||||||
const hiddenWebView = document.createElement('webview');
 | 
					 | 
				
			||||||
hiddenWebView.classList.add('download-webview');
 | 
					 | 
				
			||||||
hiddenWebView.src = 'about:blank';
 | 
					 | 
				
			||||||
document.querySelector('#webviews-container').appendChild(hiddenWebView);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
module.exports = hiddenWebView;
 | 
					 | 
				
			||||||
@@ -18,9 +18,10 @@ class WebView extends BaseComponent {
 | 
				
			|||||||
		this.props = props;
 | 
							this.props = props;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		this.zoomFactor = 1.0;
 | 
							this.zoomFactor = 1.0;
 | 
				
			||||||
		this.loading = false;
 | 
							this.loading = true;
 | 
				
			||||||
		this.badgeCount = 0;
 | 
							this.badgeCount = 0;
 | 
				
			||||||
		this.customCSS = ConfigUtil.getConfigItem('customCSS');
 | 
							this.customCSS = ConfigUtil.getConfigItem('customCSS');
 | 
				
			||||||
 | 
							this.$webviewsContainer = document.querySelector('#webviews-container').classList;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	template() {
 | 
						template() {
 | 
				
			||||||
@@ -74,11 +75,16 @@ class WebView extends BaseComponent {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		this.$el.addEventListener('page-favicon-updated', event => {
 | 
							this.$el.addEventListener('page-favicon-updated', event => {
 | 
				
			||||||
			const { favicons } = event;
 | 
								const { favicons } = event;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// This returns a string of favicons URL. If there is a PM counts in unread messages then the URL would be like
 | 
								// This returns a string of favicons URL. If there is a PM counts in unread messages then the URL would be like
 | 
				
			||||||
			// https://chat.zulip.org/static/images/favicon/favicon-pms.png
 | 
								// https://chat.zulip.org/static/images/favicon/favicon-pms.png
 | 
				
			||||||
			if (favicons[0].indexOf('favicon-pms') > 0 && process.platform === 'darwin') {
 | 
								if (favicons[0].indexOf('favicon-pms') > 0 && process.platform === 'darwin') {
 | 
				
			||||||
				// This api is only supported on macOS
 | 
									// This api is only supported on macOS
 | 
				
			||||||
				app.dock.setBadge('●');
 | 
									app.dock.setBadge('●');
 | 
				
			||||||
 | 
									// bounce the dock
 | 
				
			||||||
 | 
									if (ConfigUtil.getConfigItem('dockBouncing')) {
 | 
				
			||||||
 | 
										app.dock.bounce();
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -86,6 +92,7 @@ class WebView extends BaseComponent {
 | 
				
			|||||||
			if (this.props.role === 'server') {
 | 
								if (this.props.role === 'server') {
 | 
				
			||||||
				this.$el.classList.add('onload');
 | 
									this.$el.classList.add('onload');
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
								this.loading = false;
 | 
				
			||||||
			this.show();
 | 
								this.show();
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -119,6 +126,13 @@ class WebView extends BaseComponent {
 | 
				
			|||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// To show or hide the loading indicator in the the active tab
 | 
				
			||||||
 | 
							if (this.loading) {
 | 
				
			||||||
 | 
								this.$webviewsContainer.remove('loaded');
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								this.$webviewsContainer.add('loaded');
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		this.$el.classList.remove('disabled');
 | 
							this.$el.classList.remove('disabled');
 | 
				
			||||||
		this.$el.classList.add('active');
 | 
							this.$el.classList.add('active');
 | 
				
			||||||
		setTimeout(() => {
 | 
							setTimeout(() => {
 | 
				
			||||||
@@ -127,7 +141,6 @@ class WebView extends BaseComponent {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
		}, 1000);
 | 
							}, 1000);
 | 
				
			||||||
		this.focus();
 | 
							this.focus();
 | 
				
			||||||
		this.loading = false;
 | 
					 | 
				
			||||||
		this.props.onTitleChange();
 | 
							this.props.onTitleChange();
 | 
				
			||||||
		// Injecting preload css in webview to override some css rules
 | 
							// Injecting preload css in webview to override some css rules
 | 
				
			||||||
		this.$el.insertCSS(fs.readFileSync(path.join(__dirname, '/../../css/preload.css'), 'utf8'));
 | 
							this.$el.insertCSS(fs.readFileSync(path.join(__dirname, '/../../css/preload.css'), 'utf8'));
 | 
				
			||||||
@@ -220,6 +233,9 @@ class WebView extends BaseComponent {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	reload() {
 | 
						reload() {
 | 
				
			||||||
		this.hide();
 | 
							this.hide();
 | 
				
			||||||
 | 
							// Shows the loading indicator till the webview is reloaded
 | 
				
			||||||
 | 
							this.$webviewsContainer.remove('loaded');
 | 
				
			||||||
 | 
							this.loading = true;
 | 
				
			||||||
		this.$el.reload();
 | 
							this.$el.reload();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,9 +11,18 @@ const WebView = require(__dirname + '/js/components/webview.js');
 | 
				
			|||||||
const ServerTab = require(__dirname + '/js/components/server-tab.js');
 | 
					const ServerTab = require(__dirname + '/js/components/server-tab.js');
 | 
				
			||||||
const FunctionalTab = require(__dirname + '/js/components/functional-tab.js');
 | 
					const FunctionalTab = require(__dirname + '/js/components/functional-tab.js');
 | 
				
			||||||
const ConfigUtil = require(__dirname + '/js/utils/config-util.js');
 | 
					const ConfigUtil = require(__dirname + '/js/utils/config-util.js');
 | 
				
			||||||
 | 
					const DNDUtil = require(__dirname + '/js/utils/dnd-util.js');
 | 
				
			||||||
const ReconnectUtil = require(__dirname + '/js/utils/reconnect-util.js');
 | 
					const ReconnectUtil = require(__dirname + '/js/utils/reconnect-util.js');
 | 
				
			||||||
 | 
					const Logger = require(__dirname + '/js/utils/logger-util.js');
 | 
				
			||||||
const { feedbackHolder } = require(__dirname + '/js/feedback.js');
 | 
					const { feedbackHolder } = require(__dirname + '/js/feedback.js');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const escape = require('escape-html');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const logger = new Logger({
 | 
				
			||||||
 | 
						file: 'errors.log',
 | 
				
			||||||
 | 
						timestamp: true
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ServerManagerView {
 | 
					class ServerManagerView {
 | 
				
			||||||
	constructor() {
 | 
						constructor() {
 | 
				
			||||||
		this.$addServerButton = document.getElementById('add-tab');
 | 
							this.$addServerButton = document.getElementById('add-tab');
 | 
				
			||||||
@@ -24,12 +33,14 @@ class ServerManagerView {
 | 
				
			|||||||
		this.$settingsButton = $actionsContainer.querySelector('#settings-action');
 | 
							this.$settingsButton = $actionsContainer.querySelector('#settings-action');
 | 
				
			||||||
		this.$webviewsContainer = document.getElementById('webviews-container');
 | 
							this.$webviewsContainer = document.getElementById('webviews-container');
 | 
				
			||||||
		this.$backButton = $actionsContainer.querySelector('#back-action');
 | 
							this.$backButton = $actionsContainer.querySelector('#back-action');
 | 
				
			||||||
 | 
							this.$dndButton = $actionsContainer.querySelector('#dnd-action');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		this.$addServerTooltip = document.getElementById('add-server-tooltip');
 | 
							this.$addServerTooltip = document.getElementById('add-server-tooltip');
 | 
				
			||||||
		this.$reloadTooltip = $actionsContainer.querySelector('#reload-tooltip');
 | 
							this.$reloadTooltip = $actionsContainer.querySelector('#reload-tooltip');
 | 
				
			||||||
		this.$settingsTooltip = $actionsContainer.querySelector('#setting-tooltip');
 | 
							this.$settingsTooltip = $actionsContainer.querySelector('#setting-tooltip');
 | 
				
			||||||
		this.$serverIconTooltip = document.getElementsByClassName('server-tooltip');
 | 
							this.$serverIconTooltip = document.getElementsByClassName('server-tooltip');
 | 
				
			||||||
		this.$backTooltip = $actionsContainer.querySelector('#back-tooltip');
 | 
							this.$backTooltip = $actionsContainer.querySelector('#back-tooltip');
 | 
				
			||||||
 | 
							this.$dndTooltip = $actionsContainer.querySelector('#dnd-tooltip');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		this.$sidebar = document.getElementById('sidebar');
 | 
							this.$sidebar = document.getElementById('sidebar');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -55,7 +66,17 @@ class ServerManagerView {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	loadProxy() {
 | 
						loadProxy() {
 | 
				
			||||||
		return new Promise(resolve => {
 | 
							return new Promise(resolve => {
 | 
				
			||||||
			const proxyEnabled = ConfigUtil.getConfigItem('useProxy', false);
 | 
								// To change proxyEnable to useManualProxy in older versions
 | 
				
			||||||
 | 
								const proxyEnabledOld = ConfigUtil.isConfigItemExists('useProxy');
 | 
				
			||||||
 | 
								if (proxyEnabledOld) {
 | 
				
			||||||
 | 
									const proxyEnableOldState = ConfigUtil.getConfigItem('useProxy');
 | 
				
			||||||
 | 
									if (proxyEnableOldState) {
 | 
				
			||||||
 | 
										ConfigUtil.setConfigItem('useManualProxy', true);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									ConfigUtil.removeConfigItem('useProxy');
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								const proxyEnabled = ConfigUtil.getConfigItem('useManualProxy') || ConfigUtil.getConfigItem('useSystemProxy');
 | 
				
			||||||
			if (proxyEnabled) {
 | 
								if (proxyEnabled) {
 | 
				
			||||||
				session.fromPartition('persist:webviewsession').setProxy({
 | 
									session.fromPartition('persist:webviewsession').setProxy({
 | 
				
			||||||
					pacScript: ConfigUtil.getConfigItem('proxyPAC', ''),
 | 
										pacScript: ConfigUtil.getConfigItem('proxyPAC', ''),
 | 
				
			||||||
@@ -79,16 +100,23 @@ class ServerManagerView {
 | 
				
			|||||||
		// Default settings which should be respected
 | 
							// Default settings which should be respected
 | 
				
			||||||
		const settingOptions = {
 | 
							const settingOptions = {
 | 
				
			||||||
			trayIcon: true,
 | 
								trayIcon: true,
 | 
				
			||||||
			useProxy: false,
 | 
								useManualProxy: false,
 | 
				
			||||||
 | 
								useSystemProxy: false,
 | 
				
			||||||
			showSidebar: true,
 | 
								showSidebar: true,
 | 
				
			||||||
			badgeOption: true,
 | 
								badgeOption: true,
 | 
				
			||||||
			startAtLogin: false,
 | 
								startAtLogin: false,
 | 
				
			||||||
			startMinimized: false,
 | 
								startMinimized: false,
 | 
				
			||||||
			enableSpellchecker: true,
 | 
								enableSpellchecker: true,
 | 
				
			||||||
			showNotification: true,
 | 
								showNotification: true,
 | 
				
			||||||
 | 
								autoUpdate: true,
 | 
				
			||||||
			betaUpdate: false,
 | 
								betaUpdate: false,
 | 
				
			||||||
			silent: false,
 | 
								silent: false,
 | 
				
			||||||
			lastActiveTab: 0
 | 
								lastActiveTab: 0,
 | 
				
			||||||
 | 
								dnd: false,
 | 
				
			||||||
 | 
								dndPreviousSettings: {
 | 
				
			||||||
 | 
									showNotification: true,
 | 
				
			||||||
 | 
									silent: false
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Platform specific settings
 | 
							// Platform specific settings
 | 
				
			||||||
@@ -96,6 +124,12 @@ class ServerManagerView {
 | 
				
			|||||||
		if (process.platform === 'win32') {
 | 
							if (process.platform === 'win32') {
 | 
				
			||||||
			// Only available on Windows
 | 
								// Only available on Windows
 | 
				
			||||||
			settingOptions.flashTaskbarOnMessage = true;
 | 
								settingOptions.flashTaskbarOnMessage = true;
 | 
				
			||||||
 | 
								settingOptions.dndPreviousSettings.flashTaskbarOnMessage = true;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (process.platform === 'darwin') {
 | 
				
			||||||
 | 
								// Only available on macOS
 | 
				
			||||||
 | 
								settingOptions.dockBouncing = true;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (const i in settingOptions) {
 | 
							for (const i in settingOptions) {
 | 
				
			||||||
@@ -156,6 +190,11 @@ class ServerManagerView {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	initActions() {
 | 
						initActions() {
 | 
				
			||||||
 | 
							this.initDNDButton();
 | 
				
			||||||
 | 
							this.$dndButton.addEventListener('click', () => {
 | 
				
			||||||
 | 
								const dndUtil = DNDUtil.toggle();
 | 
				
			||||||
 | 
								ipcRenderer.send('forward-message', 'toggle-dnd', dndUtil.dnd, dndUtil.newSettings);
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
		this.$reloadButton.addEventListener('click', () => {
 | 
							this.$reloadButton.addEventListener('click', () => {
 | 
				
			||||||
			this.tabs[this.activeTabIndex].webview.reload();
 | 
								this.tabs[this.activeTabIndex].webview.reload();
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
@@ -180,6 +219,12 @@ class ServerManagerView {
 | 
				
			|||||||
		this.sidebarHoverEvent(this.$settingsButton, this.$settingsTooltip);
 | 
							this.sidebarHoverEvent(this.$settingsButton, this.$settingsTooltip);
 | 
				
			||||||
		this.sidebarHoverEvent(this.$reloadButton, this.$reloadTooltip);
 | 
							this.sidebarHoverEvent(this.$reloadButton, this.$reloadTooltip);
 | 
				
			||||||
		this.sidebarHoverEvent(this.$backButton, this.$backTooltip);
 | 
							this.sidebarHoverEvent(this.$backButton, this.$backTooltip);
 | 
				
			||||||
 | 
							this.sidebarHoverEvent(this.$dndButton, this.$dndTooltip);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						initDNDButton() {
 | 
				
			||||||
 | 
							const dnd = ConfigUtil.getConfigItem('dnd', false);
 | 
				
			||||||
 | 
							this.toggleDNDButton(dnd);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	getTabIndex() {
 | 
						getTabIndex() {
 | 
				
			||||||
@@ -206,7 +251,7 @@ class ServerManagerView {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	onHover(index, serverName) {
 | 
						onHover(index, serverName) {
 | 
				
			||||||
		this.$serverIconTooltip[index].innerHTML = serverName;
 | 
							this.$serverIconTooltip[index].innerHTML = escape(serverName);
 | 
				
			||||||
		this.$serverIconTooltip[index].removeAttribute('style');
 | 
							this.$serverIconTooltip[index].removeAttribute('style');
 | 
				
			||||||
		// To handle position of servers' tooltip due to scrolling of list of organizations
 | 
							// To handle position of servers' tooltip due to scrolling of list of organizations
 | 
				
			||||||
		// This could not be handled using CSS, hence the top of the tooltip is made same
 | 
							// This could not be handled using CSS, hence the top of the tooltip is made same
 | 
				
			||||||
@@ -252,6 +297,9 @@ class ServerManagerView {
 | 
				
			|||||||
				preload: false
 | 
									preload: false
 | 
				
			||||||
			})
 | 
								})
 | 
				
			||||||
		}));
 | 
							}));
 | 
				
			||||||
 | 
							// To show loading indicator the first time a functional tab is opened, indicator is
 | 
				
			||||||
 | 
							// closed when the functional tab DOM is ready, handled in webview.js
 | 
				
			||||||
 | 
							this.$webviewsContainer.classList.remove('loaded');
 | 
				
			||||||
		this.activateTab(this.functionalTabs[tabProps.name]);
 | 
							this.activateTab(this.functionalTabs[tabProps.name]);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -338,6 +386,15 @@ class ServerManagerView {
 | 
				
			|||||||
				}
 | 
									}
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							ipcRenderer.on('toggle-dnd', (event, state, newSettings) => {
 | 
				
			||||||
 | 
								this.toggleDNDButton(state);
 | 
				
			||||||
 | 
								ipcRenderer.send('forward-message', 'toggle-silent', newSettings.silent);
 | 
				
			||||||
 | 
								const selector = 'webview:not([class*=disabled])';
 | 
				
			||||||
 | 
								const webview = document.querySelector(selector);
 | 
				
			||||||
 | 
								const webContents = webview.getWebContents();
 | 
				
			||||||
 | 
								webContents.send('toggle-dnd', state, newSettings);
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	destroyTab(name, index) {
 | 
						destroyTab(name, index) {
 | 
				
			||||||
@@ -357,6 +414,9 @@ class ServerManagerView {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	destroyView() {
 | 
						destroyView() {
 | 
				
			||||||
 | 
							// Show loading indicator
 | 
				
			||||||
 | 
							this.$webviewsContainer.classList.remove('loaded');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Clear global variables
 | 
							// Clear global variables
 | 
				
			||||||
		this.activeTabIndex = -1;
 | 
							this.activeTabIndex = -1;
 | 
				
			||||||
		this.tabs = [];
 | 
							this.tabs = [];
 | 
				
			||||||
@@ -404,6 +464,12 @@ class ServerManagerView {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Toggles the dnd button icon.
 | 
				
			||||||
 | 
						toggleDNDButton(alert) {
 | 
				
			||||||
 | 
							this.$dndTooltip.textContent = (alert ? 'Turn Off' : 'Enable') + ' Do Not Disturb';
 | 
				
			||||||
 | 
							this.$dndButton.querySelector('i').textContent = alert ? 'notifications_off' : 'notifications';
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	registerIpcs() {
 | 
						registerIpcs() {
 | 
				
			||||||
		const webviewListeners = {
 | 
							const webviewListeners = {
 | 
				
			||||||
			'webview-reload': 'reload',
 | 
								'webview-reload': 'reload',
 | 
				
			||||||
@@ -453,6 +519,7 @@ class ServerManagerView {
 | 
				
			|||||||
			this.loadProxy().then(() => {
 | 
								this.loadProxy().then(() => {
 | 
				
			||||||
				if (showAlert) {
 | 
									if (showAlert) {
 | 
				
			||||||
					alert('Proxy settings saved!');
 | 
										alert('Proxy settings saved!');
 | 
				
			||||||
 | 
										ipcRenderer.send('reload-full-app');
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
@@ -527,7 +594,7 @@ window.onload = () => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	window.addEventListener('offline', () => {
 | 
						window.addEventListener('offline', () => {
 | 
				
			||||||
		reconnectUtil.clearState();
 | 
							reconnectUtil.clearState();
 | 
				
			||||||
		console.log('No internet connection, you are offline.');
 | 
							logger.log('No internet connection, you are offline.');
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// only start electron-connect (auto reload on change) when its ran
 | 
						// only start electron-connect (auto reload on change) when its ran
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,10 @@
 | 
				
			|||||||
const { remote } = require('electron');
 | 
					const { remote } = require('electron');
 | 
				
			||||||
 | 
					const Logger = require('../utils/logger-util.js');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const logger = new Logger({
 | 
				
			||||||
 | 
						file: 'errors.log',
 | 
				
			||||||
 | 
						timestamp: true
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Do not change this
 | 
					// Do not change this
 | 
				
			||||||
const appId = 'org.zulip.zulip-electron';
 | 
					const appId = 'org.zulip.zulip-electron';
 | 
				
			||||||
@@ -28,8 +34,8 @@ function loadBots(sync = false) {
 | 
				
			|||||||
			botsListLoaded = true;
 | 
								botsListLoaded = true;
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
		.fail(error => {
 | 
							.fail(error => {
 | 
				
			||||||
			console.log('Request failed: ', error.responseText);
 | 
								logger.log('Load bots request failed: ', error.responseText);
 | 
				
			||||||
			console.log('Request status: ', error.statusText);
 | 
								logger.log('Load bots request status: ', error.statusText);
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
	if (sync) {
 | 
						if (sync) {
 | 
				
			||||||
		$.ajaxSetup({async: true});
 | 
							$.ajaxSetup({async: true});
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										91
									
								
								app/renderer/js/pages/preference/add-certificate.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										91
									
								
								app/renderer/js/pages/preference/add-certificate.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,91 @@
 | 
				
			|||||||
 | 
					'use-strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const { dialog } = require('electron').remote;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const BaseComponent = require(__dirname + '/../../components/base.js');
 | 
				
			||||||
 | 
					const CertificateUtil = require(__dirname + '/../../utils/certificate-util.js');
 | 
				
			||||||
 | 
					const DomainUtil = require(__dirname + '/../../utils/domain-util.js');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class AddCertificate extends BaseComponent {
 | 
				
			||||||
 | 
						constructor(props) {
 | 
				
			||||||
 | 
							super();
 | 
				
			||||||
 | 
							this.props = props;
 | 
				
			||||||
 | 
							this._certFile = '';
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						template() {
 | 
				
			||||||
 | 
							return `			
 | 
				
			||||||
 | 
								<div class="settings-card server-center certificates-card">
 | 
				
			||||||
 | 
									<div class="certificate-input">
 | 
				
			||||||
 | 
										<div>Organization URL :</div> 
 | 
				
			||||||
 | 
										<input class="setting-input-value" autofocus placeholder="your-organization.zulipchat.com or zulip.your-organization.com"/>
 | 
				
			||||||
 | 
									</div>
 | 
				
			||||||
 | 
									<div class="certificate-input">
 | 
				
			||||||
 | 
										<div>Custom CA's certificate file :</div> 
 | 
				
			||||||
 | 
										<button id="add-certificate-button">Add</button>
 | 
				
			||||||
 | 
									</div>
 | 
				
			||||||
 | 
								</div>
 | 
				
			||||||
 | 
							`;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						init() {
 | 
				
			||||||
 | 
							this.$addCertificate = this.generateNodeFromTemplate(this.template());
 | 
				
			||||||
 | 
							this.props.$root.appendChild(this.$addCertificate);
 | 
				
			||||||
 | 
							this.addCertificateButton = this.$addCertificate.querySelector('#add-certificate-button');
 | 
				
			||||||
 | 
							this.serverUrl = this.$addCertificate.querySelectorAll('input.setting-input-value')[0];
 | 
				
			||||||
 | 
							this.initListeners();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						validateAndAdd() {
 | 
				
			||||||
 | 
							const certificate = this._certFile;
 | 
				
			||||||
 | 
							const serverUrl = this.serverUrl.value;
 | 
				
			||||||
 | 
							if (certificate !== '' && serverUrl !== '') {
 | 
				
			||||||
 | 
								const server = encodeURIComponent(DomainUtil.formatUrl(serverUrl));
 | 
				
			||||||
 | 
								const fileName = certificate.substring(certificate.lastIndexOf('/') + 1);
 | 
				
			||||||
 | 
								const copy = CertificateUtil.copyCertificate(server, certificate, fileName);
 | 
				
			||||||
 | 
								if (!copy) {
 | 
				
			||||||
 | 
									return;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								CertificateUtil.setCertificate(server, fileName);
 | 
				
			||||||
 | 
								dialog.showMessageBox({
 | 
				
			||||||
 | 
									title: 'Success',
 | 
				
			||||||
 | 
									message: `Certificate saved!`
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								this.serverUrl.value = '';
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								dialog.showErrorBox('Error', `Please, ${serverUrl === '' ?
 | 
				
			||||||
 | 
					      'Enter an Organization URL' : 'Choose certificate file'}`);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						addHandler() {
 | 
				
			||||||
 | 
							const showDialogOptions = {
 | 
				
			||||||
 | 
								title: 'Select file',
 | 
				
			||||||
 | 
								defaultId: 1,
 | 
				
			||||||
 | 
								properties: ['openFile'],
 | 
				
			||||||
 | 
								filters: [{ name: 'crt, pem', extensions: ['crt', 'pem'] }]
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
							dialog.showOpenDialog(showDialogOptions, selectedFile => {
 | 
				
			||||||
 | 
								if (selectedFile) {
 | 
				
			||||||
 | 
									this._certFile = selectedFile[0] || '';
 | 
				
			||||||
 | 
									this.validateAndAdd();
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						initListeners() {
 | 
				
			||||||
 | 
							this.addCertificateButton.addEventListener('click', () => {
 | 
				
			||||||
 | 
								this.addHandler();
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							this.serverUrl.addEventListener('keypress', event => {
 | 
				
			||||||
 | 
								const EnterkeyCode = event.keyCode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if (EnterkeyCode === 13) {
 | 
				
			||||||
 | 
									this.addHandler();
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					module.exports = AddCertificate;
 | 
				
			||||||
@@ -3,6 +3,7 @@
 | 
				
			|||||||
const BaseSection = require(__dirname + '/base-section.js');
 | 
					const BaseSection = require(__dirname + '/base-section.js');
 | 
				
			||||||
const DomainUtil = require(__dirname + '/../../utils/domain-util.js');
 | 
					const DomainUtil = require(__dirname + '/../../utils/domain-util.js');
 | 
				
			||||||
const ServerInfoForm = require(__dirname + '/server-info-form.js');
 | 
					const ServerInfoForm = require(__dirname + '/server-info-form.js');
 | 
				
			||||||
 | 
					const AddCertificate = require(__dirname + '/add-certificate.js');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ConnectedOrgSection extends BaseSection {
 | 
					class ConnectedOrgSection extends BaseSection {
 | 
				
			||||||
	constructor(props) {
 | 
						constructor(props) {
 | 
				
			||||||
@@ -16,6 +17,9 @@ class ConnectedOrgSection extends BaseSection {
 | 
				
			|||||||
				<div class="page-title">Connected organizations</div>
 | 
									<div class="page-title">Connected organizations</div>
 | 
				
			||||||
				<div class="title" id="existing-servers">All the connected orgnizations will appear here.</div>
 | 
									<div class="title" id="existing-servers">All the connected orgnizations will appear here.</div>
 | 
				
			||||||
				<div id="server-info-container"></div>
 | 
									<div id="server-info-container"></div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									<div class="page-title">Add Custom Certificates</div>
 | 
				
			||||||
 | 
									<div id="add-certificate-container"></div>
 | 
				
			||||||
			</div>
 | 
								</div>
 | 
				
			||||||
		`;
 | 
							`;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -44,6 +48,15 @@ class ConnectedOrgSection extends BaseSection {
 | 
				
			|||||||
				onChange: this.reloadApp
 | 
									onChange: this.reloadApp
 | 
				
			||||||
			}).init();
 | 
								}).init();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							this.$addCertificateContainer = document.getElementById('add-certificate-container');
 | 
				
			||||||
 | 
							this.initAddCertificate();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						initAddCertificate() {
 | 
				
			||||||
 | 
							new AddCertificate({
 | 
				
			||||||
 | 
								$root: this.$addCertificateContainer
 | 
				
			||||||
 | 
							}).init();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,6 +31,10 @@ class GeneralSection extends BaseSection {
 | 
				
			|||||||
						<div class="setting-description">Show app unread badge</div>
 | 
											<div class="setting-description">Show app unread badge</div>
 | 
				
			||||||
						<div class="setting-control"></div>
 | 
											<div class="setting-control"></div>
 | 
				
			||||||
					</div>
 | 
										</div>
 | 
				
			||||||
 | 
										<div class="setting-row" id="dock-bounce-option" style= "display:${process.platform === 'darwin' ? '' : 'none'}">
 | 
				
			||||||
 | 
											<div class="setting-description">Bounce dock on new private message</div>
 | 
				
			||||||
 | 
											<div class="setting-control"></div>
 | 
				
			||||||
 | 
										</div>
 | 
				
			||||||
					<div class="setting-row" id="flash-taskbar-option" style= "display:${process.platform === 'win32' ? '' : 'none'}">
 | 
										<div class="setting-row" id="flash-taskbar-option" style= "display:${process.platform === 'win32' ? '' : 'none'}">
 | 
				
			||||||
						<div class="setting-description">Flash taskbar on new message</div>
 | 
											<div class="setting-description">Flash taskbar on new message</div>
 | 
				
			||||||
						<div class="setting-control"></div>
 | 
											<div class="setting-control"></div>
 | 
				
			||||||
@@ -48,7 +52,11 @@ class GeneralSection extends BaseSection {
 | 
				
			|||||||
					</div>
 | 
										</div>
 | 
				
			||||||
				</div>
 | 
									</div>
 | 
				
			||||||
				<div class="title">App Updates</div>
 | 
									<div class="title">App Updates</div>
 | 
				
			||||||
                <div class="settings-card">
 | 
									<div class="settings-card">
 | 
				
			||||||
 | 
									<div class="setting-row" id="autoupdate-option">
 | 
				
			||||||
 | 
											<div class="setting-description">Enable auto updates</div>
 | 
				
			||||||
 | 
											<div class="setting-control"></div>
 | 
				
			||||||
 | 
										</div>
 | 
				
			||||||
					<div class="setting-row" id="betaupdate-option">
 | 
										<div class="setting-row" id="betaupdate-option">
 | 
				
			||||||
						<div class="setting-description">Get beta updates</div>
 | 
											<div class="setting-description">Get beta updates</div>
 | 
				
			||||||
						<div class="setting-control"></div>
 | 
											<div class="setting-control"></div>
 | 
				
			||||||
@@ -104,7 +112,8 @@ class GeneralSection extends BaseSection {
 | 
				
			|||||||
		this.updateTrayOption();
 | 
							this.updateTrayOption();
 | 
				
			||||||
		this.updateBadgeOption();
 | 
							this.updateBadgeOption();
 | 
				
			||||||
		this.updateSilentOption();
 | 
							this.updateSilentOption();
 | 
				
			||||||
		this.updateUpdateOption();
 | 
							this.autoUpdateOption();
 | 
				
			||||||
 | 
							this.betaUpdateOption();
 | 
				
			||||||
		this.updateSidebarOption();
 | 
							this.updateSidebarOption();
 | 
				
			||||||
		this.updateStartAtLoginOption();
 | 
							this.updateStartAtLoginOption();
 | 
				
			||||||
		this.updateResetDataOption();
 | 
							this.updateResetDataOption();
 | 
				
			||||||
@@ -116,10 +125,15 @@ class GeneralSection extends BaseSection {
 | 
				
			|||||||
		this.removeCustomCSS();
 | 
							this.removeCustomCSS();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Platform specific settings
 | 
							// Platform specific settings
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Flashing taskbar on Windows
 | 
							// Flashing taskbar on Windows
 | 
				
			||||||
		if (process.platform === 'win32') {
 | 
							if (process.platform === 'win32') {
 | 
				
			||||||
			this.updateFlashTaskbar();
 | 
								this.updateFlashTaskbar();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							// Dock bounce on macOS
 | 
				
			||||||
 | 
							if (process.platform === 'darwin') {
 | 
				
			||||||
 | 
								this.updateDockBouncing();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	updateTrayOption() {
 | 
						updateTrayOption() {
 | 
				
			||||||
@@ -148,6 +162,18 @@ class GeneralSection extends BaseSection {
 | 
				
			|||||||
		});
 | 
							});
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						updateDockBouncing() {
 | 
				
			||||||
 | 
							this.generateSettingOption({
 | 
				
			||||||
 | 
								$element: document.querySelector('#dock-bounce-option .setting-control'),
 | 
				
			||||||
 | 
								value: ConfigUtil.getConfigItem('dockBouncing', true),
 | 
				
			||||||
 | 
								clickHandler: () => {
 | 
				
			||||||
 | 
									const newValue = !ConfigUtil.getConfigItem('dockBouncing');
 | 
				
			||||||
 | 
									ConfigUtil.setConfigItem('dockBouncing', newValue);
 | 
				
			||||||
 | 
									this.updateDockBouncing();
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	updateFlashTaskbar() {
 | 
						updateFlashTaskbar() {
 | 
				
			||||||
		this.generateSettingOption({
 | 
							this.generateSettingOption({
 | 
				
			||||||
			$element: document.querySelector('#flash-taskbar-option .setting-control'),
 | 
								$element: document.querySelector('#flash-taskbar-option .setting-control'),
 | 
				
			||||||
@@ -160,14 +186,26 @@ class GeneralSection extends BaseSection {
 | 
				
			|||||||
		});
 | 
							});
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	updateUpdateOption() {
 | 
						autoUpdateOption() {
 | 
				
			||||||
 | 
							this.generateSettingOption({
 | 
				
			||||||
 | 
								$element: document.querySelector('#autoupdate-option .setting-control'),
 | 
				
			||||||
 | 
								value: ConfigUtil.getConfigItem('autoUpdate', true),
 | 
				
			||||||
 | 
								clickHandler: () => {
 | 
				
			||||||
 | 
									const newValue = !ConfigUtil.getConfigItem('autoUpdate');
 | 
				
			||||||
 | 
									ConfigUtil.setConfigItem('autoUpdate', newValue);
 | 
				
			||||||
 | 
									this.autoUpdateOption();
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						betaUpdateOption() {
 | 
				
			||||||
		this.generateSettingOption({
 | 
							this.generateSettingOption({
 | 
				
			||||||
			$element: document.querySelector('#betaupdate-option .setting-control'),
 | 
								$element: document.querySelector('#betaupdate-option .setting-control'),
 | 
				
			||||||
			value: ConfigUtil.getConfigItem('betaUpdate', false),
 | 
								value: ConfigUtil.getConfigItem('betaUpdate', false),
 | 
				
			||||||
			clickHandler: () => {
 | 
								clickHandler: () => {
 | 
				
			||||||
				const newValue = !ConfigUtil.getConfigItem('betaUpdate');
 | 
									const newValue = !ConfigUtil.getConfigItem('betaUpdate');
 | 
				
			||||||
				ConfigUtil.setConfigItem('betaUpdate', newValue);
 | 
									ConfigUtil.setConfigItem('betaUpdate', newValue);
 | 
				
			||||||
				this.updateUpdateOption();
 | 
									this.betaUpdateOption();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,11 +16,15 @@ class NetworkSection extends BaseSection {
 | 
				
			|||||||
            <div class="settings-pane">
 | 
					            <div class="settings-pane">
 | 
				
			||||||
                <div class="title">Proxy</div>
 | 
					                <div class="title">Proxy</div>
 | 
				
			||||||
                <div id="appearance-option-settings" class="settings-card">
 | 
					                <div id="appearance-option-settings" class="settings-card">
 | 
				
			||||||
					<div class="setting-row" id="use-proxy-option">
 | 
										<div class="setting-row" id="use-system-settings">
 | 
				
			||||||
						<div class="setting-description">Connect servers through a proxy</div>
 | 
											<div class="setting-description">Use system proxy settings (requires restart)</div>
 | 
				
			||||||
						<div class="setting-control"></div>
 | 
											<div class="setting-control"></div>
 | 
				
			||||||
					</div>
 | 
										</div>
 | 
				
			||||||
					<div class="setting-block">
 | 
										<div class="setting-row" id="use-manual-settings">
 | 
				
			||||||
 | 
											<div class="setting-description">Manual proxy configuration</div>
 | 
				
			||||||
 | 
											<div class="setting-control"></div>
 | 
				
			||||||
 | 
										</div>
 | 
				
			||||||
 | 
										<div class="manual-proxy-block">
 | 
				
			||||||
						<div class="setting-row" id="proxy-pac-option">
 | 
											<div class="setting-row" id="proxy-pac-option">
 | 
				
			||||||
							<span class="setting-input-key">PAC script</span>
 | 
												<span class="setting-input-key">PAC script</span>
 | 
				
			||||||
							<input class="setting-input-value" placeholder="e.g. foobar.com/pacfile.js"/>
 | 
												<input class="setting-input-value" placeholder="e.g. foobar.com/pacfile.js"/>
 | 
				
			||||||
@@ -51,7 +55,7 @@ class NetworkSection extends BaseSection {
 | 
				
			|||||||
		this.$proxyRules = document.querySelector('#proxy-rules-option .setting-input-value');
 | 
							this.$proxyRules = document.querySelector('#proxy-rules-option .setting-input-value');
 | 
				
			||||||
		this.$proxyBypass = document.querySelector('#proxy-bypass-option .setting-input-value');
 | 
							this.$proxyBypass = document.querySelector('#proxy-bypass-option .setting-input-value');
 | 
				
			||||||
		this.$proxySaveAction = document.getElementById('proxy-save-action');
 | 
							this.$proxySaveAction = document.getElementById('proxy-save-action');
 | 
				
			||||||
		this.$settingBlock = this.props.$root.querySelector('.setting-block');
 | 
							this.$manualProxyBlock = this.props.$root.querySelector('.manual-proxy-block');
 | 
				
			||||||
		this.initProxyOption();
 | 
							this.initProxyOption();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		this.$proxyPAC.value = ConfigUtil.getConfigItem('proxyPAC', '');
 | 
							this.$proxyPAC.value = ConfigUtil.getConfigItem('proxyPAC', '');
 | 
				
			||||||
@@ -68,31 +72,54 @@ class NetworkSection extends BaseSection {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	initProxyOption() {
 | 
						initProxyOption() {
 | 
				
			||||||
		const proxyEnabled = ConfigUtil.getConfigItem('useProxy', false);
 | 
							const manualProxyEnabled = ConfigUtil.getConfigItem('useManualProxy', false);
 | 
				
			||||||
		this.toggleProxySettings(proxyEnabled);
 | 
							this.toggleManualProxySettings(manualProxyEnabled);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		this.updateProxyOption();
 | 
							this.updateProxyOption();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	toggleProxySettings(option) {
 | 
						toggleManualProxySettings(option) {
 | 
				
			||||||
		if (option) {
 | 
							if (option) {
 | 
				
			||||||
			this.$settingBlock.classList.remove('hidden');
 | 
								this.$manualProxyBlock.classList.remove('hidden');
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			this.$settingBlock.classList.add('hidden');
 | 
								this.$manualProxyBlock.classList.add('hidden');
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	updateProxyOption() {
 | 
						updateProxyOption() {
 | 
				
			||||||
		this.generateSettingOption({
 | 
							this.generateSettingOption({
 | 
				
			||||||
			$element: document.querySelector('#use-proxy-option .setting-control'),
 | 
								$element: document.querySelector('#use-system-settings .setting-control'),
 | 
				
			||||||
			value: ConfigUtil.getConfigItem('useProxy', false),
 | 
								value: ConfigUtil.getConfigItem('useSystemProxy', false),
 | 
				
			||||||
			clickHandler: () => {
 | 
								clickHandler: () => {
 | 
				
			||||||
				const newValue = !ConfigUtil.getConfigItem('useProxy');
 | 
									const newValue = !ConfigUtil.getConfigItem('useSystemProxy');
 | 
				
			||||||
				ConfigUtil.setConfigItem('useProxy', newValue);
 | 
									const manualProxyValue = ConfigUtil.getConfigItem('useManualProxy');
 | 
				
			||||||
				this.toggleProxySettings(newValue);
 | 
									if (manualProxyValue && newValue) {
 | 
				
			||||||
				if (newValue === false) {
 | 
										ConfigUtil.setConfigItem('useManualProxy', !manualProxyValue);
 | 
				
			||||||
					// Reload proxy if the proxy is turned off
 | 
										this.toggleManualProxySettings(!manualProxyValue);
 | 
				
			||||||
					ipcRenderer.send('forward-message', 'reload-proxy', false);
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
									if (newValue === false) {
 | 
				
			||||||
 | 
										// Remove proxy system proxy settings
 | 
				
			||||||
 | 
										ConfigUtil.setConfigItem('proxyRules', '');
 | 
				
			||||||
 | 
										ipcRenderer.send('forward-message', 'reload-proxy', true);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									ConfigUtil.setConfigItem('useSystemProxy', newValue);
 | 
				
			||||||
 | 
									this.updateProxyOption();
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
							this.generateSettingOption({
 | 
				
			||||||
 | 
								$element: document.querySelector('#use-manual-settings .setting-control'),
 | 
				
			||||||
 | 
								value: ConfigUtil.getConfigItem('useManualProxy', false),
 | 
				
			||||||
 | 
								clickHandler: () => {
 | 
				
			||||||
 | 
									const newValue = !ConfigUtil.getConfigItem('useManualProxy');
 | 
				
			||||||
 | 
									const systemProxyValue = ConfigUtil.getConfigItem('useSystemProxy');
 | 
				
			||||||
 | 
									this.toggleManualProxySettings(newValue);
 | 
				
			||||||
 | 
									if (systemProxyValue && newValue) {
 | 
				
			||||||
 | 
										ConfigUtil.setConfigItem('useSystemProxy', !systemProxyValue);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									ConfigUtil.setConfigItem('proxyRules', '');
 | 
				
			||||||
 | 
									ConfigUtil.setConfigItem('useManualProxy', newValue);
 | 
				
			||||||
 | 
									// Reload app only when turning manual proxy off, hence !newValue
 | 
				
			||||||
 | 
									ipcRenderer.send('forward-message', 'reload-proxy', !newValue);
 | 
				
			||||||
				this.updateProxyOption();
 | 
									this.updateProxyOption();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -97,6 +97,15 @@ class PreferenceView extends BaseComponent {
 | 
				
			|||||||
		ipcRenderer.on('toggletray', (event, state) => {
 | 
							ipcRenderer.on('toggletray', (event, state) => {
 | 
				
			||||||
			this.handleToggle('tray-option', state);
 | 
								this.handleToggle('tray-option', state);
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							ipcRenderer.on('toggle-dnd', (event, state, newSettings) => {
 | 
				
			||||||
 | 
								this.handleToggle('show-notification-option', newSettings.showNotification);
 | 
				
			||||||
 | 
								this.handleToggle('silent-option', newSettings.silent);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if (process.platform === 'win32') {
 | 
				
			||||||
 | 
									this.handleToggle('flash-taskbar-option', newSettings.flashTaskbarOnMessage);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
'use strict';
 | 
					'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const BaseSection = require(__dirname + '/base-section.js');
 | 
					const BaseSection = require(__dirname + '/base-section.js');
 | 
				
			||||||
 | 
					const shell = require('electron').shell;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ShortcutsSection extends BaseSection {
 | 
					class ShortcutsSection extends BaseSection {
 | 
				
			||||||
	constructor(props) {
 | 
						constructor(props) {
 | 
				
			||||||
@@ -23,6 +24,10 @@ class ShortcutsSection extends BaseSection {
 | 
				
			|||||||
                  <tr>
 | 
					                  <tr>
 | 
				
			||||||
                    <td><kbd>${userOSKey}</kbd><kbd>K</kbd></td>
 | 
					                    <td><kbd>${userOSKey}</kbd><kbd>K</kbd></td>
 | 
				
			||||||
                    <td>Keyboard Shortcuts</td>
 | 
					                    <td>Keyboard Shortcuts</td>
 | 
				
			||||||
 | 
					                  </tr>
 | 
				
			||||||
 | 
														<tr>
 | 
				
			||||||
 | 
					                    <td><kbd>${userOSKey}</kbd> + <kbd>Shift</kbd> + <kbd>M</kbd></td>
 | 
				
			||||||
 | 
					                    <td>Toggle Do Not Disturb</td>
 | 
				
			||||||
                  </tr>
 | 
					                  </tr>
 | 
				
			||||||
                  <tr>
 | 
					                  <tr>
 | 
				
			||||||
                    <td><kbd>Shift</kbd><kbd>${userOSKey}</kbd><kbd>D</kbd></td>
 | 
					                    <td><kbd>Shift</kbd><kbd>${userOSKey}</kbd><kbd>D</kbd></td>
 | 
				
			||||||
@@ -155,6 +160,7 @@ class ShortcutsSection extends BaseSection {
 | 
				
			|||||||
                </table>
 | 
					                </table>
 | 
				
			||||||
                <div class="setting-control"></div>
 | 
					                <div class="setting-control"></div>
 | 
				
			||||||
              </div>
 | 
					              </div>
 | 
				
			||||||
 | 
					              <div class="settings-card tip"><b><i class="material-icons md-14">settings</i>Tip: </b>These desktop app shortcuts extend the Zulip webapp's <span id="open-hotkeys-link">keyboard shortcuts</span>.</div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
		`;
 | 
							`;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -174,6 +180,10 @@ class ShortcutsSection extends BaseSection {
 | 
				
			|||||||
                  <tr>
 | 
					                  <tr>
 | 
				
			||||||
                    <td><kbd>${userOSKey}</kbd> + <kbd>K</kbd></td>
 | 
					                    <td><kbd>${userOSKey}</kbd> + <kbd>K</kbd></td>
 | 
				
			||||||
                    <td>Keyboard Shortcuts</td>
 | 
					                    <td>Keyboard Shortcuts</td>
 | 
				
			||||||
 | 
					                  </tr>
 | 
				
			||||||
 | 
														<tr>
 | 
				
			||||||
 | 
					                    <td><kbd>${userOSKey}</kbd> + <kbd>Shift</kbd> + <kbd>M</kbd></td>
 | 
				
			||||||
 | 
					                    <td>Toggle Do Not Disturb</td>
 | 
				
			||||||
                  </tr>
 | 
					                  </tr>
 | 
				
			||||||
                  <tr>
 | 
					                  <tr>
 | 
				
			||||||
                    <td><kbd>${userOSKey}</kbd> + <kbd>L</kbd></td>
 | 
					                    <td><kbd>${userOSKey}</kbd> + <kbd>L</kbd></td>
 | 
				
			||||||
@@ -290,13 +300,22 @@ class ShortcutsSection extends BaseSection {
 | 
				
			|||||||
                </table>
 | 
					                </table>
 | 
				
			||||||
                <div class="setting-control"></div>
 | 
					                <div class="setting-control"></div>
 | 
				
			||||||
              </div>
 | 
					              </div>
 | 
				
			||||||
 | 
					              <div class="tip"><b><i class="material-icons md-14">lightbulb_outline</i>Tip: </b>These desktop app shortcuts extend the Zulip webapp's <span id="open-hotkeys-link">keyboard shortcuts</span>.</div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
		`;
 | 
							`;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						openHotkeysExternalLink() {
 | 
				
			||||||
 | 
							const link = 'https://zulipchat.com/help/keyboard-shortcuts';
 | 
				
			||||||
 | 
							const externalCreateNewOrgEl = document.getElementById('open-hotkeys-link');
 | 
				
			||||||
 | 
							externalCreateNewOrgEl.addEventListener('click', () => {
 | 
				
			||||||
 | 
								shell.openExternal(link);
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	init() {
 | 
						init() {
 | 
				
			||||||
		this.props.$root.innerHTML = (process.platform === 'darwin') ?
 | 
							this.props.$root.innerHTML = (process.platform === 'darwin') ?
 | 
				
			||||||
			this.templateMac() : this.templateWinLin();
 | 
								this.templateMac() : this.templateWinLin();
 | 
				
			||||||
 | 
							this.openHotkeysExternalLink();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
'use strict';
 | 
					'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const { ipcRenderer } = require('electron');
 | 
					const { ipcRenderer, shell } = require('electron');
 | 
				
			||||||
const SetupSpellChecker = require('./spellchecker');
 | 
					const SetupSpellChecker = require('./spellchecker');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const ConfigUtil = require(__dirname + '/utils/config-util.js');
 | 
					const ConfigUtil = require(__dirname + '/utils/config-util.js');
 | 
				
			||||||
@@ -71,6 +71,11 @@ document.addEventListener('DOMContentLoaded', () => {
 | 
				
			|||||||
			// prevent the message compose dialog from happening.
 | 
								// prevent the message compose dialog from happening.
 | 
				
			||||||
			e.stopPropagation();
 | 
								e.stopPropagation();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// Open image in the default browser if image preview is unavailable
 | 
				
			||||||
 | 
								if (!$img[0]) {
 | 
				
			||||||
 | 
									shell.openExternal(window.location.origin + url);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								// Open image in lightbox
 | 
				
			||||||
			lightbox.open($img);
 | 
								lightbox.open($img);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,12 @@
 | 
				
			|||||||
const { SpellCheckHandler, ContextMenuListener, ContextMenuBuilder } = require('electron-spellchecker');
 | 
					const { SpellCheckHandler, ContextMenuListener, ContextMenuBuilder } = require('electron-spellchecker');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const ConfigUtil = require(__dirname + '/utils/config-util.js');
 | 
					const ConfigUtil = require(__dirname + '/utils/config-util.js');
 | 
				
			||||||
 | 
					const Logger = require(__dirname + '/utils/logger-util.js');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const logger = new Logger({
 | 
				
			||||||
 | 
						file: 'errors.log',
 | 
				
			||||||
 | 
						timestamp: true
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SetupSpellChecker {
 | 
					class SetupSpellChecker {
 | 
				
			||||||
	init() {
 | 
						init() {
 | 
				
			||||||
@@ -16,7 +22,7 @@ class SetupSpellChecker {
 | 
				
			|||||||
		try {
 | 
							try {
 | 
				
			||||||
			this.SpellCheckHandler = new SpellCheckHandler();
 | 
								this.SpellCheckHandler = new SpellCheckHandler();
 | 
				
			||||||
		} catch (err) {
 | 
							} catch (err) {
 | 
				
			||||||
			console.log(err);
 | 
								logger.error(err);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -98,7 +98,7 @@ const renderNativeImage = function (arg) {
 | 
				
			|||||||
	return Promise.resolve()
 | 
						return Promise.resolve()
 | 
				
			||||||
		.then(() => renderCanvas(arg))
 | 
							.then(() => renderCanvas(arg))
 | 
				
			||||||
		.then(canvas => {
 | 
							.then(canvas => {
 | 
				
			||||||
			const pngData = nativeImage.createFromDataURL(canvas.toDataURL('image/png')).toPng();
 | 
								const pngData = nativeImage.createFromDataURL(canvas.toDataURL('image/png')).toPNG();
 | 
				
			||||||
			return Promise.resolve(nativeImage.createFromBuffer(pngData, config.pixelRatio));
 | 
								return Promise.resolve(nativeImage.createFromBuffer(pngData, config.pixelRatio));
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										86
									
								
								app/renderer/js/utils/certificate-util.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								app/renderer/js/utils/certificate-util.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,86 @@
 | 
				
			|||||||
 | 
					'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const { app, dialog } = require('electron').remote;
 | 
				
			||||||
 | 
					const fs = require('fs');
 | 
				
			||||||
 | 
					const path = require('path');
 | 
				
			||||||
 | 
					const JsonDB = require('node-json-db');
 | 
				
			||||||
 | 
					const Logger = require('./logger-util');
 | 
				
			||||||
 | 
					const { initSetUp } = require('./default-util');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					initSetUp();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const logger = new Logger({
 | 
				
			||||||
 | 
						file: `certificate-util.log`,
 | 
				
			||||||
 | 
						timestamp: true
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					let instance = null;
 | 
				
			||||||
 | 
					const certificatesDir = `${app.getPath('userData')}/certificates`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class CertificateUtil {
 | 
				
			||||||
 | 
						constructor() {
 | 
				
			||||||
 | 
							if (instance) {
 | 
				
			||||||
 | 
								return instance;
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								instance = this;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							this.reloadDB();
 | 
				
			||||||
 | 
							return instance;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						getCertificate(server, defaultValue = null) {
 | 
				
			||||||
 | 
							this.reloadDB();
 | 
				
			||||||
 | 
							const value = this.db.getData('/')[server];
 | 
				
			||||||
 | 
							if (value === undefined) {
 | 
				
			||||||
 | 
								return defaultValue;
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								return value;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						// Function to copy the certificate to userData folder
 | 
				
			||||||
 | 
						copyCertificate(server, location, fileName) {
 | 
				
			||||||
 | 
							let copied = false;
 | 
				
			||||||
 | 
							const filePath = `${certificatesDir}/${fileName}`;
 | 
				
			||||||
 | 
							try {
 | 
				
			||||||
 | 
								fs.copyFileSync(location, filePath);
 | 
				
			||||||
 | 
								copied = true;
 | 
				
			||||||
 | 
							} catch (err) {
 | 
				
			||||||
 | 
								dialog.showErrorBox(
 | 
				
			||||||
 | 
									'Error saving certificate',
 | 
				
			||||||
 | 
									'We encountered error while saving the certificate.'
 | 
				
			||||||
 | 
								);
 | 
				
			||||||
 | 
								logger.error('Error while copying the certificate to certificates folder.');
 | 
				
			||||||
 | 
								logger.error(err);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							return copied;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						setCertificate(server, fileName) {
 | 
				
			||||||
 | 
							const filePath = `${certificatesDir}/${fileName}`;
 | 
				
			||||||
 | 
							this.db.push(`/${server}`, filePath, true);
 | 
				
			||||||
 | 
							this.reloadDB();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						removeCertificate(server) {
 | 
				
			||||||
 | 
							this.db.delete(`/${server}`);
 | 
				
			||||||
 | 
							this.reloadDB();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						reloadDB() {
 | 
				
			||||||
 | 
							const settingsJsonPath = path.join(app.getPath('userData'), '/config/certificates.json');
 | 
				
			||||||
 | 
							try {
 | 
				
			||||||
 | 
								const file = fs.readFileSync(settingsJsonPath, 'utf8');
 | 
				
			||||||
 | 
								JSON.parse(file);
 | 
				
			||||||
 | 
							} catch (err) {
 | 
				
			||||||
 | 
								if (fs.existsSync(settingsJsonPath)) {
 | 
				
			||||||
 | 
									fs.unlinkSync(settingsJsonPath);
 | 
				
			||||||
 | 
									dialog.showErrorBox(
 | 
				
			||||||
 | 
										'Error saving settings',
 | 
				
			||||||
 | 
										'We encountered error while saving the certificate.'
 | 
				
			||||||
 | 
									);
 | 
				
			||||||
 | 
									logger.error('Error while JSON parsing certificates.json: ');
 | 
				
			||||||
 | 
									logger.error(err);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							this.db = new JsonDB(settingsJsonPath, true, true);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					module.exports = new CertificateUtil();
 | 
				
			||||||
@@ -48,6 +48,12 @@ class ConfigUtil {
 | 
				
			|||||||
			return value;
 | 
								return value;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						// This function returns whether a key exists in the configuration file (settings.json)
 | 
				
			||||||
 | 
						isConfigItemExists(key) {
 | 
				
			||||||
 | 
							this.reloadDB();
 | 
				
			||||||
 | 
							const value = this.db.getData('/')[key];
 | 
				
			||||||
 | 
							return (value !== undefined);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	setConfigItem(key, value) {
 | 
						setConfigItem(key, value) {
 | 
				
			||||||
		this.db.push(`/${key}`, value, true);
 | 
							this.db.push(`/${key}`, value, true);
 | 
				
			||||||
@@ -60,7 +66,7 @@ class ConfigUtil {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	reloadDB() {
 | 
						reloadDB() {
 | 
				
			||||||
		const settingsJsonPath = path.join(app.getPath('userData'), '/settings.json');
 | 
							const settingsJsonPath = path.join(app.getPath('userData'), '/config/settings.json');
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			const file = fs.readFileSync(settingsJsonPath, 'utf8');
 | 
								const file = fs.readFileSync(settingsJsonPath, 'utf8');
 | 
				
			||||||
			JSON.parse(file);
 | 
								JSON.parse(file);
 | 
				
			||||||
@@ -69,7 +75,7 @@ class ConfigUtil {
 | 
				
			|||||||
				fs.unlinkSync(settingsJsonPath);
 | 
									fs.unlinkSync(settingsJsonPath);
 | 
				
			||||||
				dialog.showErrorBox(
 | 
									dialog.showErrorBox(
 | 
				
			||||||
					'Error saving settings',
 | 
										'Error saving settings',
 | 
				
			||||||
					'We encountered error while saving current settings.'
 | 
										'We encountered an error while saving the settings.'
 | 
				
			||||||
				);
 | 
									);
 | 
				
			||||||
				logger.error('Error while JSON parsing settings.json: ');
 | 
									logger.error('Error while JSON parsing settings.json: ');
 | 
				
			||||||
				logger.error(err);
 | 
									logger.error(err);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,6 +10,8 @@ if (process.type === 'renderer') {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const zulipDir = app.getPath('userData');
 | 
					const zulipDir = app.getPath('userData');
 | 
				
			||||||
const logDir = `${zulipDir}/Logs/`;
 | 
					const logDir = `${zulipDir}/Logs/`;
 | 
				
			||||||
 | 
					const certificatesDir = `${zulipDir}/certificates/`;
 | 
				
			||||||
 | 
					const configDir = `${zulipDir}/config/`;
 | 
				
			||||||
const initSetUp = () => {
 | 
					const initSetUp = () => {
 | 
				
			||||||
	// if it is the first time the app is running
 | 
						// if it is the first time the app is running
 | 
				
			||||||
	// create zulip dir in userData folder to
 | 
						// create zulip dir in userData folder to
 | 
				
			||||||
@@ -22,6 +24,51 @@ const initSetUp = () => {
 | 
				
			|||||||
		if (!fs.existsSync(logDir)) {
 | 
							if (!fs.existsSync(logDir)) {
 | 
				
			||||||
			fs.mkdirSync(logDir);
 | 
								fs.mkdirSync(logDir);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (!fs.existsSync(certificatesDir)) {
 | 
				
			||||||
 | 
								fs.mkdirSync(certificatesDir);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Migrate config files from app data folder to config folder inside app
 | 
				
			||||||
 | 
							// data folder. This will be done once when a user updates to the new version.
 | 
				
			||||||
 | 
							if (!fs.existsSync(configDir)) {
 | 
				
			||||||
 | 
								fs.mkdirSync(configDir);
 | 
				
			||||||
 | 
								const domainJson = `${zulipDir}/domain.json`;
 | 
				
			||||||
 | 
								const certificatesJson = `${zulipDir}/certificates.json`;
 | 
				
			||||||
 | 
								const settingsJson = `${zulipDir}/settings.json`;
 | 
				
			||||||
 | 
								const updatesJson = `${zulipDir}/updates.json`;
 | 
				
			||||||
 | 
								const windowStateJson = `${zulipDir}/window-state.json`;
 | 
				
			||||||
 | 
								const configData = [
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										path: domainJson,
 | 
				
			||||||
 | 
										fileName: `domain.json`
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										path: certificatesJson,
 | 
				
			||||||
 | 
										fileName: `certificates.json`
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										path: settingsJson,
 | 
				
			||||||
 | 
										fileName: `settings.json`
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										path: updatesJson,
 | 
				
			||||||
 | 
										fileName: `updates.json`
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								];
 | 
				
			||||||
 | 
								configData.forEach(data => {
 | 
				
			||||||
 | 
									if (fs.existsSync(data.path)) {
 | 
				
			||||||
 | 
										fs.copyFileSync(data.path, configDir + data.fileName);
 | 
				
			||||||
 | 
										fs.unlinkSync(data.path);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								// window-state.json is only deleted not moved, as the electron-window-state
 | 
				
			||||||
 | 
								// package will recreate the file in the config folder.
 | 
				
			||||||
 | 
								if (fs.existsSync(windowStateJson)) {
 | 
				
			||||||
 | 
									fs.unlinkSync(windowStateJson);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		setupCompleted = true;
 | 
							setupCompleted = true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										41
									
								
								app/renderer/js/utils/dnd-util.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								app/renderer/js/utils/dnd-util.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,41 @@
 | 
				
			|||||||
 | 
					'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const ConfigUtil = require(__dirname + '/config-util.js');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function toggle() {
 | 
				
			||||||
 | 
						const dnd = !ConfigUtil.getConfigItem('dnd', false);
 | 
				
			||||||
 | 
						const dndSettingList = ['showNotification', 'silent'];
 | 
				
			||||||
 | 
						if (process.platform === 'win32') {
 | 
				
			||||||
 | 
							dndSettingList.push('flashTaskbarOnMessage');
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						let newSettings;
 | 
				
			||||||
 | 
						if (dnd) {
 | 
				
			||||||
 | 
							const oldSettings = {};
 | 
				
			||||||
 | 
							newSettings = {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Iterate through the dndSettingList.
 | 
				
			||||||
 | 
							for (const settingName of dndSettingList) {
 | 
				
			||||||
 | 
								// Store the current value of setting.
 | 
				
			||||||
 | 
								oldSettings[settingName] = ConfigUtil.getConfigItem(settingName);
 | 
				
			||||||
 | 
								// New value of setting.
 | 
				
			||||||
 | 
								newSettings[settingName] = (settingName === 'silent');
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Store old value in oldSettings.
 | 
				
			||||||
 | 
							ConfigUtil.setConfigItem('dndPreviousSettings', oldSettings);
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							newSettings = ConfigUtil.getConfigItem('dndPreviousSettings');
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for (const settingName of dndSettingList) {
 | 
				
			||||||
 | 
							ConfigUtil.setConfigItem(settingName, newSettings[settingName]);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ConfigUtil.setConfigItem('dnd', dnd);
 | 
				
			||||||
 | 
						return {dnd, newSettings};
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					module.exports = {
 | 
				
			||||||
 | 
						toggle
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
@@ -5,8 +5,12 @@ const fs = require('fs');
 | 
				
			|||||||
const path = require('path');
 | 
					const path = require('path');
 | 
				
			||||||
const JsonDB = require('node-json-db');
 | 
					const JsonDB = require('node-json-db');
 | 
				
			||||||
const request = require('request');
 | 
					const request = require('request');
 | 
				
			||||||
 | 
					const escape = require('escape-html');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const Logger = require('./logger-util');
 | 
					const Logger = require('./logger-util');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const CertificateUtil = require(__dirname + '/certificate-util.js');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const logger = new Logger({
 | 
					const logger = new Logger({
 | 
				
			||||||
	file: `domain-util.log`,
 | 
						file: `domain-util.log`,
 | 
				
			||||||
	timestamp: true
 | 
						timestamp: true
 | 
				
			||||||
@@ -104,7 +108,19 @@ class DomainUtil {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		domain = this.formatUrl(domain);
 | 
							domain = this.formatUrl(domain);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		const checkDomain = domain + '/static/audio/zulip.ogg';
 | 
							const certificate = CertificateUtil.getCertificate(encodeURIComponent(domain));
 | 
				
			||||||
 | 
							let certificateLocation = '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (certificate) {
 | 
				
			||||||
 | 
								// To handle case where certificate has been moved from the location in certificates.json
 | 
				
			||||||
 | 
								try {
 | 
				
			||||||
 | 
									certificateLocation = fs.readFileSync(certificate);
 | 
				
			||||||
 | 
								} catch (err) {
 | 
				
			||||||
 | 
									logger.warn('Error while trying to get certificate: ' + err);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							// If certificate for the domain exists add it as a ca key in the request's parameter else consider only domain as the parameter for request
 | 
				
			||||||
 | 
							const checkDomain = (certificateLocation) ? ({url: domain + '/static/audio/zulip.ogg', ca: certificateLocation}) : domain + '/static/audio/zulip.ogg';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		const serverConf = {
 | 
							const serverConf = {
 | 
				
			||||||
			icon: defaultIconUrl,
 | 
								icon: defaultIconUrl,
 | 
				
			||||||
@@ -114,21 +130,16 @@ class DomainUtil {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		return new Promise((resolve, reject) => {
 | 
							return new Promise((resolve, reject) => {
 | 
				
			||||||
			request(checkDomain, (error, response) => {
 | 
								request(checkDomain, (error, response) => {
 | 
				
			||||||
				const certsError =
 | 
					 | 
				
			||||||
					[
 | 
					 | 
				
			||||||
						'Error: self signed certificate',
 | 
					 | 
				
			||||||
						'Error: unable to verify the first certificate',
 | 
					 | 
				
			||||||
						'Error: unable to get local issuer certificate'
 | 
					 | 
				
			||||||
					];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				// If the domain contains following strings we just bypass the server
 | 
									// If the domain contains following strings we just bypass the server
 | 
				
			||||||
				const whitelistDomains = [
 | 
									const whitelistDomains = [
 | 
				
			||||||
					'zulipdev.org'
 | 
										'zulipdev.org'
 | 
				
			||||||
				];
 | 
									];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				// make sure that error is a error or string not undefined
 | 
									// make sure that error is an error or string not undefined
 | 
				
			||||||
				// so validation does not throw error.
 | 
									// so validation does not throw error.
 | 
				
			||||||
				error = error || '';
 | 
									error = error || '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									const certsError = error.toString().includes('certificate');
 | 
				
			||||||
				if (!error && response.statusCode < 400) {
 | 
									if (!error && response.statusCode < 400) {
 | 
				
			||||||
					// Correct
 | 
										// Correct
 | 
				
			||||||
					this.getServerSettings(domain).then(serverSettings => {
 | 
										this.getServerSettings(domain).then(serverSettings => {
 | 
				
			||||||
@@ -136,7 +147,7 @@ class DomainUtil {
 | 
				
			|||||||
					}, () => {
 | 
										}, () => {
 | 
				
			||||||
						resolve(serverConf);
 | 
											resolve(serverConf);
 | 
				
			||||||
					});
 | 
										});
 | 
				
			||||||
				} else if (domain.indexOf(whitelistDomains) >= 0 || certsError.indexOf(error.toString()) >= 0) {
 | 
									} else if (domain.indexOf(whitelistDomains) >= 0 || certsError) {
 | 
				
			||||||
					if (silent) {
 | 
										if (silent) {
 | 
				
			||||||
						this.getServerSettings(domain).then(serverSettings => {
 | 
											this.getServerSettings(domain).then(serverSettings => {
 | 
				
			||||||
							resolve(serverSettings);
 | 
												resolve(serverSettings);
 | 
				
			||||||
@@ -145,9 +156,10 @@ class DomainUtil {
 | 
				
			|||||||
						});
 | 
											});
 | 
				
			||||||
					} else {
 | 
										} else {
 | 
				
			||||||
						const certErrorMessage = `Do you trust certificate from ${domain}? \n ${error}`;
 | 
											const certErrorMessage = `Do you trust certificate from ${domain}? \n ${error}`;
 | 
				
			||||||
						const certErrorDetail = `The server you're connecting to is either someone impersonating the Zulip server you entered, or the server you're trying to connect to is configured in an insecure way.
 | 
											const certErrorDetail = `The organization you're connecting to is either someone impersonating the Zulip server you entered, or the server you're trying to connect to is configured in an insecure way.
 | 
				
			||||||
						\n Unless you have a good reason to believe otherwise, you should not proceed.
 | 
											\nIf you have a valid certificate please add it from Settings>Organizations and try to add the organization again.
 | 
				
			||||||
						\n You can click here if you'd like to proceed with the connection.`;
 | 
											\nUnless you have a good reason to believe otherwise, you should not proceed.
 | 
				
			||||||
 | 
											\nYou can click here if you'd like to proceed with the connection.`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						dialog.showMessageBox({
 | 
											dialog.showMessageBox({
 | 
				
			||||||
							type: 'warning',
 | 
												type: 'warning',
 | 
				
			||||||
@@ -169,7 +181,8 @@ class DomainUtil {
 | 
				
			|||||||
					}
 | 
										}
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					const invalidZulipServerError = `${domain} does not appear to be a valid Zulip server. Make sure that \
 | 
										const invalidZulipServerError = `${domain} does not appear to be a valid Zulip server. Make sure that \
 | 
				
			||||||
					\n(1) you can connect to that URL in a web browser and \n (2) if you need a proxy to connect to the Internet, that you've configured your proxy in the Network settings \n (3) its a zulip server`;
 | 
										\n (1) you can connect to that URL in a web browser and \n (2) if you need a proxy to connect to the Internet, that you've configured your proxy in the Network settings \n (3) its a zulip server \
 | 
				
			||||||
 | 
										\n (4) the server has a valid certificate, you can add custom certificates in Settings>Organizations`;
 | 
				
			||||||
					reject(invalidZulipServerError);
 | 
										reject(invalidZulipServerError);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
@@ -188,7 +201,7 @@ class DomainUtil {
 | 
				
			|||||||
							// Following check handles both the cases
 | 
												// Following check handles both the cases
 | 
				
			||||||
							icon: data.realm_icon.startsWith('/') ? data.realm_uri + data.realm_icon : data.realm_icon,
 | 
												icon: data.realm_icon.startsWith('/') ? data.realm_uri + data.realm_icon : data.realm_icon,
 | 
				
			||||||
							url: data.realm_uri,
 | 
												url: data.realm_uri,
 | 
				
			||||||
							alias: data.realm_name
 | 
												alias: escape(data.realm_name)
 | 
				
			||||||
						});
 | 
											});
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
@@ -206,18 +219,21 @@ class DomainUtil {
 | 
				
			|||||||
			try {
 | 
								try {
 | 
				
			||||||
				request(url).on('response', response => {
 | 
									request(url).on('response', response => {
 | 
				
			||||||
					response.on('error', err => {
 | 
										response.on('error', err => {
 | 
				
			||||||
						console.log(err);
 | 
											logger.log('Could not get server icon.');
 | 
				
			||||||
 | 
											logger.log(err);
 | 
				
			||||||
						resolve(defaultIconUrl);
 | 
											resolve(defaultIconUrl);
 | 
				
			||||||
					});
 | 
										});
 | 
				
			||||||
					response.pipe(file).on('finish', () => {
 | 
										response.pipe(file).on('finish', () => {
 | 
				
			||||||
						resolve(filePath);
 | 
											resolve(filePath);
 | 
				
			||||||
					});
 | 
										});
 | 
				
			||||||
				}).on('error', err => {
 | 
									}).on('error', err => {
 | 
				
			||||||
					console.log(err);
 | 
										logger.log('Could not get server icon.');
 | 
				
			||||||
 | 
										logger.log(err);
 | 
				
			||||||
					resolve(defaultIconUrl);
 | 
										resolve(defaultIconUrl);
 | 
				
			||||||
				});
 | 
									});
 | 
				
			||||||
			} catch (err) {
 | 
								} catch (err) {
 | 
				
			||||||
				console.log(err);
 | 
									logger.log('Could not get server icon.');
 | 
				
			||||||
 | 
									logger.log(err);
 | 
				
			||||||
				resolve(defaultIconUrl);
 | 
									resolve(defaultIconUrl);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
@@ -235,7 +251,7 @@ class DomainUtil {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	reloadDB() {
 | 
						reloadDB() {
 | 
				
			||||||
		const domainJsonPath = path.join(app.getPath('userData'), '/domain.json');
 | 
							const domainJsonPath = path.join(app.getPath('userData'), 'config/domain.json');
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			const file = fs.readFileSync(domainJsonPath, 'utf8');
 | 
								const file = fs.readFileSync(domainJsonPath, 'utf8');
 | 
				
			||||||
			JSON.parse(file);
 | 
								JSON.parse(file);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -52,7 +52,7 @@ class LinuxUpdateUtil {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	reloadDB() {
 | 
						reloadDB() {
 | 
				
			||||||
		const linuxUpdateJsonPath = path.join(app.getPath('userData'), '/updates.json');
 | 
							const linuxUpdateJsonPath = path.join(app.getPath('userData'), '/config/updates.json');
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			const file = fs.readFileSync(linuxUpdateJsonPath, 'utf8');
 | 
								const file = fs.readFileSync(linuxUpdateJsonPath, 'utf8');
 | 
				
			||||||
			JSON.parse(file);
 | 
								JSON.parse(file);
 | 
				
			||||||
@@ -61,7 +61,7 @@ class LinuxUpdateUtil {
 | 
				
			|||||||
				fs.unlinkSync(linuxUpdateJsonPath);
 | 
									fs.unlinkSync(linuxUpdateJsonPath);
 | 
				
			||||||
				dialog.showErrorBox(
 | 
									dialog.showErrorBox(
 | 
				
			||||||
					'Error saving update notifications.',
 | 
										'Error saving update notifications.',
 | 
				
			||||||
					'We encountered error while saving update notifications.'
 | 
										'We encountered an error while saving the update notifications.'
 | 
				
			||||||
				);
 | 
									);
 | 
				
			||||||
				logger.error('Error while JSON parsing updates.json: ');
 | 
									logger.error('Error while JSON parsing updates.json: ');
 | 
				
			||||||
				logger.error(err);
 | 
									logger.error(err);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										96
									
								
								app/renderer/js/utils/proxy-util.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										96
									
								
								app/renderer/js/utils/proxy-util.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,96 @@
 | 
				
			|||||||
 | 
					'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const ConfigUtil = require('./config-util.js');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					let instance = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class ProxyUtil {
 | 
				
			||||||
 | 
						constructor() {
 | 
				
			||||||
 | 
							if (instance) {
 | 
				
			||||||
 | 
								return instance;
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								instance = this;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return instance;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						resolveSystemProxy(mainWindow) {
 | 
				
			||||||
 | 
							const page = mainWindow.webContents;
 | 
				
			||||||
 | 
							const ses = page.session;
 | 
				
			||||||
 | 
							const resolveProxyUrl = 'www.google.com';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Check HTTP Proxy
 | 
				
			||||||
 | 
							const httpProxy = new Promise(resolve => {
 | 
				
			||||||
 | 
								ses.resolveProxy('http://' + resolveProxyUrl, proxy => {
 | 
				
			||||||
 | 
									let httpString = '';
 | 
				
			||||||
 | 
									if (proxy !== 'DIRECT') {
 | 
				
			||||||
 | 
										// in case of proxy HTTPS url:port, windows gives first word as HTTPS while linux gives PROXY
 | 
				
			||||||
 | 
										// for all other HTTP or direct url:port both uses PROXY
 | 
				
			||||||
 | 
										if (proxy.includes('PROXY') || proxy.includes('HTTPS')) {
 | 
				
			||||||
 | 
											httpString = 'http=' + proxy.split('PROXY')[1] + ';';
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									resolve(httpString);
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
							// Check HTTPS Proxy
 | 
				
			||||||
 | 
							const httpsProxy = new Promise(resolve => {
 | 
				
			||||||
 | 
								ses.resolveProxy('https://' + resolveProxyUrl, proxy => {
 | 
				
			||||||
 | 
									let httpsString = '';
 | 
				
			||||||
 | 
									if (proxy !== 'DIRECT' || proxy.includes('HTTPS')) {
 | 
				
			||||||
 | 
										// in case of proxy HTTPS url:port, windows gives first word as HTTPS while linux gives PROXY
 | 
				
			||||||
 | 
										// for all other HTTP or direct url:port both uses PROXY
 | 
				
			||||||
 | 
										if (proxy.includes('PROXY' || proxy.includes('HTTPS'))) {
 | 
				
			||||||
 | 
											httpsString += 'https=' + proxy.split('PROXY')[1] + ';';
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									resolve(httpsString);
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Check FTP Proxy
 | 
				
			||||||
 | 
							const ftpProxy = new Promise(resolve => {
 | 
				
			||||||
 | 
								ses.resolveProxy('ftp://' + resolveProxyUrl, proxy => {
 | 
				
			||||||
 | 
									let ftpString = '';
 | 
				
			||||||
 | 
									if (proxy !== 'DIRECT') {
 | 
				
			||||||
 | 
										if (proxy.includes('PROXY')) {
 | 
				
			||||||
 | 
											ftpString += 'ftp=' + proxy.split('PROXY')[1] + ';';
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									resolve(ftpString);
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Check SOCKS Proxy
 | 
				
			||||||
 | 
							const socksProxy = new Promise(resolve => {
 | 
				
			||||||
 | 
								ses.resolveProxy('socks4://' + resolveProxyUrl, proxy => {
 | 
				
			||||||
 | 
									let socksString = '';
 | 
				
			||||||
 | 
									if (proxy !== 'DIRECT') {
 | 
				
			||||||
 | 
										if (proxy.includes('SOCKS5')) {
 | 
				
			||||||
 | 
											socksString += 'socks=' + proxy.split('SOCKS5')[1] + ';';
 | 
				
			||||||
 | 
										} else if (proxy.includes('SOCKS4')) {
 | 
				
			||||||
 | 
											socksString += 'socks=' + proxy.split('SOCKS4')[1] + ';';
 | 
				
			||||||
 | 
										} else if (proxy.includes('PROXY')) {
 | 
				
			||||||
 | 
											socksString += 'socks=' + proxy.split('PROXY')[1] + ';';
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									resolve(socksString);
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							Promise.all([httpProxy, httpsProxy, ftpProxy, socksProxy]).then(values => {
 | 
				
			||||||
 | 
								let proxyString = '';
 | 
				
			||||||
 | 
								values.forEach(proxy => {
 | 
				
			||||||
 | 
									proxyString += proxy;
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								ConfigUtil.setConfigItem('systemProxyRules', proxyString);
 | 
				
			||||||
 | 
								const useSystemProxy = ConfigUtil.getConfigItem('useSystemProxy');
 | 
				
			||||||
 | 
								if (useSystemProxy) {
 | 
				
			||||||
 | 
									ConfigUtil.setConfigItem('proxyRules', proxyString);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					module.exports = new ProxyUtil();
 | 
				
			||||||
@@ -1,4 +1,10 @@
 | 
				
			|||||||
const isOnline = require('is-online');
 | 
					const isOnline = require('is-online');
 | 
				
			||||||
 | 
					const Logger = require('./logger-util');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const logger = new Logger({
 | 
				
			||||||
 | 
						file: `domain-util.log`,
 | 
				
			||||||
 | 
						timestamp: true
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ReconnectUtil {
 | 
					class ReconnectUtil {
 | 
				
			||||||
	constructor(serverManagerView) {
 | 
						constructor(serverManagerView) {
 | 
				
			||||||
@@ -31,11 +37,11 @@ class ReconnectUtil {
 | 
				
			|||||||
							if (!this.alreadyReloaded) {
 | 
												if (!this.alreadyReloaded) {
 | 
				
			||||||
								this.serverManagerView.reloadView();
 | 
													this.serverManagerView.reloadView();
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
							console.log('You\'re back online.');
 | 
												logger.log('You\'re back online.');
 | 
				
			||||||
							return resolve(true);
 | 
												return resolve(true);
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						console.log('There is no internet connection, try checking network cables, modem and router.');
 | 
											logger.log('There is no internet connection, try checking network cables, modem and router.');
 | 
				
			||||||
						const errMsgHolder = document.querySelector('#description');
 | 
											const errMsgHolder = document.querySelector('#description');
 | 
				
			||||||
						if (errMsgHolder) {
 | 
											if (errMsgHolder) {
 | 
				
			||||||
							errMsgHolder.innerHTML = `
 | 
												errMsgHolder.innerHTML = `
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,6 +24,10 @@
 | 
				
			|||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div id="actions-container">
 | 
					    <div id="actions-container">
 | 
				
			||||||
 | 
					      <div class="action-button" id="dnd-action">
 | 
				
			||||||
 | 
					        <i class="material-icons md-48">notifications</i>
 | 
				
			||||||
 | 
					        <span id="dnd-tooltip" style="display:none">Do Not Disturb</span>
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
      <div class="action-button" id="reload-action">
 | 
					      <div class="action-button" id="reload-action">
 | 
				
			||||||
        <i class="material-icons md-48">refresh</i>
 | 
					        <i class="material-icons md-48">refresh</i>
 | 
				
			||||||
        <span id="reload-tooltip" style="display:none">Reload</span>
 | 
					        <span id="reload-tooltip" style="display:none">Reload</span>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,7 @@ cache:
 | 
				
			|||||||
  - node_modules
 | 
					  - node_modules
 | 
				
			||||||
 | 
					
 | 
				
			||||||
install:
 | 
					install:
 | 
				
			||||||
  - ps: Install-Product node 6 x64
 | 
					  - ps: Install-Product node 8 x64
 | 
				
			||||||
  - git reset --hard HEAD
 | 
					  - git reset --hard HEAD
 | 
				
			||||||
  - npm install npm -g
 | 
					  - npm install npm -g
 | 
				
			||||||
  - node --version
 | 
					  - node --version
 | 
				
			||||||
@@ -21,4 +21,4 @@ build: off
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
test_script:
 | 
					test_script:
 | 
				
			||||||
  - npm run test
 | 
					  - npm run test
 | 
				
			||||||
  - npm run test-e2e
 | 
					  # - npm run test-e2e
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								build/appdmg.png
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								build/appdmg.png
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 12 KiB  | 
							
								
								
									
										665
									
								
								changelog.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										665
									
								
								changelog.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,665 @@
 | 
				
			|||||||
 | 
					# Version History
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					All notable changes to the Zulip desktop app are documented in this file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v2.3.2 --2018-05-28
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This is a quick release since we recently updated the certificate for code signing the app and we want to make sure the previous versions of the app get auto-updates without any conflicts.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v2.3.1 --2018-05-23
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Add a new setting to disable auto-updates
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Add a menu item to check for updates manually
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Other minor improvements
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fix app not rendering colors properly
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					*  **Security fix** - Do proper HTML escaping for server data to avoid XSS attacks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fix loading indicator when server is loaded
 | 
				
			||||||
 | 
					* Other minor fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Updated dependencies**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					electron - `v2.0.1`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					electron-builder - `v20.13.4`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					electron-updater - `v2.21.10`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v2.2.0-beta --2018-05-08
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added do not disturb feature
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* New DMG installer image
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Minor improvements
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fix download functionality of file attachment links
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fix tray icon not showing unread counts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Updated dependencies**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					electron - `v2.0.0`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					electron-builder - `v2.21.10`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					electron-updater - `v2.21.8`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v2.0.0 -- 2018-04-20
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					*  [Snap](https://snapcraft.io/zulip) support for Linux
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Add an option to download the file attachments instead of opening it in the browser
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Open image link in webapp lightbox
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Add scrollbar for list of organizations on overflow
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Better report issue UX
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Add F5 shortcut for reloading the app
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Responsive UI for connected orgs in smaller window sizes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Minor improvements
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Remove unused shortcuts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Update toggle sidebar shortcut to CMD/CTRL+SHIFT+S
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Warning dialog box for Reset App Settings
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fix reinstall script for working across all platforms
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Other minor fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Updated dependencies**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Update electron-builder to `v20.8.1`
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.9.0 --2018-03-23
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Major UI changes in the add new server and setting page
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Some users wanted to change the look of the Zulip. Now you have the power. Feel free to add your own CSS using the all-new setting option **Add Custom CSS**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added i18n locale helper script. Internalization is coming in the next release
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added **What's new** in `help` submenu so that you can see all the latest changes in the app
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Other small improvements
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Add Zulip binary link to the bin. It was a regression we missed somehow. You can now start the app using `zulip` from a terminal [Linux]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fix app settings overriding issue. This bug was unnoticed from `v1.4.0`. The bug was overriding the app settings which was pretty bad. Don't worry this works as expected now
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Prevent drag and drop events to avoid few security risks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Do not allow running insecure contents in the app
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* The ugly white flickering in the webview is now fixed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fix position of left-sidebar on toggle
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fix actions tooltip not visible on hover
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Other small fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Updated dependencies**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* electron - `v1.8.4`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Spectron - `v3.8.0`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.8.2 --2018-02-27
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Add bots mention support to reply option
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Show a notification when a new update available [Linux]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Add back button in left-sidebar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Add a Loading indication for new server button
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Improve help menu
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Add menu-item to reveal app logs in file manager
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Setting page and left-sidebar UI improvements
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Other minor improvments
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fix broken last active tab
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fix Zoom In shortcut
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Check whether the internet is working before reloading
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* New organization link overlapping existing servers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Disable electron-connect when it's run from npm start
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Do not auto-reload app when the system comes back from sleep
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Only toggle the setting state if the element is present
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Other minor fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Updated dependencies**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* electron - `v1.8.2`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.8.1 --2018-01-19
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Reply from notifications [macOS]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Add a setting option to start the app in the background
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* 32-bit Debian installer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* 32-bit AppImage installer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Automatically add apt-repo and GPG public keys on installing Debian file [Linux]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Remove app data, config files etc on uninstalling Debian installer [Linux]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Add logger utility for debugging that makes easier to sharing the apps
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Handle corrupted config files
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Reload full app on system hibernation
 | 
				
			||||||
 | 
					* Load default icon if organization icon is not available
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Focus app when a notification is triggered
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Reflect changes in the preference page (#362)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Set the default value of flash taskbar setting [Windows]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Rename Zoom In keyboard shortcut
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fix checkDomain, so it checks all error codes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Disable hardware acceleration to decrease the load on GPU
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Minor bug fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Updated dependencies**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* electron - `v1.7.10`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* electron-builder - `v19.53.6`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* electron-updater - `v2.18.2`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.7.0 --2017-11-24
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Updated to Electron `v1.6.15`, electron-builder `v19.46.4`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Improved setting page for new users
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* On the developer side, we have added few tests to make sure app doesn't fail
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Minor improvements
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### 1.6.0-beta --2017-11-16
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added setting option to enable/disable spellcheck
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added setting option to control Windows taskbar flashing [Windows]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Auto-updates for Linux [AppImage]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Better tray icons for retina display
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Reset app settings from Menu item
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Show detailed error message on invalid Zulip server
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fixed a bug which was caused by app's shortcuts. From now on our shortcuts won't hijack other apps shortcuts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Removed [electron-localshortcut](https://github.com/parro-it/electron-localshortcut) completely. Now we only depends on menu accelerators for keyboard shortcuts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Handle certificate issue properly
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Other minor fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.5.0 --2017-10-11
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added an option to clear app data
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added an option to show/hide desktop notifications
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Redesigned setting page
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Red dot over dock icon for PM [macOS]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Show server-info on hovering the server icon
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fetch correct organization icon from server_settings API
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Minor improvements
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.4.0 --2017-09-04
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added proxy support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added setting option for badges
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Start app at login setting option
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added app category for Linux
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Minor improvements in settings page
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* apt-repo on bintray for linux - [here](https://bintray.com/zulip/debian/zulip-elec)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fixed auto-updates
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Better warning message on certificate error
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Don't allow duplicate servers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### 1.3.0-beta -- 2017-08-09
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added back/forward option under `History` submenu
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added taskbar overlay icon [Windows]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added `Window` submenu by which users can switch to other servers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added flashing taskbar icon on incoming message [Windows]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Option to hide the left sidebar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Staged rollouts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Minor style improvements
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Handle focus event properly
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Open external links in default browser
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Allow user to change installation directory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fixed server-icon path error [Windows]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fixed server validation error
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fetch server details from Zulip api
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added tooltip in left sidebar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added publisher name in windows installer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Updated dependencies**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* electron - `v1.6.11`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* spellchecker - `v1.2.0`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* electron-builder - `v19.9.1`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.2.0-beta -- 2017-07-12
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added new setting page
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Setting for beta-updates. You can opt in for beta updates via selecting it from setting page
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added Keyboard shortcuts to switch between multiple servers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Desktop notifications support on Windows
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Unregister keyboard shortcuts on windows close
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Show warning dialog while deleting server
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Allow server which is signed by root cert
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Other minor bug fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.1.0-beta --2017-06-23
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* New network error page. App will auto-reload once the network comes back
 | 
				
			||||||
 | 
					* Quit shortcut - CTRL+Q [Windows]
 | 
				
			||||||
 | 
					* Improved preferences
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fixed power-monitor module error
 | 
				
			||||||
 | 
					* Fixed code signing error [macOS]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v1.0.0-beta --2017-06-21
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Sign in to multiple teams
 | 
				
			||||||
 | 
					* Windows 7 desktop notification support
 | 
				
			||||||
 | 
					* Show badge count for each Zulip server
 | 
				
			||||||
 | 
					* Toggle window on clicking tray icon [Windows]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Windows installer is properly code signed using [DigiCert](https://www.digicert.com/) certificate. You may get a warning regarding the certificate, please make it false positive
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Close/hide app properly
 | 
				
			||||||
 | 
					* Keep app running in background on clicking X
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v0.5.10 --2017-05-12
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added self-signed server support
 | 
				
			||||||
 | 
					* Unread message counts in tray icon
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v0.5.9 --2017-04-12
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Properly signed app for macOS
 | 
				
			||||||
 | 
					* Toggle tray icon
 | 
				
			||||||
 | 
					* Better error handling when no internet connenction
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fixed permission issue on windows
 | 
				
			||||||
 | 
					* Fixed wrong keyboard shortcuts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v0.5.8 --2017-02-13
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhacements**:
 | 
				
			||||||
 | 
					Smaller Windows installer size
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v0.5.7 --2017-02-08
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Minor improvements
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v0.5.6 --2017-02-07
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhacements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Using NSIS instead of [Squirrel.Windows](https://github.com/Squirrel/Squirrel.Windows) on Windows
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Autoupdates: now using [electron-updater](https://www.npmjs.com/package/electron-updater)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Removed nuts dependency
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Windows installer error
 | 
				
			||||||
 | 
					- Compile and build error in native node modules + spellchecker [Windows]
 | 
				
			||||||
 | 
					- Missing icon on installing [Windows]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v0.5.4 --2017-01-09
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					- Fixed :
 | 
				
			||||||
 | 
						- Auto-updates
 | 
				
			||||||
 | 
						- Spellchecker
 | 
				
			||||||
 | 
						- Zooming functionality
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Removed unused node modules
 | 
				
			||||||
 | 
					- Using stable version for node modules
 | 
				
			||||||
 | 
					- Added icon for AppImage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v0.5.3 --2016-12-24
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					- 🎉 Added automatic update support on Windows
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Fixed  javascript error when electron has been left running and try to right-click
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Fixed error - Unregister Spellchecker while window is closed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Fixed - Keyboard shortcuts not getting unregistered
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Minor UI Changes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v0.5.2 --2016-12-13
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhancements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- ⚡️ Added automatic app updates for macOS
 | 
				
			||||||
 | 
					- Added windows installer for 32 bit machine
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Better tray icons
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					- Blurry Unity icon fixed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v0.5.1 --2016-11-23
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhacements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Added Spellchecker support with correct spell suggestions
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Added Code-Signing on MAC
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Added Win/linux/Mac installers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Added Continuous Integration on travis and appveyor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Open internal links in app only and external in default browser
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Better icons
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Electron version updated to `v1.4.7`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Using two package.json structure
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Node integration disabled in main window due to jquery error
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Now using electron-builder for packaging instead of electron-packager
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Removed electron-context-menu and simple-spellchecker dependency
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Fixes**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Better error handling when user enters wrong zulip server
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Fixed close Zulip window JavaScript error
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Fixed opening image in default browser
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Fixed native notifications issue on linux
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### v0.0.1-alpha -- 2016-08-31
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Enhacements**:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Added DMG installer for macOS
 | 
				
			||||||
							
								
								
									
										8916
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										8916
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										31
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								package.json
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "zulip",
 | 
					  "name": "zulip",
 | 
				
			||||||
  "productName": "Zulip",
 | 
					  "productName": "Zulip",
 | 
				
			||||||
  "version": "2.0.0",
 | 
					  "version": "2.3.2",
 | 
				
			||||||
  "main": "./app/main",
 | 
					  "main": "./app/main",
 | 
				
			||||||
  "description": "Zulip Desktop App",
 | 
					  "description": "Zulip Desktop App",
 | 
				
			||||||
  "license": "Apache-2.0",
 | 
					  "license": "Apache-2.0",
 | 
				
			||||||
@@ -46,7 +46,8 @@
 | 
				
			|||||||
    ],
 | 
					    ],
 | 
				
			||||||
    "copyright": "©2017 Kandra Labs, Inc.",
 | 
					    "copyright": "©2017 Kandra Labs, Inc.",
 | 
				
			||||||
    "mac": {
 | 
					    "mac": {
 | 
				
			||||||
      "category": "public.app-category.productivity"
 | 
					      "category": "public.app-category.productivity",
 | 
				
			||||||
 | 
					      "artifactName": "${productName}-${version}-${arch}.${ext}"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "linux": {
 | 
					    "linux": {
 | 
				
			||||||
      "category": "Chat;GNOME;GTK;Network;InstantMessaging",
 | 
					      "category": "Chat;GNOME;GTK;Network;InstantMessaging",
 | 
				
			||||||
@@ -58,7 +59,8 @@
 | 
				
			|||||||
        "AppImage",
 | 
					        "AppImage",
 | 
				
			||||||
        "snap"
 | 
					        "snap"
 | 
				
			||||||
      ],
 | 
					      ],
 | 
				
			||||||
      "maintainer": "Akash Nimare <svnitakash@gmail.com>"
 | 
					      "maintainer": "Akash Nimare <svnitakash@gmail.com>",
 | 
				
			||||||
 | 
					      "artifactName": "${productName}-${version}-${arch}.${ext}"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "deb": {
 | 
					    "deb": {
 | 
				
			||||||
      "synopsis": "Zulip Desktop App",
 | 
					      "synopsis": "Zulip Desktop App",
 | 
				
			||||||
@@ -71,20 +73,24 @@
 | 
				
			|||||||
    "dmg": {
 | 
					    "dmg": {
 | 
				
			||||||
      "background": "build/appdmg.png",
 | 
					      "background": "build/appdmg.png",
 | 
				
			||||||
      "icon": "build/icon.icns",
 | 
					      "icon": "build/icon.icns",
 | 
				
			||||||
      "iconSize": 128,
 | 
					      "iconSize": 100,
 | 
				
			||||||
      "contents": [
 | 
					      "contents": [
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          "x": 380,
 | 
					          "x": 380,
 | 
				
			||||||
          "y": 240,
 | 
					          "y": 280,
 | 
				
			||||||
          "type": "link",
 | 
					          "type": "link",
 | 
				
			||||||
          "path": "/Applications"
 | 
					          "path": "/Applications"
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          "x": 122,
 | 
					          "x": 110,
 | 
				
			||||||
          "y": 240,
 | 
					          "y": 280,
 | 
				
			||||||
          "type": "file"
 | 
					          "type": "file"
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      ]
 | 
					      ],
 | 
				
			||||||
 | 
					      "window": {
 | 
				
			||||||
 | 
					        "width": 500,
 | 
				
			||||||
 | 
					        "height": 500
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "win": {
 | 
					    "win": {
 | 
				
			||||||
      "target": [
 | 
					      "target": [
 | 
				
			||||||
@@ -117,12 +123,12 @@
 | 
				
			|||||||
    "assert": "1.4.1",
 | 
					    "assert": "1.4.1",
 | 
				
			||||||
    "cp-file": "^5.0.0",
 | 
					    "cp-file": "^5.0.0",
 | 
				
			||||||
    "devtron": "1.4.0",
 | 
					    "devtron": "1.4.0",
 | 
				
			||||||
    "electron": "1.8.4",
 | 
					    "electron": "2.0.1",
 | 
				
			||||||
    "electron-builder": "20.8.1",
 | 
					    "electron-builder": "20.19.1",
 | 
				
			||||||
    "electron-connect": "0.6.2",
 | 
					    "electron-connect": "0.6.2",
 | 
				
			||||||
    "electron-debug": "1.4.0",
 | 
					    "electron-debug": "1.4.0",
 | 
				
			||||||
    "google-translate-api": "2.3.0",
 | 
					    "google-translate-api": "2.3.0",
 | 
				
			||||||
    "gulp": "3.9.1",
 | 
					    "gulp": "^4.0.0",
 | 
				
			||||||
    "gulp-tape": "0.0.9",
 | 
					    "gulp-tape": "0.0.9",
 | 
				
			||||||
    "is-ci": "^1.0.10",
 | 
					    "is-ci": "^1.0.10",
 | 
				
			||||||
    "nodemon": "^1.14.11",
 | 
					    "nodemon": "^1.14.11",
 | 
				
			||||||
@@ -175,5 +181,8 @@
 | 
				
			|||||||
      "browser",
 | 
					      "browser",
 | 
				
			||||||
      "mocha"
 | 
					      "mocha"
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  "dependencies": {
 | 
				
			||||||
 | 
					    "adm-zip": "^0.4.11"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,6 +15,6 @@ fi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
npm run test
 | 
					npm run test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
 | 
					# if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
 | 
				
			||||||
    npm run test-e2e
 | 
					#     npm run test-e2e
 | 
				
			||||||
fi
 | 
					# fi
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								snap/gui/icon.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								snap/gui/icon.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 2.6 KiB  | 
@@ -1,10 +1,10 @@
 | 
				
			|||||||
name: zulip
 | 
					name: zulip
 | 
				
			||||||
version: 1.8.2
 | 
					version: 2.0.0
 | 
				
			||||||
summary: Zulip
 | 
					summary: Zulip Desktop Client for Linux
 | 
				
			||||||
description: Zulip Desktop Client for Linux
 | 
					description: Zulip combines the immediacy of Slack with an email threading model. With Zulip, you can catch up on important conversations while ignoring irrelevant ones.
 | 
				
			||||||
confinement: strict
 | 
					confinement: strict
 | 
				
			||||||
grade: stable
 | 
					grade: stable
 | 
				
			||||||
icon: build/icon.png
 | 
					icon: snap/gui/icon.png
 | 
				
			||||||
apps:
 | 
					apps:
 | 
				
			||||||
  zulip:
 | 
					  zulip:
 | 
				
			||||||
    command: env TMPDIR=$XDG_RUNTIME_DIR desktop-launch $SNAP/zulip
 | 
					    command: env TMPDIR=$XDG_RUNTIME_DIR desktop-launch $SNAP/zulip
 | 
				
			||||||
@@ -32,6 +32,6 @@ parts:
 | 
				
			|||||||
      - libpulse0
 | 
					      - libpulse0
 | 
				
			||||||
      - libxss1
 | 
					      - libxss1
 | 
				
			||||||
      - libxtst6
 | 
					      - libxtst6
 | 
				
			||||||
    source: ../dist/linux-unpacked
 | 
					    source: dist/linux-unpacked
 | 
				
			||||||
    after:
 | 
					    after:
 | 
				
			||||||
      - desktop-gtk2
 | 
					      - desktop-gtk2
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user