From 53796f55be5924c94ed3ee07a21363be29272a3e Mon Sep 17 00:00:00 2001 From: Pablo Saavedra Date: Mon, 8 May 2017 12:25:45 +0200 Subject: [PATCH 001/426] Added default_federate property --- config.sample.json | 1 + 1 file changed, 1 insertion(+) diff --git a/config.sample.json b/config.sample.json index a65646ac..94df4943 100644 --- a/config.sample.json +++ b/config.sample.json @@ -6,6 +6,7 @@ "integrations_rest_url": "https://scalar.vector.im/api", "bug_report_endpoint_url": "https://vector.im/bugs", "enableLabs": true, + "default_federate": true, "roomDirectory": { "servers": [ "matrix.org" From 16357a9bc7ed4a635911811642fe04b368194108 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Sat, 27 May 2017 17:31:28 +0100 Subject: [PATCH 002/426] Sorting of networks within a protocol based on name Signed-off-by: Oliver Hunt --- .../views/directory/NetworkDropdown.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/views/directory/NetworkDropdown.js b/src/components/views/directory/NetworkDropdown.js index c891ee5b..9c19cdbc 100644 --- a/src/components/views/directory/NetworkDropdown.js +++ b/src/components/views/directory/NetworkDropdown.js @@ -150,7 +150,21 @@ export default class NetworkDropdown extends React.Component { if (this.props.protocols) { for (const proto of Object.keys(this.props.protocols)) { if (!this.props.protocols[proto].instances) continue; - for (const instance of this.props.protocols[proto].instances) { + + const sortedInstances = this.props.protocols[proto].instances; + sortedInstances.sort(function(x, y) { + const a = x.desc + const b = y.desc + if (a < b) { + return -1; + } else if (a > b) { + return 1; + } else { + return 0; + } + }); + + for (const instance of sortedInstances) { if (!instance.instance_id) continue; options.push(this._makeMenuOption(server, instance, false)); } From 9541fc1033490c13a52fabc4eebd50474d0b855d Mon Sep 17 00:00:00 2001 From: Sylvia van Os Date: Sun, 25 Jun 2017 22:13:00 +0200 Subject: [PATCH 003/426] Mirror local video feed --- .../vector/css/matrix-react-sdk/views/voip/_VideoView.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/skins/vector/css/matrix-react-sdk/views/voip/_VideoView.scss b/src/skins/vector/css/matrix-react-sdk/views/voip/_VideoView.scss index 8f23ef6b..eb435383 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/voip/_VideoView.scss +++ b/src/skins/vector/css/matrix-react-sdk/views/voip/_VideoView.scss @@ -42,4 +42,5 @@ limitations under the License. .mx_VideoView_localVideoFeed video { width: auto; height: 100%; -} \ No newline at end of file + transform: scale(-1, 1); +} From c6bc20cd2a9b344adac586e156af4e3b837ca470 Mon Sep 17 00:00:00 2001 From: Alexey Murz Korepov Date: Tue, 18 Jul 2017 09:23:32 +0300 Subject: [PATCH 004/426] Fix menu on change keyboard language issue #4345 Fix activating menu when changing keyboard language / layout via Alt-Shift, Alt-Ctrl, Alt-CapsLock, and Alt-Space --- electron_app/src/vectormenu.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/electron_app/src/vectormenu.js b/electron_app/src/vectormenu.js index ab30b376..14f91a52 100644 --- a/electron_app/src/vectormenu.js +++ b/electron_app/src/vectormenu.js @@ -19,7 +19,7 @@ const {app, shell, Menu} = require('electron'); // Menu template from http://electron.atom.io/docs/api/menu/, edited const template = [ { - label: 'Edit', + label: '&Edit', submenu: [ { role: 'undo' }, { role: 'redo' }, @@ -33,7 +33,7 @@ const template = [ ], }, { - label: 'View', + label: '&View', submenu: [ { type: 'separator' }, { role: 'resetzoom' }, @@ -45,6 +45,7 @@ const template = [ ], }, { + label: '&Window', role: 'window', submenu: [ { role: 'minimize' }, @@ -52,6 +53,7 @@ const template = [ ], }, { + label: '&Help', role: 'help', submenu: [ { @@ -122,7 +124,7 @@ if (process.platform === 'darwin') { ]; } else { template.unshift({ - label: 'File', + label: '&File', submenu: [ // For some reason, 'about' does not seem to work on windows. /*{ From 3ff628254d41908b5224f5d1caec92caf3b9191c Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 25 Jul 2017 15:56:40 +0100 Subject: [PATCH 005/426] CSS for group userlist --- src/components/structures/RightPanel.js | 98 ++++++++++++++----------- 1 file changed, 54 insertions(+), 44 deletions(-) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index 6c5c1fe1..f3c16021 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -1,5 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd +Copyright 2017 Vector Creations Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,8 +15,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -'use strict'; - import React from 'react'; import { _t } from 'matrix-react-sdk/lib/languageHandler'; import sdk from 'matrix-react-sdk'; @@ -33,19 +32,21 @@ module.exports = React.createClass({ propTypes: { userId: React.PropTypes.string, // if showing an orphaned MemberInfo page, this is set roomId: React.PropTypes.string, // if showing panels for a given room, this is set + groupId: React.PropTypes.string, // if showing panels for a given group, this is set collapsed: React.PropTypes.bool, // currently unused property to request for a minimized view of the panel }, Phase: { - MemberList: 'MemberList', + RoomMemberList: 'RoomMemberList', + GroupMemberList: 'GroupMemberList', FilePanel: 'FilePanel', NotificationPanel: 'NotificationPanel', - MemberInfo: 'MemberInfo', + RoomMemberInfo: 'RoomMemberInfo', }, componentWillMount: function() { this.dispatcherRef = dis.register(this.onAction); - var cli = MatrixClientPeg.get(); + const cli = MatrixClientPeg.get(); cli.on("RoomState.members", this.onRoomStateMember); }, @@ -58,21 +59,25 @@ module.exports = React.createClass({ getInitialState: function() { if (this.props.userId) { - var member = new Matrix.RoomMember(null, this.props.userId); + const member = new Matrix.RoomMember(null, this.props.userId); return { - phase: this.Phase.MemberInfo, + phase: this.Phase.RoomMemberInfo, member: member, }; + } else if (this.props.groupId) { + return { + phase: this.Phase.GroupMemberList + }; } else { return { - phase: this.Phase.MemberList + phase: this.Phase.RoomMemberList }; } }, onMemberListButtonClick: function() { Analytics.trackEvent('Right Panel', 'Member List Button', 'click'); - this.setState({ phase: this.Phase.MemberList }); + this.setState({ phase: this.Phase.RoomMemberList }); }, onFileListButtonClick: function() { @@ -106,10 +111,10 @@ module.exports = React.createClass({ onRoomStateMember: function(ev, state, member) { // redraw the badge on the membership list - if (this.state.phase == this.Phase.MemberList && member.roomId === this.props.roomId) { + if (this.state.phase == this.Phase.RoomMemberList && member.roomId === this.props.roomId) { this._delayedUpdate(); } - else if (this.state.phase === this.Phase.MemberInfo && member.roomId === this.props.roomId && + else if (this.state.phase === this.Phase.RoomMemberInfo && member.roomId === this.props.roomId && member.userId === this.state.member.userId) { // refresh the member info (e.g. new power level) this._delayedUpdate(); @@ -127,39 +132,45 @@ module.exports = React.createClass({ }); if (payload.member) { this.setState({ - phase: this.Phase.MemberInfo, + phase: this.Phase.RoomMemberInfo, member: payload.member, }); - } - else { - this.setState({ - phase: this.Phase.MemberList - }); + } else { + if (this.props.roomId) { + this.setState({ + phase: this.Phase.RoomMemberList + }); + } else if (this.props.groupId) { + this.setState({ + phase: this.Phase.GroupMemberList + }); + } } } else if (payload.action === "view_room") { - if (this.state.phase === this.Phase.MemberInfo) { + if (this.state.phase === this.Phase.RoomMemberInfo) { this.setState({ - phase: this.Phase.MemberList + phase: this.Phase.RoomMemberList }); } } }, render: function() { - var MemberList = sdk.getComponent('rooms.MemberList'); - var NotificationPanel = sdk.getComponent('structures.NotificationPanel'); - var FilePanel = sdk.getComponent('structures.FilePanel'); - var TintableSvg = sdk.getComponent("elements.TintableSvg"); - var buttonGroup; - var inviteGroup; - var panel; + const MemberList = sdk.getComponent('rooms.MemberList'); + const GroupMemberList = sdk.getComponent('groups.GroupMemberList'); + const NotificationPanel = sdk.getComponent('structures.NotificationPanel'); + const FilePanel = sdk.getComponent('structures.FilePanel'); + const TintableSvg = sdk.getComponent("elements.TintableSvg"); + let buttonGroup; + let inviteGroup; + let panel; - var filesHighlight; - var membersHighlight; - var notificationsHighlight; + let filesHighlight; + let membersHighlight; + let notificationsHighlight; if (!this.props.collapsed) { - if (this.state.phase == this.Phase.MemberList || this.state.phase === this.Phase.MemberInfo) { + if (this.state.phase == this.Phase.RoomMemberList || this.state.phase === this.Phase.RoomMemberInfo) { membersHighlight =
; } else if (this.state.phase == this.Phase.FilePanel) { @@ -170,11 +181,11 @@ module.exports = React.createClass({ } } - var membersBadge; - if ((this.state.phase == this.Phase.MemberList || this.state.phase === this.Phase.MemberInfo) && this.props.roomId) { - var cli = MatrixClientPeg.get(); - var room = cli.getRoom(this.props.roomId); - var user_is_in_room; + let membersBadge; + if ((this.state.phase == this.Phase.RoomMemberList || this.state.phase === this.Phase.RoomMemberInfo) && this.props.roomId) { + const cli = MatrixClientPeg.get(); + const room = cli.getRoom(this.props.roomId); + let user_is_in_room; if (room) { membersBadge = room.getJoinedMembers().length; user_is_in_room = room.hasMembershipState( @@ -224,17 +235,16 @@ module.exports = React.createClass({ } if (!this.props.collapsed) { - if(this.props.roomId && this.state.phase == this.Phase.MemberList) { + if (this.props.roomId && this.state.phase == this.Phase.RoomMemberList) { panel = - } - else if(this.state.phase == this.Phase.MemberInfo) { - var MemberInfo = sdk.getComponent('rooms.MemberInfo'); + } else if (this.props.groupId && this.state.phase == this.Phase.GroupMemberList) { + panel = + } else if(this.state.phase == this.Phase.RoomMemberInfo) { + const MemberInfo = sdk.getComponent('rooms.MemberInfo'); panel = - } - else if (this.state.phase == this.Phase.NotificationPanel) { + } else if (this.state.phase == this.Phase.NotificationPanel) { panel = - } - else if (this.state.phase == this.Phase.FilePanel) { + } else if (this.state.phase == this.Phase.FilePanel) { panel = } } @@ -243,7 +253,7 @@ module.exports = React.createClass({ panel =
; } - var classes = "mx_RightPanel mx_fadable"; + let classes = "mx_RightPanel mx_fadable"; if (this.props.collapsed) { classes += " collapsed"; } From 6bfdd692790becbd1b9560c82a1279aac8e322ab Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 31 Jul 2017 12:08:41 +0100 Subject: [PATCH 006/426] add devtools dialog --- .../views/dialogs/DevtoolsDialog.js | 206 ++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 src/components/views/dialogs/DevtoolsDialog.js diff --git a/src/components/views/dialogs/DevtoolsDialog.js b/src/components/views/dialogs/DevtoolsDialog.js new file mode 100644 index 00000000..c4248fa9 --- /dev/null +++ b/src/components/views/dialogs/DevtoolsDialog.js @@ -0,0 +1,206 @@ +/* +Copyright 2017 OpenMarket Ltd + +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 React from 'react'; +import sdk from 'matrix-react-sdk'; +import Modal from 'matrix-react-sdk/lib/Modal'; +import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; + +class SendCustomEvent extends React.Component { + static propTypes = { + roomId: React.PropTypes.string.isRequired, + onFinished: React.PropTypes.func.isRequired, + }; + + constructor(props, context) { + super(props, context); + this._send = this._send.bind(this); + this.onCancel = this.onCancel.bind(this); + } + + async _send() { + try { + const content = JSON.parse(this.refs.evContent.value); + await MatrixClientPeg.get().sendEvent(this.refs.roomId.value, this.refs.eventType.value, content); + this.props.onFinished(true); + } catch (e) { + this.props.onFinished(false); + const ErrorDialog = sdk.getComponent('dialogs.ErrorDialog'); + Modal.createDialog(ErrorDialog, { + title: 'Failed to send custom event', + description: e.toString(), + }); + } + } + + onCancel() { + this.props.onFinished(false); + } + + render() { + return
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+