Merge branch 'develop' of https://github.com/matrix-org/matrix-react-sdk into develop
This commit is contained in:
commit
617e1eede3
12 changed files with 412 additions and 30 deletions
246
CHANGELOG.md
246
CHANGELOG.md
|
@ -1,3 +1,249 @@
|
||||||
|
Changes in [0.8.7](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.8.7) (2017-04-12)
|
||||||
|
===================================================================================================
|
||||||
|
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.8.7-rc.4...v0.8.7)
|
||||||
|
|
||||||
|
* No changes
|
||||||
|
|
||||||
|
Changes in [0.8.7-rc.4](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.8.7-rc.4) (2017-04-11)
|
||||||
|
=============================================================================================================
|
||||||
|
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.8.7-rc.3...v0.8.7-rc.4)
|
||||||
|
|
||||||
|
* Fix people section vanishing on 'clear cache'
|
||||||
|
[\#799](https://github.com/matrix-org/matrix-react-sdk/pull/799)
|
||||||
|
* Make the clear cache button work on desktop
|
||||||
|
[\#798](https://github.com/matrix-org/matrix-react-sdk/pull/798)
|
||||||
|
|
||||||
|
Changes in [0.8.7-rc.3](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.8.7-rc.3) (2017-04-10)
|
||||||
|
=============================================================================================================
|
||||||
|
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.8.7-rc.2...v0.8.7-rc.3)
|
||||||
|
|
||||||
|
* Use matrix-js-sdk v0.7.6-rc.2
|
||||||
|
|
||||||
|
|
||||||
|
Changes in [0.8.7-rc.2](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.8.7-rc.2) (2017-04-10)
|
||||||
|
=============================================================================================================
|
||||||
|
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.8.7-rc.1...v0.8.7-rc.2)
|
||||||
|
|
||||||
|
* fix the warning shown to users about needing to export e2e keys
|
||||||
|
[\#797](https://github.com/matrix-org/matrix-react-sdk/pull/797)
|
||||||
|
|
||||||
|
Changes in [0.8.7-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.8.7-rc.1) (2017-04-07)
|
||||||
|
=============================================================================================================
|
||||||
|
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.8.6...v0.8.7-rc.1)
|
||||||
|
|
||||||
|
* Add support for using indexeddb in a webworker
|
||||||
|
[\#792](https://github.com/matrix-org/matrix-react-sdk/pull/792)
|
||||||
|
* Fix infinite pagination/glitches with pagination
|
||||||
|
[\#795](https://github.com/matrix-org/matrix-react-sdk/pull/795)
|
||||||
|
* Fix issue where teamTokenMap was ignored for guests
|
||||||
|
[\#793](https://github.com/matrix-org/matrix-react-sdk/pull/793)
|
||||||
|
* Click emote sender -> insert display name into composer
|
||||||
|
[\#791](https://github.com/matrix-org/matrix-react-sdk/pull/791)
|
||||||
|
* Fix scroll token selection logic
|
||||||
|
[\#785](https://github.com/matrix-org/matrix-react-sdk/pull/785)
|
||||||
|
* Replace sdkReady with firstSyncPromise, add mx_last_room_id
|
||||||
|
[\#790](https://github.com/matrix-org/matrix-react-sdk/pull/790)
|
||||||
|
* Change "Unread messages." to "Jump to first unread message."
|
||||||
|
[\#789](https://github.com/matrix-org/matrix-react-sdk/pull/789)
|
||||||
|
* Update for new IndexedDBStore interface
|
||||||
|
[\#786](https://github.com/matrix-org/matrix-react-sdk/pull/786)
|
||||||
|
* Add <ol start="..."> to allowed attributes list
|
||||||
|
[\#787](https://github.com/matrix-org/matrix-react-sdk/pull/787)
|
||||||
|
* Fix the onFinished for timeline pos dialog
|
||||||
|
[\#784](https://github.com/matrix-org/matrix-react-sdk/pull/784)
|
||||||
|
* Only join a room when enter is hit if the join button is shown
|
||||||
|
[\#776](https://github.com/matrix-org/matrix-react-sdk/pull/776)
|
||||||
|
* Remove non-functional session load error
|
||||||
|
[\#783](https://github.com/matrix-org/matrix-react-sdk/pull/783)
|
||||||
|
* Use Login & Register via component interface
|
||||||
|
[\#782](https://github.com/matrix-org/matrix-react-sdk/pull/782)
|
||||||
|
* Attempt to fix the flakyness seen with tests
|
||||||
|
[\#781](https://github.com/matrix-org/matrix-react-sdk/pull/781)
|
||||||
|
* Remove React warning
|
||||||
|
[\#780](https://github.com/matrix-org/matrix-react-sdk/pull/780)
|
||||||
|
* Only clear the local notification count if needed
|
||||||
|
[\#779](https://github.com/matrix-org/matrix-react-sdk/pull/779)
|
||||||
|
* Don't re-notify about messages on browser refresh
|
||||||
|
[\#777](https://github.com/matrix-org/matrix-react-sdk/pull/777)
|
||||||
|
* Improve zeroing of RoomList notification badges
|
||||||
|
[\#775](https://github.com/matrix-org/matrix-react-sdk/pull/775)
|
||||||
|
* Fix VOIP bar hidden on first render of RoomStatusBar
|
||||||
|
[\#774](https://github.com/matrix-org/matrix-react-sdk/pull/774)
|
||||||
|
* Correct confirm prompt for disinvite
|
||||||
|
[\#772](https://github.com/matrix-org/matrix-react-sdk/pull/772)
|
||||||
|
* Add state loggingIn to MatrixChat to fix flashing login
|
||||||
|
[\#773](https://github.com/matrix-org/matrix-react-sdk/pull/773)
|
||||||
|
* Fix bug where you can't invite a valid address
|
||||||
|
[\#771](https://github.com/matrix-org/matrix-react-sdk/pull/771)
|
||||||
|
* Fix people section DropTarget and refactor Rooms
|
||||||
|
[\#761](https://github.com/matrix-org/matrix-react-sdk/pull/761)
|
||||||
|
* Read Receipt offset
|
||||||
|
[\#770](https://github.com/matrix-org/matrix-react-sdk/pull/770)
|
||||||
|
* Support adding phone numbers in UserSettings
|
||||||
|
[\#756](https://github.com/matrix-org/matrix-react-sdk/pull/756)
|
||||||
|
* Prevent crash on login of no guest session
|
||||||
|
[\#769](https://github.com/matrix-org/matrix-react-sdk/pull/769)
|
||||||
|
* Add canResetTimeline callback and thread it through to TimelinePanel
|
||||||
|
[\#768](https://github.com/matrix-org/matrix-react-sdk/pull/768)
|
||||||
|
* Show spinner whilst processing recaptcha response
|
||||||
|
[\#767](https://github.com/matrix-org/matrix-react-sdk/pull/767)
|
||||||
|
* Login / registration with phone number, mark 2
|
||||||
|
[\#750](https://github.com/matrix-org/matrix-react-sdk/pull/750)
|
||||||
|
* Display threepids slightly prettier
|
||||||
|
[\#758](https://github.com/matrix-org/matrix-react-sdk/pull/758)
|
||||||
|
* Fix extraneous leading space in sent emotes
|
||||||
|
[\#764](https://github.com/matrix-org/matrix-react-sdk/pull/764)
|
||||||
|
* Add ConfirmRedactDialog component
|
||||||
|
[\#763](https://github.com/matrix-org/matrix-react-sdk/pull/763)
|
||||||
|
* Fix password UI auth test
|
||||||
|
[\#760](https://github.com/matrix-org/matrix-react-sdk/pull/760)
|
||||||
|
* Display timestamps and profiles for redacted events
|
||||||
|
[\#759](https://github.com/matrix-org/matrix-react-sdk/pull/759)
|
||||||
|
* Fix UDD for voip in e2e rooms
|
||||||
|
[\#757](https://github.com/matrix-org/matrix-react-sdk/pull/757)
|
||||||
|
* Add "Export E2E keys" option to logout dialog
|
||||||
|
[\#755](https://github.com/matrix-org/matrix-react-sdk/pull/755)
|
||||||
|
* Fix People section a bit
|
||||||
|
[\#754](https://github.com/matrix-org/matrix-react-sdk/pull/754)
|
||||||
|
* Do routing to /register _onLoadCompleted
|
||||||
|
[\#753](https://github.com/matrix-org/matrix-react-sdk/pull/753)
|
||||||
|
* Double UNPAGINATION_PADDING again
|
||||||
|
[\#747](https://github.com/matrix-org/matrix-react-sdk/pull/747)
|
||||||
|
* Add null check to start_login
|
||||||
|
[\#751](https://github.com/matrix-org/matrix-react-sdk/pull/751)
|
||||||
|
* Merge the two RoomTile context menus into one
|
||||||
|
[\#746](https://github.com/matrix-org/matrix-react-sdk/pull/746)
|
||||||
|
* Fix import for Lifecycle
|
||||||
|
[\#748](https://github.com/matrix-org/matrix-react-sdk/pull/748)
|
||||||
|
* Make UDD appear when UDE on uploading a file
|
||||||
|
[\#745](https://github.com/matrix-org/matrix-react-sdk/pull/745)
|
||||||
|
* Decide on which screen to show after login in one place
|
||||||
|
[\#743](https://github.com/matrix-org/matrix-react-sdk/pull/743)
|
||||||
|
* Add onClick to permalinks to route within Riot
|
||||||
|
[\#744](https://github.com/matrix-org/matrix-react-sdk/pull/744)
|
||||||
|
* Add support for pasting files into the text box
|
||||||
|
[\#605](https://github.com/matrix-org/matrix-react-sdk/pull/605)
|
||||||
|
* Show message redactions as black event tiles
|
||||||
|
[\#739](https://github.com/matrix-org/matrix-react-sdk/pull/739)
|
||||||
|
* Allow user to choose from existing DMs on new chat
|
||||||
|
[\#736](https://github.com/matrix-org/matrix-react-sdk/pull/736)
|
||||||
|
* Fix the team server registration
|
||||||
|
[\#741](https://github.com/matrix-org/matrix-react-sdk/pull/741)
|
||||||
|
* Clarify "No devices" message
|
||||||
|
[\#740](https://github.com/matrix-org/matrix-react-sdk/pull/740)
|
||||||
|
* Change timestamp permalinks to matrix.to
|
||||||
|
[\#735](https://github.com/matrix-org/matrix-react-sdk/pull/735)
|
||||||
|
* Fix resend bar and "send anyway" in UDD
|
||||||
|
[\#734](https://github.com/matrix-org/matrix-react-sdk/pull/734)
|
||||||
|
* Make COLOR_REGEX stricter
|
||||||
|
[\#737](https://github.com/matrix-org/matrix-react-sdk/pull/737)
|
||||||
|
* Port registration over to use InteractiveAuth
|
||||||
|
[\#729](https://github.com/matrix-org/matrix-react-sdk/pull/729)
|
||||||
|
* Test to see how fuse feels
|
||||||
|
[\#732](https://github.com/matrix-org/matrix-react-sdk/pull/732)
|
||||||
|
* Submit a new display name on blur of input field
|
||||||
|
[\#733](https://github.com/matrix-org/matrix-react-sdk/pull/733)
|
||||||
|
* Allow [bf]g colors for <font> style attrib
|
||||||
|
[\#610](https://github.com/matrix-org/matrix-react-sdk/pull/610)
|
||||||
|
* MELS: either expanded or summary, not both
|
||||||
|
[\#683](https://github.com/matrix-org/matrix-react-sdk/pull/683)
|
||||||
|
* Autoplay videos and GIFs if enabled by the user.
|
||||||
|
[\#730](https://github.com/matrix-org/matrix-react-sdk/pull/730)
|
||||||
|
* Warn users about using e2e for the first time
|
||||||
|
[\#731](https://github.com/matrix-org/matrix-react-sdk/pull/731)
|
||||||
|
* Show UDDialog on UDE during VoIP calls
|
||||||
|
[\#721](https://github.com/matrix-org/matrix-react-sdk/pull/721)
|
||||||
|
* Notify MatrixChat of teamToken after login
|
||||||
|
[\#726](https://github.com/matrix-org/matrix-react-sdk/pull/726)
|
||||||
|
* Fix a couple of issues with RRs
|
||||||
|
[\#727](https://github.com/matrix-org/matrix-react-sdk/pull/727)
|
||||||
|
* Do not push a dummy element with a scroll token for invisible events
|
||||||
|
[\#718](https://github.com/matrix-org/matrix-react-sdk/pull/718)
|
||||||
|
* MELS: check scroll on load + use mels-1,-2,... key
|
||||||
|
[\#715](https://github.com/matrix-org/matrix-react-sdk/pull/715)
|
||||||
|
* Fix message composer placeholders
|
||||||
|
[\#723](https://github.com/matrix-org/matrix-react-sdk/pull/723)
|
||||||
|
* Clarify non-e2e vs. e2e /w composers placeholder
|
||||||
|
[\#720](https://github.com/matrix-org/matrix-react-sdk/pull/720)
|
||||||
|
* Fix status bar expanded on tab-complete
|
||||||
|
[\#722](https://github.com/matrix-org/matrix-react-sdk/pull/722)
|
||||||
|
* add .editorconfig
|
||||||
|
[\#713](https://github.com/matrix-org/matrix-react-sdk/pull/713)
|
||||||
|
* Change the name of the database
|
||||||
|
[\#719](https://github.com/matrix-org/matrix-react-sdk/pull/719)
|
||||||
|
* Allow setting the default HS from the query parameter
|
||||||
|
[\#716](https://github.com/matrix-org/matrix-react-sdk/pull/716)
|
||||||
|
* first cut of improving UX for deleting devices.
|
||||||
|
[\#717](https://github.com/matrix-org/matrix-react-sdk/pull/717)
|
||||||
|
* Fix block quotes all being on a single line
|
||||||
|
[\#711](https://github.com/matrix-org/matrix-react-sdk/pull/711)
|
||||||
|
* Support reasons for kick / ban
|
||||||
|
[\#710](https://github.com/matrix-org/matrix-react-sdk/pull/710)
|
||||||
|
* Show when you've been kicked or banned
|
||||||
|
[\#709](https://github.com/matrix-org/matrix-react-sdk/pull/709)
|
||||||
|
* Add a 'Clear Cache' button
|
||||||
|
[\#708](https://github.com/matrix-org/matrix-react-sdk/pull/708)
|
||||||
|
* Update the room view on room name change
|
||||||
|
[\#707](https://github.com/matrix-org/matrix-react-sdk/pull/707)
|
||||||
|
* Add a button to un-ban users in RoomSettings
|
||||||
|
[\#698](https://github.com/matrix-org/matrix-react-sdk/pull/698)
|
||||||
|
* Use IndexedDBStore from the JS-SDK
|
||||||
|
[\#687](https://github.com/matrix-org/matrix-react-sdk/pull/687)
|
||||||
|
* Make UserSettings use the right teamToken
|
||||||
|
[\#706](https://github.com/matrix-org/matrix-react-sdk/pull/706)
|
||||||
|
* If the home page is somehow accessed, goto directory
|
||||||
|
[\#705](https://github.com/matrix-org/matrix-react-sdk/pull/705)
|
||||||
|
* Display avatar initials in typing notifications
|
||||||
|
[\#699](https://github.com/matrix-org/matrix-react-sdk/pull/699)
|
||||||
|
* fix eslint's no-invalid-this rule for class properties
|
||||||
|
[\#703](https://github.com/matrix-org/matrix-react-sdk/pull/703)
|
||||||
|
* If a referrer hasn't been specified, use empty string
|
||||||
|
[\#701](https://github.com/matrix-org/matrix-react-sdk/pull/701)
|
||||||
|
* Don't force-logout the user if reading localstorage fails
|
||||||
|
[\#700](https://github.com/matrix-org/matrix-react-sdk/pull/700)
|
||||||
|
* Convert some missed buttons to AccessibleButton
|
||||||
|
[\#697](https://github.com/matrix-org/matrix-react-sdk/pull/697)
|
||||||
|
* Make ban either ban or unban
|
||||||
|
[\#696](https://github.com/matrix-org/matrix-react-sdk/pull/696)
|
||||||
|
* Add confirmation dialog to kick/ban buttons
|
||||||
|
[\#694](https://github.com/matrix-org/matrix-react-sdk/pull/694)
|
||||||
|
* Fix typo with Scalar popup
|
||||||
|
[\#695](https://github.com/matrix-org/matrix-react-sdk/pull/695)
|
||||||
|
* Treat the literal team token string "undefined" as undefined
|
||||||
|
[\#693](https://github.com/matrix-org/matrix-react-sdk/pull/693)
|
||||||
|
* Store retrieved sid in the signupInstance of EmailIdentityStage
|
||||||
|
[\#692](https://github.com/matrix-org/matrix-react-sdk/pull/692)
|
||||||
|
* Split out InterActiveAuthDialog
|
||||||
|
[\#691](https://github.com/matrix-org/matrix-react-sdk/pull/691)
|
||||||
|
* View /home on registered /w team
|
||||||
|
[\#689](https://github.com/matrix-org/matrix-react-sdk/pull/689)
|
||||||
|
* Instead of sending userId, userEmail, send sid, client_secret
|
||||||
|
[\#688](https://github.com/matrix-org/matrix-react-sdk/pull/688)
|
||||||
|
* Enable branded URLs again by parsing the path client-side
|
||||||
|
[\#686](https://github.com/matrix-org/matrix-react-sdk/pull/686)
|
||||||
|
* Use new method of getting team icon
|
||||||
|
[\#680](https://github.com/matrix-org/matrix-react-sdk/pull/680)
|
||||||
|
* Persist query parameter team token across refreshes
|
||||||
|
[\#685](https://github.com/matrix-org/matrix-react-sdk/pull/685)
|
||||||
|
* Thread teamToken through to LeftPanel for "Home" button
|
||||||
|
[\#684](https://github.com/matrix-org/matrix-react-sdk/pull/684)
|
||||||
|
* Fix typing notif and status bar
|
||||||
|
[\#682](https://github.com/matrix-org/matrix-react-sdk/pull/682)
|
||||||
|
* Consider emails ending in matrix.org as a uni email
|
||||||
|
[\#681](https://github.com/matrix-org/matrix-react-sdk/pull/681)
|
||||||
|
* Set referrer qp in nextLink
|
||||||
|
[\#679](https://github.com/matrix-org/matrix-react-sdk/pull/679)
|
||||||
|
* Do not set team_token if not returned by RTS on login
|
||||||
|
[\#678](https://github.com/matrix-org/matrix-react-sdk/pull/678)
|
||||||
|
* Get team_token from the RTS on login
|
||||||
|
[\#676](https://github.com/matrix-org/matrix-react-sdk/pull/676)
|
||||||
|
* Quick and dirty support for custom welcome pages
|
||||||
|
[\#550](https://github.com/matrix-org/matrix-react-sdk/pull/550)
|
||||||
|
* RTS Welcome Pages
|
||||||
|
[\#666](https://github.com/matrix-org/matrix-react-sdk/pull/666)
|
||||||
|
* Logging to try to track down riot-web#3148
|
||||||
|
[\#677](https://github.com/matrix-org/matrix-react-sdk/pull/677)
|
||||||
|
|
||||||
Changes in [0.8.6](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.8.6) (2017-02-04)
|
Changes in [0.8.6](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.8.6) (2017-02-04)
|
||||||
===================================================================================================
|
===================================================================================================
|
||||||
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.8.6-rc.3...v0.8.6)
|
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.8.6-rc.3...v0.8.6)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "matrix-react-sdk",
|
"name": "matrix-react-sdk",
|
||||||
"version": "0.8.6",
|
"version": "0.8.7",
|
||||||
"description": "SDK for matrix.org using React",
|
"description": "SDK for matrix.org using React",
|
||||||
"author": "matrix.org",
|
"author": "matrix.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
@ -82,4 +82,12 @@ export default class BasePlatform {
|
||||||
screenCaptureErrorString() {
|
screenCaptureErrorString() {
|
||||||
return "Not implemented";
|
return "Not implemented";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restarts the application, without neccessarily reloading
|
||||||
|
* any application code
|
||||||
|
*/
|
||||||
|
reload() {
|
||||||
|
throw new Error("reload not implemented!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
29
src/Roles.js
Normal file
29
src/Roles.js
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*
|
||||||
|
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.
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
export const LEVEL_ROLE_MAP = {
|
||||||
|
undefined: 'Default',
|
||||||
|
0: 'User',
|
||||||
|
50: 'Moderator',
|
||||||
|
100: 'Admin',
|
||||||
|
};
|
||||||
|
|
||||||
|
export function textualPowerLevel(level, userDefault) {
|
||||||
|
if (LEVEL_ROLE_MAP[level]) {
|
||||||
|
return LEVEL_ROLE_MAP[level] + (level !== undefined ? ` (${level})` : ` (${userDefault})`);
|
||||||
|
} else {
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,6 +17,8 @@ limitations under the License.
|
||||||
var MatrixClientPeg = require("./MatrixClientPeg");
|
var MatrixClientPeg = require("./MatrixClientPeg");
|
||||||
var CallHandler = require("./CallHandler");
|
var CallHandler = require("./CallHandler");
|
||||||
|
|
||||||
|
import * as Roles from './Roles';
|
||||||
|
|
||||||
function textForMemberEvent(ev) {
|
function textForMemberEvent(ev) {
|
||||||
// XXX: SYJS-16 "sender is sometimes null for join messages"
|
// XXX: SYJS-16 "sender is sometimes null for join messages"
|
||||||
var senderName = ev.sender ? ev.sender.name : ev.getSender();
|
var senderName = ev.sender ? ev.sender.name : ev.getSender();
|
||||||
|
@ -182,6 +184,45 @@ function textForEncryptionEvent(event) {
|
||||||
return senderName + " turned on end-to-end encryption (algorithm " + event.getContent().algorithm + ")";
|
return senderName + " turned on end-to-end encryption (algorithm " + event.getContent().algorithm + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Currently will only display a change if a user's power level is changed
|
||||||
|
function textForPowerEvent(event) {
|
||||||
|
const senderName = event.sender ? event.sender.name : event.getSender();
|
||||||
|
if (!event.getPrevContent() || !event.getPrevContent().users) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
const userDefault = event.getContent().users_default || 0;
|
||||||
|
// Construct set of userIds
|
||||||
|
let users = [];
|
||||||
|
Object.keys(event.getContent().users).forEach(
|
||||||
|
(userId) => {
|
||||||
|
if (users.indexOf(userId) === -1) users.push(userId);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
Object.keys(event.getPrevContent().users).forEach(
|
||||||
|
(userId) => {
|
||||||
|
if (users.indexOf(userId) === -1) users.push(userId);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let diff = [];
|
||||||
|
users.forEach((userId) => {
|
||||||
|
// Previous power level
|
||||||
|
const from = event.getPrevContent().users[userId];
|
||||||
|
// Current power level
|
||||||
|
const to = event.getContent().users[userId];
|
||||||
|
if (to !== from) {
|
||||||
|
diff.push(
|
||||||
|
userId +
|
||||||
|
' from ' + Roles.textualPowerLevel(from, userDefault) +
|
||||||
|
' to ' + Roles.textualPowerLevel(to, userDefault)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!diff.length) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return senderName + ' changed the power level of ' + diff.join(', ');
|
||||||
|
}
|
||||||
|
|
||||||
var handlers = {
|
var handlers = {
|
||||||
'm.room.message': textForMessageEvent,
|
'm.room.message': textForMessageEvent,
|
||||||
'm.room.name': textForRoomNameEvent,
|
'm.room.name': textForRoomNameEvent,
|
||||||
|
@ -193,6 +234,7 @@ var handlers = {
|
||||||
'm.room.third_party_invite': textForThreePidInviteEvent,
|
'm.room.third_party_invite': textForThreePidInviteEvent,
|
||||||
'm.room.history_visibility': textForHistoryVisibilityEvent,
|
'm.room.history_visibility': textForHistoryVisibilityEvent,
|
||||||
'm.room.encryption': textForEncryptionEvent,
|
'm.room.encryption': textForEncryptionEvent,
|
||||||
|
'm.room.power_levels': textForPowerEvent,
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
|
@ -106,6 +106,17 @@ export default React.createClass({
|
||||||
var handled = false;
|
var handled = false;
|
||||||
|
|
||||||
switch (ev.keyCode) {
|
switch (ev.keyCode) {
|
||||||
|
case KeyCode.ESCAPE:
|
||||||
|
|
||||||
|
// Implemented this way so possible handling for other pages is neater
|
||||||
|
switch (this.props.page_type) {
|
||||||
|
case PageTypes.UserSettings:
|
||||||
|
this.props.onUserSettingsClose();
|
||||||
|
handled = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
case KeyCode.UP:
|
case KeyCode.UP:
|
||||||
case KeyCode.DOWN:
|
case KeyCode.DOWN:
|
||||||
if (ev.altKey) {
|
if (ev.altKey) {
|
||||||
|
|
|
@ -264,10 +264,10 @@ module.exports = React.createClass({
|
||||||
title: "Sign out?",
|
title: "Sign out?",
|
||||||
description:
|
description:
|
||||||
<div>
|
<div>
|
||||||
For security, logging out will delete any end-to-end encryption keys from this browser,
|
For security, logging out will delete any end-to-end encryption keys from this browser.
|
||||||
making previous encrypted chat history unreadable if you log back in.
|
|
||||||
In future this <a href="https://github.com/vector-im/riot-web/issues/2108">will be improved</a>,
|
If you want to be able to decrypt your conversation history from future Riot sessions,
|
||||||
but for now be warned.
|
please export your room keys for safe-keeping.
|
||||||
</div>,
|
</div>,
|
||||||
button: "Sign out",
|
button: "Sign out",
|
||||||
extraButtons: [
|
extraButtons: [
|
||||||
|
@ -441,10 +441,11 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
_onClearCacheClicked: function() {
|
_onClearCacheClicked: function() {
|
||||||
|
if (!PlatformPeg.get()) return;
|
||||||
|
|
||||||
|
MatrixClientPeg.get().stopClient();
|
||||||
MatrixClientPeg.get().store.deleteAllData().done(() => {
|
MatrixClientPeg.get().store.deleteAllData().done(() => {
|
||||||
// forceReload=false since we don't really need new HTML/JS files
|
PlatformPeg.get().reload();
|
||||||
// we just need to restart the JS runtime.
|
|
||||||
window.location.reload(false);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -93,11 +93,17 @@ module.exports = React.createClass({
|
||||||
description:
|
description:
|
||||||
<div>
|
<div>
|
||||||
Resetting password will currently reset any end-to-end encryption keys on all devices,
|
Resetting password will currently reset any end-to-end encryption keys on all devices,
|
||||||
making encrypted chat history unreadable.
|
making encrypted chat history unreadable, unless you first export your room keys
|
||||||
In future this <a href="https://github.com/vector-im/riot-web/issues/2671">may be improved</a>,
|
and re-import them afterwards.
|
||||||
but for now be warned.
|
In future this <a href="https://github.com/vector-im/riot-web/issues/2671">will be improved</a>.
|
||||||
</div>,
|
</div>,
|
||||||
button: "Continue",
|
button: "Continue",
|
||||||
|
extraButtons: [
|
||||||
|
<button className="mx_Dialog_primary"
|
||||||
|
onClick={this._onExportE2eKeysClicked}>
|
||||||
|
Export E2E room keys
|
||||||
|
</button>
|
||||||
|
],
|
||||||
onFinished: (confirmed) => {
|
onFinished: (confirmed) => {
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
this.submitPasswordReset(
|
this.submitPasswordReset(
|
||||||
|
@ -110,6 +116,18 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_onExportE2eKeysClicked: function() {
|
||||||
|
Modal.createDialogAsync(
|
||||||
|
(cb) => {
|
||||||
|
require.ensure(['../../../async-components/views/dialogs/ExportE2eKeysDialog'], () => {
|
||||||
|
cb(require('../../../async-components/views/dialogs/ExportE2eKeysDialog'));
|
||||||
|
}, "e2e-export");
|
||||||
|
}, {
|
||||||
|
matrixClient: MatrixClientPeg.get(),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
onInputChanged: function(stateKey, ev) {
|
onInputChanged: function(stateKey, ev) {
|
||||||
this.setState({
|
this.setState({
|
||||||
[stateKey]: ev.target.value
|
[stateKey]: ev.target.value
|
||||||
|
|
|
@ -16,17 +16,12 @@ limitations under the License.
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var React = require('react');
|
import React from 'react';
|
||||||
|
import * as Roles from '../../../Roles';
|
||||||
var roles = {
|
|
||||||
0: 'User',
|
|
||||||
50: 'Moderator',
|
|
||||||
100: 'Admin',
|
|
||||||
};
|
|
||||||
|
|
||||||
var reverseRoles = {};
|
var reverseRoles = {};
|
||||||
Object.keys(roles).forEach(function(key) {
|
Object.keys(Roles.LEVEL_ROLE_MAP).forEach(function(key) {
|
||||||
reverseRoles[roles[key]] = key;
|
reverseRoles[Roles.LEVEL_ROLE_MAP[key]] = key;
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
|
@ -49,7 +44,7 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
getInitialState: function() {
|
getInitialState: function() {
|
||||||
return {
|
return {
|
||||||
custom: (roles[this.props.value] === undefined),
|
custom: (Roles.LEVEL_ROLE_MAP[this.props.value] === undefined),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -99,22 +94,34 @@ module.exports = React.createClass({
|
||||||
selectValue = "Custom";
|
selectValue = "Custom";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
selectValue = roles[this.props.value] || "Custom";
|
selectValue = Roles.LEVEL_ROLE_MAP[this.props.value] || "Custom";
|
||||||
}
|
}
|
||||||
var select;
|
var select;
|
||||||
if (this.props.disabled) {
|
if (this.props.disabled) {
|
||||||
select = <span>{ selectValue }</span>;
|
select = <span>{ selectValue }</span>;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// Each level must have a definition in LEVEL_ROLE_MAP
|
||||||
|
const levels = [0, 50, 100];
|
||||||
|
let options = levels.map((level) => {
|
||||||
|
return {
|
||||||
|
value: Roles.LEVEL_ROLE_MAP[level],
|
||||||
|
// Give a userDefault (users_default in the power event) of 0 but
|
||||||
|
// because level !== undefined, this should never be used.
|
||||||
|
text: Roles.textualPowerLevel(level, 0),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
options.push({ value: "Custom", text: "Custom level" });
|
||||||
|
options = options.map((op) => {
|
||||||
|
return <option value={op.value}>{op.text}</option>;
|
||||||
|
});
|
||||||
|
|
||||||
select =
|
select =
|
||||||
<select ref="select"
|
<select ref="select"
|
||||||
value={ this.props.controlled ? selectValue : undefined }
|
value={ this.props.controlled ? selectValue : undefined }
|
||||||
defaultValue={ !this.props.controlled ? selectValue : undefined }
|
defaultValue={ !this.props.controlled ? selectValue : undefined }
|
||||||
onChange={ this.onSelectChange }>
|
onChange={ this.onSelectChange }>
|
||||||
<option value="User">User (0)</option>
|
{ options }
|
||||||
<option value="Moderator">Moderator (50)</option>
|
|
||||||
<option value="Admin">Admin (100)</option>
|
|
||||||
<option value="Custom">Custom level</option>
|
|
||||||
</select>;
|
</select>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,8 @@ module.exports = React.createClass({
|
||||||
links.push(node);
|
links.push(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (node.tagName === "PRE" || node.tagName === "CODE") {
|
else if (node.tagName === "PRE" || node.tagName === "CODE" ||
|
||||||
|
node.tagName === "BLOCKQUOTE") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (node.children && node.children.length) {
|
else if (node.children && node.children.length) {
|
||||||
|
|
|
@ -40,6 +40,7 @@ var eventTileTypes = {
|
||||||
'm.room.third_party_invite' : 'messages.TextualEvent',
|
'm.room.third_party_invite' : 'messages.TextualEvent',
|
||||||
'm.room.history_visibility' : 'messages.TextualEvent',
|
'm.room.history_visibility' : 'messages.TextualEvent',
|
||||||
'm.room.encryption' : 'messages.TextualEvent',
|
'm.room.encryption' : 'messages.TextualEvent',
|
||||||
|
'm.room.power_levels' : 'messages.TextualEvent',
|
||||||
};
|
};
|
||||||
|
|
||||||
var MAX_READ_AVATARS = 5;
|
var MAX_READ_AVATARS = 5;
|
||||||
|
|
|
@ -73,11 +73,17 @@ module.exports = React.createClass({
|
||||||
description:
|
description:
|
||||||
<div>
|
<div>
|
||||||
Changing password will currently reset any end-to-end encryption keys on all devices,
|
Changing password will currently reset any end-to-end encryption keys on all devices,
|
||||||
making encrypted chat history unreadable.
|
making encrypted chat history unreadable, unless you first export your room keys
|
||||||
This will be <a href="https://github.com/vector-im/riot-web/issues/2671">improved shortly</a>,
|
and re-import them afterwards.
|
||||||
but for now be warned.
|
In future this <a href="https://github.com/vector-im/riot-web/issues/2671">will be improved</a>.
|
||||||
</div>,
|
</div>,
|
||||||
button: "Continue",
|
button: "Continue",
|
||||||
|
extraButtons: [
|
||||||
|
<button className="mx_Dialog_primary"
|
||||||
|
onClick={this._onExportE2eKeysClicked}>
|
||||||
|
Export E2E room keys
|
||||||
|
</button>
|
||||||
|
],
|
||||||
onFinished: (confirmed) => {
|
onFinished: (confirmed) => {
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
var authDict = {
|
var authDict = {
|
||||||
|
@ -105,6 +111,18 @@ module.exports = React.createClass({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_onExportE2eKeysClicked: function() {
|
||||||
|
Modal.createDialogAsync(
|
||||||
|
(cb) => {
|
||||||
|
require.ensure(['../../../async-components/views/dialogs/ExportE2eKeysDialog'], () => {
|
||||||
|
cb(require('../../../async-components/views/dialogs/ExportE2eKeysDialog'));
|
||||||
|
}, "e2e-export");
|
||||||
|
}, {
|
||||||
|
matrixClient: MatrixClientPeg.get(),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
onClickChange: function() {
|
onClickChange: function() {
|
||||||
var old_password = this.refs.old_input.value;
|
var old_password = this.refs.old_input.value;
|
||||||
var new_password = this.refs.new_input.value;
|
var new_password = this.refs.new_input.value;
|
||||||
|
|
Loading…
Reference in a new issue