Merge branches 'develop' and 't3chguy/updating_stuff' of github.com:vector-im/riot-web into t3chguy/updating_stuff

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

# Conflicts:
#	electron_app/src/tray.js
This commit is contained in:
Michael Telatynski 2017-06-22 15:04:33 +01:00
commit 0788826a71
11 changed files with 56 additions and 41 deletions

View File

@ -1,3 +1,13 @@
Changes in [0.11.4](https://github.com/vector-im/riot-web/releases/tag/v0.11.4) (2017-06-22)
============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.11.3...v0.11.4)
* Update matrix-js-sdk and react-sdk to fix a regression where the
background indexedb worker was disabled, failures to open indexeddb
causing the app to fail to start, a race when starting that could break
switching to rooms, and the inability to invite users with mixed case
usernames.
Changes in [0.11.3](https://github.com/vector-im/riot-web/releases/tag/v0.11.3) (2017-06-20)
============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.11.2...v0.11.3)

View File

@ -2,7 +2,7 @@
"name": "riot-web",
"productName": "Riot",
"main": "src/electron-main.js",
"version": "0.11.3",
"version": "0.11.4",
"description": "A feature-rich client for Matrix.org",
"author": "Vector Creations Ltd.",
"dependencies": {

View File

@ -54,33 +54,38 @@ exports.create = function(config) {
},
]);
trayIcon = new Tray(config.icon_path);
const defaultIcon = nativeImage.createFromPath(config.icon_path);
trayIcon = new Tray(defaultIcon);
trayIcon.setToolTip(config.brand);
trayIcon.setContextMenu(contextMenu);
trayIcon.on('click', toggleWin);
let lastFavicon = null;
global.mainWindow.webContents.on('page-favicon-updated', async function(ev, favicons) {
let newFavicon = config.icon_path;
if (favicons && favicons.length > 0 && favicons[0].startsWith('data:')) {
newFavicon = favicons[0];
if (!favicons || favicons.length <= 0 || !favicons[0].startsWith('data:')) {
if (lastFavicon !== null) {
win.setIcon(defaultIcon);
trayIcon.setImage(defaultIcon);
lastFavicon = null;
}
return;
}
// No need to change, shortcut
if (newFavicon === lastFavicon) return;
lastFavicon = newFavicon;
if (favicons[0] === lastFavicon) return;
lastFavicon = favicons[0];
// if its not default we have to construct into nativeImage
if (newFavicon !== config.icon_path) {
newFavicon = nativeImage.createFromDataURL(favicons[0]);
let newFavicon = nativeImage.createFromDataURL(favicons[0]);
// Windows likes ico's too much.
if (process.platform === 'win32') {
try {
const icoPath = path.join(app.getPath('temp'), 'win32_riot_icon.ico')
const icoBuf = await pngToIco(newFavicon.toPNG());
fs.writeFileSync(icoPath, icoBuf);
newFavicon = icoPath;
} catch (e) {console.error(e);}
const icoPath = path.join(app.getPath('temp'), 'win32_riot_icon.ico');
fs.writeFileSync(icoPath, await pngToIco(newFavicon.toPNG()));
newFavicon = nativeImage.createFromPath(icoPath);
} catch (e) {
console.error("Failed to make win32 ico", e);
}
}

View File

@ -2,7 +2,7 @@
"name": "riot-web",
"productName": "Riot",
"main": "electron_app/src/electron-main.js",
"version": "0.11.3",
"version": "0.11.4",
"description": "A feature-rich client for Matrix.org",
"author": "Vector Creations Ltd.",
"repository": {
@ -65,8 +65,8 @@
"gfm.css": "^1.1.1",
"highlight.js": "^9.0.0",
"linkifyjs": "^2.1.3",
"matrix-js-sdk": "0.7.12",
"matrix-react-sdk": "0.9.6",
"matrix-js-sdk": "0.7.13",
"matrix-react-sdk": "0.9.7",
"modernizr": "^3.1.0",
"pako": "^1.0.5",
"q": "^1.4.1",

View File

@ -158,7 +158,7 @@ module.exports = React.createClass({
var eventRedact;
if(showEventMeta) {
eventRedact = (<div className="mx_ImageView_button" onClick={this.onRedactClick}>
{ _t('Redact') }
{ _t('Remove') }
</div>);
}

View File

@ -20,7 +20,7 @@ import React from 'react';
import sdk from 'matrix-react-sdk';
import Modal from 'matrix-react-sdk/lib/Modal';
import dis from 'matrix-react-sdk/lib/dispatcher';
import { _t } from 'matrix-react-sdk/lib/languageHandler';
import { _t, _tJsx } from 'matrix-react-sdk/lib/languageHandler';
export default React.createClass({
onUpdateClicked: function() {
@ -49,7 +49,11 @@ export default React.createClass({
alt="Warning"
/>
<div className="mx_MatrixToolbar_content">
{ _t("To return to your account in future you need to <u>set a password</u>") }
{ _tJsx(
"To return to your account in future you need to <u>set a password</u>",
/<u>(.*?)<\/u>/,
(sub) => { return <u>{ sub }</u>; },
) }
</div>
<button className="mx_MatrixToolbar_action">
{ _t("Set Password") }

View File

@ -98,7 +98,6 @@
"Please Register": "Please Register",
"powered by Matrix": "powered by Matrix",
"Quote": "Quote",
"Redact": "Redact",
"Reject": "Reject",
"Remove %(name)s from the directory?": "Remove %(name)s from the directory?",
"Remove": "Remove",
@ -204,5 +203,5 @@
"You have successfully set a password and an email address!": "You have successfully set a password and an email address!",
"Remember, you can always set an email address in user settings if you change your mind.": "Remember, you can always set an email address in user settings if you change your mind.",
"To return to your account in future you need to <u>set a password</u>": "To return to your account in future you need to <u>set a password</u>",
"Set Password"
"Set Password": "Set Password"
}

View File

@ -96,7 +96,6 @@
"Please Register": "Please Register",
"powered by Matrix": "powered by Matrix",
"Quote": "Quote",
"Redact": "Redact",
"Reject": "Reject",
"Remove %(name)s from the directory?": "Remove %(name)s from the directory?",
"Remove": "Remove",

View File

@ -103,18 +103,12 @@ limitations under the License.
}
.mx_UserSettings_passwordWarning {
padding: 6px;
background-color: #76cfa6;
border-radius: 3px;
color: #fff;
/* To move the "Sign out" button out of the way */
clear: both;
color: $warning-color;
margin-bottom: 5px;
}
.mx_UserSettings_passwordWarning_icon {
vertical-align: -6px;
margin-right: 3px;
}
.mx_UserSettings_importExportButtons {
padding-top: 10px;
padding-left: 40px;

View File

@ -70,7 +70,8 @@ describe('loading:', function () {
});
});
afterEach(async function() {
afterEach(async function () {
console.log(`${Date.now()}: loading: afterEach`);
if (parentDiv) {
ReactDOM.unmountComponentAtNode(parentDiv);
parentDiv.remove();
@ -83,6 +84,7 @@ describe('loading:', function () {
// clear the indexeddbs so we can start from a clean slate next time.
await test_utils.deleteIndexedDB('matrix-js-sdk:crypto');
await test_utils.deleteIndexedDB('matrix-js-sdk:riot-web-sync');
console.log(`${Date.now()}: loading: afterEach complete`);
});
/* simulate the load process done by index.js
@ -614,7 +616,6 @@ describe('loading:', function () {
matrixChat, sdk.getComponent('structures.login.Login'));
httpBackend.when('POST', '/login').check(function(req) {
console.log(req);
expect(req.data.type).toEqual('m.login.password');
expect(req.data.identifier.type).toEqual('m.id.user');
expect(req.data.identifier.user).toEqual('user');

View File

@ -34,22 +34,25 @@ export function deleteIndexedDB(dbName) {
return;
}
console.log(`Removing indexeddb instance: ${dbName}`);
console.log(`${Date.now()}: Removing indexeddb instance: ${dbName}`);
const req = window.indexedDB.deleteDatabase(dbName);
req.onblocked = () => {
console.log(`can't yet delete indexeddb because it is open elsewhere`);
console.log(`${Date.now()}: can't yet delete indexeddb ${dbName} because it is open elsewhere`);
};
req.onerror = (ev) => {
reject(new Error(
"unable to delete indexeddb: " + ev.target.error,
`${Date.now()}: unable to delete indexeddb ${dbName}: ${ev.target.error}`,
));
};
req.onsuccess = () => {
console.log(`Removed indexeddb instance: ${dbName}`);
console.log(`${Date.now()}: Removed indexeddb instance: ${dbName}`);
resolve();
};
}).catch((e) => {
console.error(`${Date.now()}: Error removing indexeddb instance ${dbName}: ${e}`);
throw e;
});
}