diff --git a/CHANGELOG.md b/CHANGELOG.md index 870b42ecfc..66e4627afd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +Changes in [0.9.2](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.9.2) (2017-06-06) +=================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.9.1...v0.9.2) + + * Hotfix: Allow password reset when logged in + [\#1044](https://github.com/matrix-org/matrix-react-sdk/pull/1044) + Changes in [0.9.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.9.1) (2017-06-02) =================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.9.0...v0.9.1) diff --git a/package.json b/package.json index 163127e8d1..15a903c25a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "0.9.1", + "version": "0.9.2", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { diff --git a/src/CallMediaHandler.js b/src/CallMediaHandler.js index 45ca5dc30d..839b496845 100644 --- a/src/CallMediaHandler.js +++ b/src/CallMediaHandler.js @@ -16,7 +16,6 @@ import UserSettingsStore from './UserSettingsStore'; import * as Matrix from 'matrix-js-sdk'; -import q from 'q'; export default { getDevices: function() { diff --git a/src/KeyCode.js b/src/KeyCode.js index c9cac01239..28aafc00cb 100644 --- a/src/KeyCode.js +++ b/src/KeyCode.js @@ -32,4 +32,5 @@ module.exports = { DELETE: 46, KEY_D: 68, KEY_E: 69, + KEY_M: 77, }; diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index 452b67c4ee..94e55a8d8a 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -16,7 +16,6 @@ limitations under the License. 'use strict'; -import q from "q"; import Matrix from 'matrix-js-sdk'; import utils from 'matrix-js-sdk/lib/utils'; import EventTimeline from 'matrix-js-sdk/lib/models/event-timeline'; diff --git a/src/Rooms.js b/src/Rooms.js index 08fa7f797f..16b5ab9ee2 100644 --- a/src/Rooms.js +++ b/src/Rooms.js @@ -15,7 +15,6 @@ limitations under the License. */ import MatrixClientPeg from './MatrixClientPeg'; -import DMRoomMap from './utils/DMRoomMap'; import q from 'q'; /** diff --git a/src/ScalarMessaging.js b/src/ScalarMessaging.js index 8c591f7cb2..c1b975e8e8 100644 --- a/src/ScalarMessaging.js +++ b/src/ScalarMessaging.js @@ -94,6 +94,22 @@ Example: } } +get_membership_count +-------------------- +Get the number of joined users in the room. + +Request: + - room_id is the room to get the count in. +Response: +78 +Example: +{ + action: "get_membership_count", + room_id: "!foo:bar", + response: 78 +} + + membership_state AND bot_options -------------------------------- Get the content of the "m.room.member" or "m.room.bot.options" state event respectively. @@ -256,6 +272,21 @@ function botOptions(event, roomId, userId) { returnStateEvent(event, roomId, "m.room.bot.options", "_" + userId); } +function getMembershipCount(event, roomId) { + const client = MatrixClientPeg.get(); + if (!client) { + sendError(event, _t('You need to be logged in.')); + return; + } + const room = client.getRoom(roomId); + if (!room) { + sendError(event, _t('This room is not recognised.')); + return; + } + const count = room.getJoinedMembers().length; + sendResponse(event, count); +} + function returnStateEvent(event, roomId, eventType, stateKey) { const client = MatrixClientPeg.get(); if (!client) { @@ -343,6 +374,9 @@ const onMessage = function(event) { } else if (event.data.action === "set_plumbing_state") { setPlumbingState(event, roomId, event.data.status); return; + } else if (event.data.action === "get_membership_count") { + getMembershipCount(event, roomId); + return; } if (!userId) { diff --git a/src/autocomplete/Components.js b/src/autocomplete/Components.js index b26a217ec6..0f0399cf7d 100644 --- a/src/autocomplete/Components.js +++ b/src/autocomplete/Components.js @@ -15,7 +15,6 @@ limitations under the License. */ import React from 'react'; -import ReactDOM from 'react-dom'; import classNames from 'classnames'; /* These were earlier stateless functional components but had to be converted diff --git a/src/autocomplete/UserProvider.js b/src/autocomplete/UserProvider.js index fedebb3618..809fec94be 100644 --- a/src/autocomplete/UserProvider.js +++ b/src/autocomplete/UserProvider.js @@ -18,7 +18,6 @@ limitations under the License. import React from 'react'; import { _t } from '../languageHandler'; import AutocompleteProvider from './AutocompleteProvider'; -import Q from 'q'; import Fuse from 'fuse.js'; import {PillCompletion} from './Components'; import sdk from '../index'; diff --git a/src/components/structures/CreateRoom.js b/src/components/structures/CreateRoom.js index 8b3d035dc1..3e291dfd94 100644 --- a/src/components/structures/CreateRoom.js +++ b/src/components/structures/CreateRoom.js @@ -17,7 +17,6 @@ limitations under the License. 'use strict'; import React from 'react'; -import q from 'q'; import { _t } from '../../languageHandler'; import sdk from '../../index'; import MatrixClientPeg from '../../MatrixClientPeg'; @@ -247,7 +246,7 @@ module.exports = React.createClass({ return (
- +