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
CHANGELOG.md
electron_app
package.json
src
components/views
i18n/strings
skins/vector/css/matrix-react-sdk/structures
test

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) 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) [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", "name": "riot-web",
"productName": "Riot", "productName": "Riot",
"main": "src/electron-main.js", "main": "src/electron-main.js",
"version": "0.11.3", "version": "0.11.4",
"description": "A feature-rich client for Matrix.org", "description": "A feature-rich client for Matrix.org",
"author": "Vector Creations Ltd.", "author": "Vector Creations Ltd.",
"dependencies": { "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.setToolTip(config.brand);
trayIcon.setContextMenu(contextMenu); trayIcon.setContextMenu(contextMenu);
trayIcon.on('click', toggleWin); trayIcon.on('click', toggleWin);
let lastFavicon = null; let lastFavicon = null;
global.mainWindow.webContents.on('page-favicon-updated', async function(ev, favicons) { 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:')) {
if (favicons && favicons.length > 0 && favicons[0].startsWith('data:')) { if (lastFavicon !== null) {
newFavicon = favicons[0]; win.setIcon(defaultIcon);
trayIcon.setImage(defaultIcon);
lastFavicon = null;
}
return;
} }
// No need to change, shortcut // No need to change, shortcut
if (newFavicon === lastFavicon) return; if (favicons[0] === lastFavicon) return;
lastFavicon = newFavicon; lastFavicon = favicons[0];
// if its not default we have to construct into nativeImage let newFavicon = nativeImage.createFromDataURL(favicons[0]);
if (newFavicon !== config.icon_path) {
newFavicon = nativeImage.createFromDataURL(favicons[0]);
// Windows likes ico's too much.
if (process.platform === 'win32') { if (process.platform === 'win32') {
try { try {
const icoPath = path.join(app.getPath('temp'), 'win32_riot_icon.ico') const icoPath = path.join(app.getPath('temp'), 'win32_riot_icon.ico');
const icoBuf = await pngToIco(newFavicon.toPNG()); fs.writeFileSync(icoPath, await pngToIco(newFavicon.toPNG()));
fs.writeFileSync(icoPath, icoBuf); newFavicon = nativeImage.createFromPath(icoPath);
newFavicon = icoPath; } catch (e) {
} catch (e) {console.error(e);} console.error("Failed to make win32 ico", e);
} }
} }

View File

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

View File

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

View File

@ -20,7 +20,7 @@ import React from 'react';
import sdk from 'matrix-react-sdk'; import sdk from 'matrix-react-sdk';
import Modal from 'matrix-react-sdk/lib/Modal'; import Modal from 'matrix-react-sdk/lib/Modal';
import dis from 'matrix-react-sdk/lib/dispatcher'; 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({ export default React.createClass({
onUpdateClicked: function() { onUpdateClicked: function() {
@ -49,7 +49,11 @@ export default React.createClass({
alt="Warning" alt="Warning"
/> />
<div className="mx_MatrixToolbar_content"> <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> </div>
<button className="mx_MatrixToolbar_action"> <button className="mx_MatrixToolbar_action">
{ _t("Set Password") } { _t("Set Password") }

View File

@ -98,7 +98,6 @@
"Please Register": "Please Register", "Please Register": "Please Register",
"powered by Matrix": "powered by Matrix", "powered by Matrix": "powered by Matrix",
"Quote": "Quote", "Quote": "Quote",
"Redact": "Redact",
"Reject": "Reject", "Reject": "Reject",
"Remove %(name)s from the directory?": "Remove %(name)s from the directory?", "Remove %(name)s from the directory?": "Remove %(name)s from the directory?",
"Remove": "Remove", "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!", "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.", "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>", "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", "Please Register": "Please Register",
"powered by Matrix": "powered by Matrix", "powered by Matrix": "powered by Matrix",
"Quote": "Quote", "Quote": "Quote",
"Redact": "Redact",
"Reject": "Reject", "Reject": "Reject",
"Remove %(name)s from the directory?": "Remove %(name)s from the directory?", "Remove %(name)s from the directory?": "Remove %(name)s from the directory?",
"Remove": "Remove", "Remove": "Remove",

View File

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

View File

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

View File

@ -34,22 +34,25 @@ export function deleteIndexedDB(dbName) {
return; return;
} }
console.log(`Removing indexeddb instance: ${dbName}`); console.log(`${Date.now()}: Removing indexeddb instance: ${dbName}`);
const req = window.indexedDB.deleteDatabase(dbName); const req = window.indexedDB.deleteDatabase(dbName);
req.onblocked = () => { 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) => { req.onerror = (ev) => {
reject(new Error( reject(new Error(
"unable to delete indexeddb: " + ev.target.error, `${Date.now()}: unable to delete indexeddb ${dbName}: ${ev.target.error}`,
)); ));
}; };
req.onsuccess = () => { req.onsuccess = () => {
console.log(`Removed indexeddb instance: ${dbName}`); console.log(`${Date.now()}: Removed indexeddb instance: ${dbName}`);
resolve(); resolve();
}; };
}).catch((e) => {
console.error(`${Date.now()}: Error removing indexeddb instance ${dbName}: ${e}`);
throw e;
}); });
} }