Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
RiotTranslate 2017-06-02 02:56:55 +00:00
commit a2b082f029
14 changed files with 360 additions and 11 deletions

View file

@ -1,3 +1,152 @@
Changes in [0.9.0-rc.2](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.9.0-rc.2) (2017-06-02)
=============================================================================================================
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.9.0-rc.1...v0.9.0-rc.2)
* Update from Weblate.
[\#1002](https://github.com/matrix-org/matrix-react-sdk/pull/1002)
* webrtc config electron
[\#850](https://github.com/matrix-org/matrix-react-sdk/pull/850)
* enable useCompactLayout user setting an add a class when it's enabled
[\#986](https://github.com/matrix-org/matrix-react-sdk/pull/986)
* Update from Weblate.
[\#987](https://github.com/matrix-org/matrix-react-sdk/pull/987)
* Translation fixes for everything but src/components
[\#990](https://github.com/matrix-org/matrix-react-sdk/pull/990)
* Fix tests
[\#1001](https://github.com/matrix-org/matrix-react-sdk/pull/1001)
* Fix tests for PR #989
[\#999](https://github.com/matrix-org/matrix-react-sdk/pull/999)
* Revert "Revert "add labels to language picker""
[\#1000](https://github.com/matrix-org/matrix-react-sdk/pull/1000)
* maybe fixxy [Electron] external thing?
[\#997](https://github.com/matrix-org/matrix-react-sdk/pull/997)
* travisci: Don't run the riot-web tests if the react-sdk tests fail
[\#992](https://github.com/matrix-org/matrix-react-sdk/pull/992)
* Support 12hr time on DateSeparator
[\#991](https://github.com/matrix-org/matrix-react-sdk/pull/991)
* Revert "add labels to language picker"
[\#994](https://github.com/matrix-org/matrix-react-sdk/pull/994)
* Call MatrixClient.clearStores on logout
[\#983](https://github.com/matrix-org/matrix-react-sdk/pull/983)
* Matthew/room avatar event
[\#988](https://github.com/matrix-org/matrix-react-sdk/pull/988)
* add labels to language picker
[\#989](https://github.com/matrix-org/matrix-react-sdk/pull/989)
* Update from Weblate.
[\#981](https://github.com/matrix-org/matrix-react-sdk/pull/981)
Changes in [0.9.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.9.0-rc.1) (2017-06-01)
=============================================================================================================
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.8.9...v0.9.0-rc.1)
* Fix rare case where presence duration is undefined
[\#982](https://github.com/matrix-org/matrix-react-sdk/pull/982)
* add concept of platform handling loudNotifications (bings/pings/whatHaveYou)
[\#985](https://github.com/matrix-org/matrix-react-sdk/pull/985)
* Fixes to i18n code
[\#984](https://github.com/matrix-org/matrix-react-sdk/pull/984)
* Update from Weblate.
[\#978](https://github.com/matrix-org/matrix-react-sdk/pull/978)
* Add partial support for RTL languages
[\#955](https://github.com/matrix-org/matrix-react-sdk/pull/955)
* Added two strings to translate
[\#975](https://github.com/matrix-org/matrix-react-sdk/pull/975)
* Update from Weblate.
[\#976](https://github.com/matrix-org/matrix-react-sdk/pull/976)
* Update from Weblate.
[\#974](https://github.com/matrix-org/matrix-react-sdk/pull/974)
* Initial Electron Settings - for Auto Launch
[\#920](https://github.com/matrix-org/matrix-react-sdk/pull/920)
* Fix missing string in the room settings
[\#973](https://github.com/matrix-org/matrix-react-sdk/pull/973)
* fix error in i18n string
[\#972](https://github.com/matrix-org/matrix-react-sdk/pull/972)
* Update from Weblate.
[\#970](https://github.com/matrix-org/matrix-react-sdk/pull/970)
* Support 12hr time in full date
[\#971](https://github.com/matrix-org/matrix-react-sdk/pull/971)
* Add _tJsx()
[\#968](https://github.com/matrix-org/matrix-react-sdk/pull/968)
* Update from Weblate.
[\#966](https://github.com/matrix-org/matrix-react-sdk/pull/966)
* Remove space between time and AM/PM
[\#969](https://github.com/matrix-org/matrix-react-sdk/pull/969)
* Piwik Analytics
[\#948](https://github.com/matrix-org/matrix-react-sdk/pull/948)
* Update from Weblate.
[\#965](https://github.com/matrix-org/matrix-react-sdk/pull/965)
* Improve ChatInviteDialog perf by ditching fuse, using indexOf and
lastActiveTs()
[\#960](https://github.com/matrix-org/matrix-react-sdk/pull/960)
* Say "X removed the room name" instead of showing nothing
[\#958](https://github.com/matrix-org/matrix-react-sdk/pull/958)
* roomview/roomheader fixes
[\#959](https://github.com/matrix-org/matrix-react-sdk/pull/959)
* Update from Weblate.
[\#953](https://github.com/matrix-org/matrix-react-sdk/pull/953)
* fix i18n in a situation where navigator.languages=[]
[\#956](https://github.com/matrix-org/matrix-react-sdk/pull/956)
* `t_` -> `_t` fix typo
[\#957](https://github.com/matrix-org/matrix-react-sdk/pull/957)
* Change redact -> remove for clarity
[\#831](https://github.com/matrix-org/matrix-react-sdk/pull/831)
* Update from Weblate.
[\#950](https://github.com/matrix-org/matrix-react-sdk/pull/950)
* fix mis-linting - missed it in code review :(
[\#952](https://github.com/matrix-org/matrix-react-sdk/pull/952)
* i18n fixes
[\#951](https://github.com/matrix-org/matrix-react-sdk/pull/951)
* Message Forwarding
[\#812](https://github.com/matrix-org/matrix-react-sdk/pull/812)
* don't focus_composer on window focus
[\#944](https://github.com/matrix-org/matrix-react-sdk/pull/944)
* Fix vector-im/riot-web#4042
[\#947](https://github.com/matrix-org/matrix-react-sdk/pull/947)
* import _t, drop two unused imports
[\#946](https://github.com/matrix-org/matrix-react-sdk/pull/946)
* Fix punctuation in TextForEvent to be i18n'd consistently
[\#945](https://github.com/matrix-org/matrix-react-sdk/pull/945)
* actually wire up alwaysShowTimestamps
[\#940](https://github.com/matrix-org/matrix-react-sdk/pull/940)
* Update from Weblate.
[\#943](https://github.com/matrix-org/matrix-react-sdk/pull/943)
* Update from Weblate.
[\#942](https://github.com/matrix-org/matrix-react-sdk/pull/942)
* Update from Weblate.
[\#941](https://github.com/matrix-org/matrix-react-sdk/pull/941)
* Update from Weblate.
[\#938](https://github.com/matrix-org/matrix-react-sdk/pull/938)
* Fix PM being AM
[\#939](https://github.com/matrix-org/matrix-react-sdk/pull/939)
* pass call state through dispatcher, for poor electron
[\#918](https://github.com/matrix-org/matrix-react-sdk/pull/918)
* Translations!
[\#934](https://github.com/matrix-org/matrix-react-sdk/pull/934)
* Remove suffix and prefix from login input username
[\#906](https://github.com/matrix-org/matrix-react-sdk/pull/906)
* Kierangould/12hourtimestamp
[\#903](https://github.com/matrix-org/matrix-react-sdk/pull/903)
* Don't include src in the test resolve root
[\#931](https://github.com/matrix-org/matrix-react-sdk/pull/931)
* Make the linked versions open a new tab, turt2live complained :P
[\#910](https://github.com/matrix-org/matrix-react-sdk/pull/910)
* Fix lint errors in SlashCommands
[\#919](https://github.com/matrix-org/matrix-react-sdk/pull/919)
* autoFocus input box
[\#911](https://github.com/matrix-org/matrix-react-sdk/pull/911)
* Make travis test against riot-web new-guest-access
[\#917](https://github.com/matrix-org/matrix-react-sdk/pull/917)
* Add right-branch logic to travis test script
[\#916](https://github.com/matrix-org/matrix-react-sdk/pull/916)
* Group e2e keys into blocks of 4 characters
[\#914](https://github.com/matrix-org/matrix-react-sdk/pull/914)
* Factor out DeviceVerifyDialog
[\#913](https://github.com/matrix-org/matrix-react-sdk/pull/913)
* Fix 'missing page_type' error
[\#909](https://github.com/matrix-org/matrix-react-sdk/pull/909)
* code style update
[\#904](https://github.com/matrix-org/matrix-react-sdk/pull/904)
Changes in [0.8.9](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.8.9) (2017-05-22)
===================================================================================================
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.8.9-rc.1...v0.8.9)

View file

@ -1,6 +1,6 @@
{
"name": "matrix-react-sdk",
"version": "0.8.9",
"version": "0.9.0-rc.2",
"description": "SDK for matrix.org using React",
"author": "matrix.org",
"repository": {
@ -64,7 +64,7 @@
"isomorphic-fetch": "^2.2.1",
"linkifyjs": "^2.1.3",
"lodash": "^4.13.1",
"matrix-js-sdk": "0.7.9",
"matrix-js-sdk": "0.7.10",
"optimist": "^0.6.1",
"q": "^1.4.1",
"react": "^15.4.0",

65
src/CallMediaHandler.js Normal file
View file

@ -0,0 +1,65 @@
/*
Copyright 2017 Michael Telatynski <7t3chguy@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import UserSettingsStore from './UserSettingsStore';
import * as Matrix from 'matrix-js-sdk';
import q from 'q';
export default {
getDevices: function() {
// Only needed for Electron atm, though should work in modern browsers
// once permission has been granted to the webapp
return navigator.mediaDevices.enumerateDevices().then(function(devices) {
const audioIn = [];
const videoIn = [];
if (devices.some((device) => !device.label)) return false;
devices.forEach((device) => {
switch (device.kind) {
case 'audioinput': audioIn.push(device); break;
case 'videoinput': videoIn.push(device); break;
}
});
// console.log("Loaded WebRTC Devices", mediaDevices);
return {
audioinput: audioIn,
videoinput: videoIn,
};
}, (error) => { console.log('Unable to refresh WebRTC Devices: ', error); });
},
loadDevices: function() {
// this.getDevices().then((devices) => {
const localSettings = UserSettingsStore.getLocalSettings();
// // if deviceId is not found, automatic fallback is in spec
// // recall previously stored inputs if any
Matrix.setMatrixCallAudioInput(localSettings['webrtc_audioinput']);
Matrix.setMatrixCallVideoInput(localSettings['webrtc_videoinput']);
// });
},
setAudioInput: function(deviceId) {
UserSettingsStore.setLocalSetting('webrtc_audioinput', deviceId);
Matrix.setMatrixCallAudioInput(deviceId);
},
setVideoInput: function(deviceId) {
UserSettingsStore.setLocalSetting('webrtc_videoinput', deviceId);
Matrix.setMatrixCallVideoInput(deviceId);
},
};

View file

@ -22,6 +22,7 @@ import UserSettingsStore from '../../UserSettingsStore';
import KeyCode from '../../KeyCode';
import Notifier from '../../Notifier';
import PageTypes from '../../PageTypes';
import CallMediaHandler from '../../CallMediaHandler';
import sdk from '../../index';
import dis from '../../dispatcher';
@ -79,6 +80,8 @@ export default React.createClass({
// RoomView.getScrollState()
this._scrollStateMap = {};
CallMediaHandler.loadDevices();
document.addEventListener('keydown', this._onKeyDown);
this._matrixClient.on("accountData", this.onAccountData);
},

View file

@ -24,6 +24,7 @@ const dis = require("../../dispatcher");
const q = require('q');
const packageJson = require('../../../package.json');
const UserSettingsStore = require('../../UserSettingsStore');
const CallMediaHandler = require('../../CallMediaHandler');
const GeminiScrollbar = require('react-gemini-scrollbar');
const Email = require('../../email');
const AddThreepid = require('../../AddThreepid');
@ -176,6 +177,7 @@ module.exports = React.createClass({
email_add_pending: false,
vectorVersion: undefined,
rejectingInvites: false,
mediaDevices: null,
};
},
@ -196,6 +198,8 @@ module.exports = React.createClass({
});
}
this._refreshMediaDevices();
// Bulk rejecting invites:
// /sync won't have had time to return when UserSettings re-renders from state changes, so getRooms()
// will still return rooms with invites. To get around this, add a listener for
@ -257,6 +261,20 @@ module.exports = React.createClass({
this.setState({ electron_settings: settings });
},
_refreshMediaDevices: function() {
q().then(() => {
return CallMediaHandler.getDevices();
}).then((mediaDevices) => {
// console.log("got mediaDevices", mediaDevices, this._unmounted);
if (this._unmounted) return;
this.setState({
mediaDevices,
activeAudioInput: this._localSettings['webrtc_audioinput'],
activeVideoInput: this._localSettings['webrtc_videoinput'],
});
});
},
_refreshFromServer: function() {
const self = this;
q.all([
@ -883,6 +901,110 @@ module.exports = React.createClass({
</div>;
},
_mapWebRtcDevicesToSpans: function(devices) {
return devices.map((device) => <span key={device.deviceId}>{device.label}</span>);
},
_setAudioInput: function(deviceId) {
this.setState({activeAudioInput: deviceId});
CallMediaHandler.setAudioInput(deviceId);
},
_setVideoInput: function(deviceId) {
this.setState({activeVideoInput: deviceId});
CallMediaHandler.setVideoInput(deviceId);
},
_requestMediaPermissions: function(event) {
const getUserMedia = (
window.navigator.getUserMedia || window.navigator.webkitGetUserMedia || window.navigator.mozGetUserMedia
);
if (getUserMedia) {
return getUserMedia.apply(window.navigator, [
{ video: true, audio: true },
this._refreshMediaDevices,
function() {
const ErrorDialog = sdk.getComponent('dialogs.ErrorDialog');
Modal.createDialog(ErrorDialog, {
title: _t('No media permissions'),
description: _t('You may need to manually permit Riot to access your microphone/webcam'),
});
},
]);
}
},
_renderWebRtcSettings: function() {
if (this.state.mediaDevices === false) {
return <div>
<h3>{_t('VoIP')}</h3>
<div className="mx_UserSettings_section">
<p className="mx_UserSettings_link" onClick={this._requestMediaPermissions}>
{_t('Missing Media Permissions, click here to request.')}
</p>
</div>
</div>;
} else if (!this.state.mediaDevices) return;
const Dropdown = sdk.getComponent('elements.Dropdown');
let microphoneDropdown = <p>{_t('No Microphones detected')}</p>;
let webcamDropdown = <p>{_t('No Webcams detected')}</p>;
const defaultOption = {
deviceId: '',
label: _t('Default Device'),
};
const audioInputs = this.state.mediaDevices.audioinput.slice(0);
if (audioInputs.length > 0) {
let defaultInput = '';
if (!audioInputs.some((input) => input.deviceId === 'default')) {
audioInputs.unshift(defaultOption);
} else {
defaultInput = 'default';
}
microphoneDropdown = <div>
<h4>{_t('Microphone')}</h4>
<Dropdown
className="mx_UserSettings_webRtcDevices_dropdown"
value={this.state.activeAudioInput || defaultInput}
onOptionChange={this._setAudioInput}>
{this._mapWebRtcDevicesToSpans(audioInputs)}
</Dropdown>
</div>;
}
const videoInputs = this.state.mediaDevices.videoinput.slice(0);
if (videoInputs.length > 0) {
let defaultInput = '';
if (!videoInputs.some((input) => input.deviceId === 'default')) {
videoInputs.unshift(defaultOption);
} else {
defaultInput = 'default';
}
webcamDropdown = <div>
<h4>{_t('Camera')}</h4>
<Dropdown
className="mx_UserSettings_webRtcDevices_dropdown"
value={this.state.activeVideoInput || defaultInput}
onOptionChange={this._setVideoInput}>
{this._mapWebRtcDevicesToSpans(videoInputs)}
</Dropdown>
</div>;
}
return <div>
<h3>{_t('VoIP')}</h3>
<div className="mx_UserSettings_section">
{microphoneDropdown}
{webcamDropdown}
</div>
</div>;
},
_showSpoiler: function(event) {
const target = event.target;
target.innerHTML = target.getAttribute('data-spoiler');
@ -1080,6 +1202,7 @@ module.exports = React.createClass({
{this._renderUserInterfaceSettings()}
{this._renderLabs()}
{this._renderWebRtcSettings()}
{this._renderDevicesPanel()}
{this._renderCryptoInfo()}
{this._renderBulkOptions()}

View file

@ -182,7 +182,7 @@ class PasswordLogin extends React.Component {
<div>
<form onSubmit={this.onSubmitForm}>
<div className="mx_Login_type_container">
<label className="mx_Login_type_label">{ _t('I want to sign in with') }</label>
<label className="mx_Login_type_label">{ _t('Sign in with') }</label>
<Dropdown
className="mx_Login_type_dropdown"
value={this.state.loginType}

View file

@ -132,7 +132,7 @@ module.exports = React.createClass({
var toggleButton;
if (this.props.withToggleButton) {
toggleButton = (
<div style={{ textAlign: 'center' }}>
<div className="mx_ServerConfig_selector">
<input className="mx_Login_radio" id="basic" name="configVisible" type="radio"
checked={!this.state.configVisible}
onChange={this.onServerConfigVisibleChange.bind(this, false)} />

View file

@ -139,7 +139,7 @@
"Invite new room members": "Lade neue Raum-Mitglieder ein",
"is a": "ist ein",
"is trusted": "wird vertraut",
"I want to sign in with": "Ich möchte mich anmelden mit",
"Sign in with": "Ich möchte mich anmelden mit",
"joined and left": "trat bei und ging",
"joined": "trat bei",
"joined the room": "trat dem Raum bei",

View file

@ -129,6 +129,15 @@
"Add email address": "Add email address",
"Add phone number": "Add phone number",
"Admin": "Admin",
"VoIP": "VoIP",
"Missing Media Permissions, click here to request.": "Missing Media Permissions, click here to request.",
"No Microphones detected": "No Microphones detected",
"No Webcams detected": "No Webcams detected",
"No media permissions": "No media permissions",
"You may need to manually permit Riot to access your microphone/webcam": "You may need to manually permit Riot to access your microphone/webcam",
"Default Device": "Default Device",
"Microphone": "Microphone",
"Camera": "Camera",
"Advanced": "Advanced",
"Algorithm": "Algorithm",
"Always show message timestamps": "Always show message timestamps",
@ -318,7 +327,7 @@
"'%(alias)s' is not a valid format for an address": "'%(alias)s' is not a valid format for an address",
"'%(alias)s' is not a valid format for an alias": "'%(alias)s' is not a valid format for an alias",
"%(displayName)s is typing": "%(displayName)s is typing",
"I want to sign in with": "I want to sign in with",
"Sign in with": "Sign in with",
"Join Room": "Join Room",
"joined and left": "joined and left",
"joined": "joined",

View file

@ -308,7 +308,7 @@
"'%(alias)s' is not a valid format for an address": "'%(alias)s' no es un formato válido para una dirección",
"'%(alias)s' is not a valid format for an alias": "'%(alias)s' no es un formato válido para un alias",
"%(displayName)s is typing": "%(displayName)s esta escribiendo",
"I want to sign in with": "Quiero iniciar sesión con",
"Sign in with": "Quiero iniciar sesión con",
"Join Room": "Unirte a la sala",
"joined and left": "unido y dejado",
"joined": "unido",

View file

@ -318,7 +318,7 @@
"'%(alias)s' is not a valid format for an address": "'%(alias)s' n'est pas un format valide pour une adresse",
"'%(alias)s' is not a valid format for an alias": "'%(alias)s' n'est pas un format valide pour un alias",
"%(displayName)s is typing": "%(displayName)s est en train de taper",
"I want to sign in with": "Je veux m'identifier avec",
"Sign in with": "Je veux m'identifier avec",
"Join Room": "Rejoindre le salon",
"joined and left": "a joint et quitté",
"joined": "a joint",

View file

@ -112,7 +112,7 @@
"Invites": "Convidar",
"Invites user with given id to current room": "Convidar usuários com um dado identificador para esta sala",
"is a": "é um(a)",
"I want to sign in with": "Quero entrar",
"Sign in with": "Quero entrar",
"joined and left": "entrou e saiu",
"joined": "entrou",
"joined the room": "entrou na sala",

View file

@ -115,7 +115,7 @@
"Invites": "Convidar",
"Invites user with given id to current room": "Convidar usuários com um dado identificador para esta sala",
"is a": "é um(a)",
"I want to sign in with": "Quero entrar",
"Sign in with": "Quero entrar",
"joined and left": "entrou e saiu",
"joined": "entrou",
"joined the room": "entrou na sala",

View file

@ -103,7 +103,7 @@
"Invites": "Приглашать",
"Invites user with given id to current room": "Пригласить пользователя с данным id в текущую комнату",
"is a": "является",
"I want to sign in with": "Я хочу регистрироваться с",
"Sign in with": "Я хочу регистрироваться с",
"joined and left": "присоединенный и оставленный",
"joined": "присоединенный",
"joined the room": "joined the room",