Merge tag 'v1.14.1-beta.1'

pull/749/head
Scott Nonnenberg 7 years ago
commit 31284fff26

@ -6,6 +6,7 @@ const config = url.parse(window.location.toString(), true).query;
const { locale } = config; const { locale } = config;
const localeMessages = ipcRenderer.sendSync('locale-data'); const localeMessages = ipcRenderer.sendSync('locale-data');
window.theme = config.theme;
window.i18n = i18n.setup(locale, localeMessages); window.i18n = i18n.setup(locale, localeMessages);
// got.js appears to need this to successfully submit debug logs to the cloud // got.js appears to need this to successfully submit debug logs to the cloud

@ -134,7 +134,7 @@
}, },
getHideMenuBar: () => storage.get('hide-menu-bar'), getHideMenuBar: () => storage.get('hide-menu-bar'),
setHideMenuBar: value => { setHideMenuBar: value => {
storage.get('hide-menu-bar', value); storage.put('hide-menu-bar', value);
window.setAutoHideMenuBar(value); window.setAutoHideMenuBar(value);
window.setMenuBarVisibility(!value); window.setMenuBarVisibility(!value);
}, },
@ -142,7 +142,7 @@
getNotificationSetting: () => getNotificationSetting: () =>
storage.get('notification-setting', 'message'), storage.get('notification-setting', 'message'),
setNotificationSetting: value => setNotificationSetting: value =>
storage.get('notification-setting', value), storage.put('notification-setting', value),
getAudioNotification: () => storage.get('audio-notification'), getAudioNotification: () => storage.get('audio-notification'),
setAudioNotification: value => storage.put('audio-notification', value), setAudioNotification: value => storage.put('audio-notification', value),
@ -819,6 +819,7 @@
console.log('background onError:', Errors.toLogFormat(error)); console.log('background onError:', Errors.toLogFormat(error));
if ( if (
error &&
error.name === 'HTTPError' && error.name === 'HTTPError' &&
(error.code === 401 || error.code === 403) (error.code === 401 || error.code === 403)
) { ) {
@ -847,7 +848,7 @@
return; return;
} }
if (error.name === 'HTTPError' && error.code === -1) { if (error && error.name === 'HTTPError' && error.code === -1) {
// Failed to connect to server // Failed to connect to server
if (navigator.onLine) { if (navigator.onLine) {
console.log('retrying in 1 minute'); console.log('retrying in 1 minute');
@ -859,7 +860,7 @@
} }
if (ev.proto) { if (ev.proto) {
if (error.name === 'MessageCounterError') { if (error && error.name === 'MessageCounterError') {
if (ev.confirm) { if (ev.confirm) {
ev.confirm(); ev.confirm();
} }
@ -870,7 +871,7 @@
const envelope = ev.proto; const envelope = ev.proto;
const message = initIncomingMessage(envelope); const message = initIncomingMessage(envelope);
await message.saveErrors(error); await message.saveErrors(error || new Error('Error was null'));
const id = message.get('conversationId'); const id = message.get('conversationId');
const conversation = await ConversationController.getOrCreateAndWait( const conversation = await ConversationController.getOrCreateAndWait(
id, id,

@ -5,6 +5,7 @@ $(document).on('keyup', function(e) {
}); });
const $body = $(document.body); const $body = $(document.body);
$body.addClass(window.theme);
// got.js appears to need this to successfully submit debug logs to the cloud // got.js appears to need this to successfully submit debug logs to the cloud
window.setImmediate = window.nodeSetImmediate; window.setImmediate = window.nodeSetImmediate;

@ -5,6 +5,7 @@ $(document).on('keyup', function(e) {
}); });
const $body = $(document.body); const $body = $(document.body);
$body.addClass(window.theme);
window.view = new Whisper.ConfirmationDialogView({ window.view = new Whisper.ConfirmationDialogView({
message: i18n('audioPermissionNeeded'), message: i18n('audioPermissionNeeded'),

@ -5,6 +5,7 @@ $(document).on('keyup', function(e) {
}); });
const $body = $(document.body); const $body = $(document.body);
$body.addClass(window.theme);
const getInitialData = async () => ({ const getInitialData = async () => ({
deviceName: await window.getDeviceName(), deviceName: await window.getDeviceName(),

@ -101,7 +101,9 @@
let timerMessage; let timerMessage;
const timerUpdate = this.model.get('expirationTimerUpdate'); const timerUpdate = this.model.get('expirationTimerUpdate');
const prettySeconds = Whisper.ExpirationTimerOptions.getName(seconds); const prettySeconds = Whisper.ExpirationTimerOptions.getName(
seconds || 0
);
if ( if (
timerUpdate && timerUpdate &&

@ -1,5 +1,6 @@
/* global i18n: false */ /* global i18n: false */
/* global Whisper: false */ /* global Whisper: false */
/* global $: false */
/* eslint-disable no-new */ /* eslint-disable no-new */
@ -82,7 +83,14 @@
el: this.$('.theme-settings'), el: this.$('.theme-settings'),
name: 'theme-setting', name: 'theme-setting',
value: window.initialData.themeSetting, value: window.initialData.themeSetting,
setFn: window.setThemeSetting, setFn: theme => {
$(document.body)
.removeClass('android')
.removeClass('android-dark')
.removeClass('ios')
.addClass(theme);
window.setThemeSetting(theme);
},
}); });
if (Settings.isAudioNotificationSupported()) { if (Settings.isAudioNotificationSupported()) {
new CheckboxView({ new CheckboxView({

@ -503,7 +503,7 @@ MessageReceiver.prototype.extend({
.catch(error => { .catch(error => {
let errorToThrow = error; let errorToThrow = error;
if (error.message === 'Unknown identity key') { if (error && error.message === 'Unknown identity key') {
// create an error that the UI will pick up and ask the // create an error that the UI will pick up and ask the
// user if they want to re-negotiate // user if they want to re-negotiate
const buffer = dcodeIO.ByteBuffer.wrap(ciphertext); const buffer = dcodeIO.ByteBuffer.wrap(ciphertext);

@ -115,7 +115,7 @@ const loadLocale = require('./app/locale').load;
let logger; let logger;
let locale; let locale;
function prepareURL(pathSegments) { function prepareURL(pathSegments, moreKeys) {
return url.format({ return url.format({
pathname: path.join.apply(null, pathSegments), pathname: path.join.apply(null, pathSegments),
protocol: 'file:', protocol: 'file:',
@ -134,6 +134,7 @@ function prepareURL(pathSegments) {
appInstance: process.env.NODE_APP_INSTANCE, appInstance: process.env.NODE_APP_INSTANCE,
proxyUrl: process.env.HTTPS_PROXY || process.env.https_proxy, proxyUrl: process.env.HTTPS_PROXY || process.env.https_proxy,
importMode: importMode ? true : undefined, // for stringify() importMode: importMode ? true : undefined, // for stringify()
...moreKeys,
}, },
}); });
} }
@ -428,7 +429,7 @@ function showAbout() {
} }
let settingsWindow; let settingsWindow;
function showSettingsWindow() { async function showSettingsWindow() {
if (settingsWindow) { if (settingsWindow) {
settingsWindow.show(); settingsWindow.show();
return; return;
@ -437,6 +438,7 @@ function showSettingsWindow() {
return; return;
} }
const theme = await pify(getDataFromMainWindow)('theme-setting');
const size = mainWindow.getSize(); const size = mainWindow.getSize();
const options = { const options = {
width: Math.min(500, size[0]), width: Math.min(500, size[0]),
@ -461,7 +463,7 @@ function showSettingsWindow() {
captureClicks(settingsWindow); captureClicks(settingsWindow);
settingsWindow.loadURL(prepareURL([__dirname, 'settings.html'])); settingsWindow.loadURL(prepareURL([__dirname, 'settings.html'], { theme }));
settingsWindow.on('closed', () => { settingsWindow.on('closed', () => {
removeDarkOverlay(); removeDarkOverlay();
@ -475,12 +477,13 @@ function showSettingsWindow() {
} }
let debugLogWindow; let debugLogWindow;
function showDebugLogWindow() { async function showDebugLogWindow() {
if (debugLogWindow) { if (debugLogWindow) {
debugLogWindow.show(); debugLogWindow.show();
return; return;
} }
const theme = await pify(getDataFromMainWindow)('theme-setting');
const size = mainWindow.getSize(); const size = mainWindow.getSize();
const options = { const options = {
width: Math.max(size[0] - 100, MIN_WIDTH), width: Math.max(size[0] - 100, MIN_WIDTH),
@ -505,7 +508,7 @@ function showDebugLogWindow() {
captureClicks(debugLogWindow); captureClicks(debugLogWindow);
debugLogWindow.loadURL(prepareURL([__dirname, 'debug_log.html'])); debugLogWindow.loadURL(prepareURL([__dirname, 'debug_log.html'], { theme }));
debugLogWindow.on('closed', () => { debugLogWindow.on('closed', () => {
removeDarkOverlay(); removeDarkOverlay();
@ -519,7 +522,7 @@ function showDebugLogWindow() {
} }
let permissionsPopupWindow; let permissionsPopupWindow;
function showPermissionsPopupWindow() { async function showPermissionsPopupWindow() {
if (permissionsPopupWindow) { if (permissionsPopupWindow) {
permissionsPopupWindow.show(); permissionsPopupWindow.show();
return; return;
@ -528,6 +531,7 @@ function showPermissionsPopupWindow() {
return; return;
} }
const theme = await pify(getDataFromMainWindow)('theme-setting');
const size = mainWindow.getSize(); const size = mainWindow.getSize();
const options = { const options = {
width: Math.min(400, size[0]), width: Math.min(400, size[0]),
@ -553,7 +557,7 @@ function showPermissionsPopupWindow() {
captureClicks(permissionsPopupWindow); captureClicks(permissionsPopupWindow);
permissionsPopupWindow.loadURL( permissionsPopupWindow.loadURL(
prepareURL([__dirname, 'permissions_popup.html']) prepareURL([__dirname, 'permissions_popup.html'], { theme })
); );
permissionsPopupWindow.on('closed', () => { permissionsPopupWindow.on('closed', () => {
@ -832,13 +836,19 @@ ipc.on('delete-all-data', () => {
} }
}); });
function getDataFromMainWindow(name, callback) {
ipc.once(`get-success-${name}`, (_event, error, value) =>
callback(error, value)
);
mainWindow.webContents.send(`get-${name}`);
}
function installSettingsGetter(name) { function installSettingsGetter(name) {
ipc.on(`get-${name}`, event => { ipc.on(`get-${name}`, event => {
if (mainWindow && mainWindow.webContents) { if (mainWindow && mainWindow.webContents) {
ipc.once(`get-success-${name}`, (_event, error, value) => getDataFromMainWindow(name, (error, value) =>
event.sender.send(`get-success-${name}`, error, value) event.sender.send(`get-success-${name}`, error, value)
); );
mainWindow.webContents.send(`get-${name}`);
} }
}); });
} }

@ -3,7 +3,7 @@
"productName": "Signal", "productName": "Signal",
"description": "Private messaging from your desktop", "description": "Private messaging from your desktop",
"repository": "https://github.com/signalapp/Signal-Desktop.git", "repository": "https://github.com/signalapp/Signal-Desktop.git",
"version": "1.14.0", "version": "1.14.1-beta.1",
"license": "GPL-3.0", "license": "GPL-3.0",
"author": { "author": {
"name": "Open Whisper Systems", "name": "Open Whisper Systems",

@ -6,6 +6,7 @@ const config = url.parse(window.location.toString(), true).query;
const { locale } = config; const { locale } = config;
const localeMessages = ipcRenderer.sendSync('locale-data'); const localeMessages = ipcRenderer.sendSync('locale-data');
window.theme = config.theme;
window.i18n = i18n.setup(locale, localeMessages); window.i18n = i18n.setup(locale, localeMessages);
require('./js/logging'); require('./js/logging');

@ -70,10 +70,6 @@ window.closeAbout = () => ipc.send('close-about');
window.updateTrayIcon = unreadCount => window.updateTrayIcon = unreadCount =>
ipc.send('update-tray-icon', unreadCount); ipc.send('update-tray-icon', unreadCount);
ipc.on('debug-log', () => {
Whisper.events.trigger('showDebugLog');
});
ipc.on('set-up-with-import', () => { ipc.on('set-up-with-import', () => {
Whisper.events.trigger('setupWithImport'); Whisper.events.trigger('setupWithImport');
}); });

@ -6,6 +6,7 @@ const config = url.parse(window.location.toString(), true).query;
const { locale } = config; const { locale } = config;
const localeMessages = ipcRenderer.sendSync('locale-data'); const localeMessages = ipcRenderer.sendSync('locale-data');
window.theme = config.theme;
window.i18n = i18n.setup(locale, localeMessages); window.i18n = i18n.setup(locale, localeMessages);
require('./js/logging'); require('./js/logging');

@ -6,6 +6,10 @@ $button-dark: #ccc;
$text-dark: #cccccc; $text-dark: #cccccc;
$text-dark_l2: darken($text-dark, 30%); $text-dark_l2: darken($text-dark, 30%);
body.android-dark {
background-color: $grey-dark;
}
.android-dark { .android-dark {
.app-loading-screen { .app-loading-screen {
background-color: $grey-dark; background-color: $grey-dark;

Loading…
Cancel
Save