Merge branch 'develop' into t3chguy/mention_user
This commit is contained in:
commit
1d5b4a9d50
26 changed files with 295 additions and 206 deletions
|
@ -116,7 +116,6 @@ const FilePanel = React.createClass({
|
||||||
timelineSet={this.state.timelineSet}
|
timelineSet={this.state.timelineSet}
|
||||||
showUrlPreview = {false}
|
showUrlPreview = {false}
|
||||||
tileShape="file_grid"
|
tileShape="file_grid"
|
||||||
opacity={this.props.opacity}
|
|
||||||
empty={_t('There are no visible files in this room')}
|
empty={_t('There are no visible files in this room')}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
@ -482,8 +482,8 @@ export default React.createClass({
|
||||||
profileForm: Object.assign({}, this.state.summary.profile),
|
profileForm: Object.assign({}, this.state.summary.profile),
|
||||||
});
|
});
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'ui_opacity',
|
action: 'panel_disable',
|
||||||
sideOpacity: 0.3,
|
sideDisabled: true,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ export default React.createClass({
|
||||||
editing: false,
|
editing: false,
|
||||||
profileForm: null,
|
profileForm: null,
|
||||||
});
|
});
|
||||||
dis.dispatch({action: 'ui_opacity'});
|
dis.dispatch({action: 'panel_disable'});
|
||||||
},
|
},
|
||||||
|
|
||||||
_onNameChange: function(value) {
|
_onNameChange: function(value) {
|
||||||
|
@ -549,7 +549,7 @@ export default React.createClass({
|
||||||
editing: false,
|
editing: false,
|
||||||
summary: null,
|
summary: null,
|
||||||
});
|
});
|
||||||
dis.dispatch({action: 'ui_opacity'});
|
dis.dispatch({action: 'panel_disable'});
|
||||||
this._initGroupStore(this.props.groupId);
|
this._initGroupStore(this.props.groupId);
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -787,8 +787,8 @@ export default React.createClass({
|
||||||
</div>;
|
</div>;
|
||||||
} else if (group.myMembership === 'join' && this.state.editing) {
|
} else if (group.myMembership === 'join' && this.state.editing) {
|
||||||
const leaveButtonTooltip = this.state.isUserPrivileged ?
|
const leaveButtonTooltip = this.state.isUserPrivileged ?
|
||||||
_t("You are a member of this community") :
|
_t("You are an administrator of this community") :
|
||||||
_t("You are an administrator of this community");
|
_t("You are a member of this community");
|
||||||
const leaveButtonClasses = classnames({
|
const leaveButtonClasses = classnames({
|
||||||
"mx_RoomHeader_textButton": true,
|
"mx_RoomHeader_textButton": true,
|
||||||
"mx_GroupView_textButton": true,
|
"mx_GroupView_textButton": true,
|
||||||
|
@ -964,6 +964,7 @@ export default React.createClass({
|
||||||
</AccessibleButton>,
|
</AccessibleButton>,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
if (summary.user && summary.user.membership === 'join') {
|
||||||
rightButtons.push(
|
rightButtons.push(
|
||||||
<AccessibleButton className="mx_GroupHeader_button"
|
<AccessibleButton className="mx_GroupHeader_button"
|
||||||
onClick={this._onEditClick} title={_t("Community Settings")} key="_editButton"
|
onClick={this._onEditClick} title={_t("Community Settings")} key="_editButton"
|
||||||
|
@ -971,6 +972,7 @@ export default React.createClass({
|
||||||
<TintableSvg src="img/icons-settings-room.svg" width="16" height="16" />
|
<TintableSvg src="img/icons-settings-room.svg" width="16" height="16" />
|
||||||
</AccessibleButton>,
|
</AccessibleButton>,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
if (this.props.collapsedRhs) {
|
if (this.props.collapsedRhs) {
|
||||||
rightButtons.push(
|
rightButtons.push(
|
||||||
<AccessibleButton className="mx_GroupHeader_button"
|
<AccessibleButton className="mx_GroupHeader_button"
|
||||||
|
|
|
@ -240,11 +240,13 @@ export default React.createClass({
|
||||||
oobData={this.props.roomOobData}
|
oobData={this.props.roomOobData}
|
||||||
eventPixelOffset={this.props.initialEventPixelOffset}
|
eventPixelOffset={this.props.initialEventPixelOffset}
|
||||||
key={this.props.currentRoomId || 'roomview'}
|
key={this.props.currentRoomId || 'roomview'}
|
||||||
opacity={this.props.middleOpacity}
|
disabled={this.props.middleDisabled}
|
||||||
collapsedRhs={this.props.collapseRhs}
|
collapsedRhs={this.props.collapseRhs}
|
||||||
ConferenceHandler={this.props.ConferenceHandler}
|
ConferenceHandler={this.props.ConferenceHandler}
|
||||||
/>;
|
/>;
|
||||||
if (!this.props.collapseRhs) right_panel = <RightPanel roomId={this.props.currentRoomId} opacity={this.props.rightOpacity} />;
|
if (!this.props.collapseRhs) {
|
||||||
|
right_panel = <RightPanel roomId={this.props.currentRoomId} disabled={this.props.rightDisabled} />;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PageTypes.UserSettings:
|
case PageTypes.UserSettings:
|
||||||
|
@ -254,7 +256,7 @@ export default React.createClass({
|
||||||
referralBaseUrl={this.props.config.referralBaseUrl}
|
referralBaseUrl={this.props.config.referralBaseUrl}
|
||||||
teamToken={this.props.teamToken}
|
teamToken={this.props.teamToken}
|
||||||
/>;
|
/>;
|
||||||
if (!this.props.collapseRhs) right_panel = <RightPanel opacity={this.props.rightOpacity} />;
|
if (!this.props.collapseRhs) right_panel = <RightPanel disabled={this.props.rightDisabled} />;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PageTypes.MyGroups:
|
case PageTypes.MyGroups:
|
||||||
|
@ -266,7 +268,7 @@ export default React.createClass({
|
||||||
onRoomCreated={this.props.onRoomCreated}
|
onRoomCreated={this.props.onRoomCreated}
|
||||||
collapsedRhs={this.props.collapseRhs}
|
collapsedRhs={this.props.collapseRhs}
|
||||||
/>;
|
/>;
|
||||||
if (!this.props.collapseRhs) right_panel = <RightPanel opacity={this.props.rightOpacity} />;
|
if (!this.props.collapseRhs) right_panel = <RightPanel disabled={this.props.rightDisabled} />;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PageTypes.RoomDirectory:
|
case PageTypes.RoomDirectory:
|
||||||
|
@ -294,14 +296,14 @@ export default React.createClass({
|
||||||
|
|
||||||
case PageTypes.UserView:
|
case PageTypes.UserView:
|
||||||
page_element = null; // deliberately null for now
|
page_element = null; // deliberately null for now
|
||||||
right_panel = <RightPanel opacity={this.props.rightOpacity} />;
|
right_panel = <RightPanel disabled={this.props.rightDisabled} />;
|
||||||
break;
|
break;
|
||||||
case PageTypes.GroupView:
|
case PageTypes.GroupView:
|
||||||
page_element = <GroupView
|
page_element = <GroupView
|
||||||
groupId={this.props.currentGroupId}
|
groupId={this.props.currentGroupId}
|
||||||
collapsedRhs={this.props.collapseRhs}
|
collapsedRhs={this.props.collapseRhs}
|
||||||
/>;
|
/>;
|
||||||
if (!this.props.collapseRhs) right_panel = <RightPanel groupId={this.props.currentGroupId} opacity={this.props.rightOpacity} />;
|
if (!this.props.collapseRhs) right_panel = <RightPanel groupId={this.props.currentGroupId} disabled={this.props.rightDisabled} />;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,7 +336,7 @@ export default React.createClass({
|
||||||
<LeftPanel
|
<LeftPanel
|
||||||
selectedRoom={this.props.currentRoomId}
|
selectedRoom={this.props.currentRoomId}
|
||||||
collapsed={this.props.collapseLhs || false}
|
collapsed={this.props.collapseLhs || false}
|
||||||
opacity={this.props.leftOpacity}
|
disabled={this.props.leftDisabled}
|
||||||
/>
|
/>
|
||||||
<main className='mx_MatrixChat_middlePanel'>
|
<main className='mx_MatrixChat_middlePanel'>
|
||||||
{ page_element }
|
{ page_element }
|
||||||
|
|
|
@ -145,9 +145,9 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
collapseLhs: false,
|
collapseLhs: false,
|
||||||
collapseRhs: false,
|
collapseRhs: false,
|
||||||
leftOpacity: 1.0,
|
leftDisabled: false,
|
||||||
middleOpacity: 1.0,
|
middleDisabled: false,
|
||||||
rightOpacity: 1.0,
|
rightDisabled: false,
|
||||||
|
|
||||||
version: null,
|
version: null,
|
||||||
newVersion: null,
|
newVersion: null,
|
||||||
|
@ -534,12 +534,11 @@ module.exports = React.createClass({
|
||||||
collapseRhs: false,
|
collapseRhs: false,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'ui_opacity': {
|
case 'panel_disable': {
|
||||||
const sideDefault = payload.sideOpacity >= 0.0 ? payload.sideOpacity : 1.0;
|
|
||||||
this.setState({
|
this.setState({
|
||||||
leftOpacity: payload.leftOpacity >= 0.0 ? payload.leftOpacity : sideDefault,
|
leftDisabled: payload.leftDisabled || payload.sideDisabled || false,
|
||||||
middleOpacity: payload.middleOpacity || 1.0,
|
middleDisabled: payload.middleDisabled || false,
|
||||||
rightOpacity: payload.rightOpacity >= 0.0 ? payload.rightOpacity : sideDefault,
|
rightDisabled: payload.rightDisabled || payload.sideDisabled || false,
|
||||||
});
|
});
|
||||||
break; }
|
break; }
|
||||||
case 'set_theme':
|
case 'set_theme':
|
||||||
|
|
|
@ -16,6 +16,7 @@ limitations under the License.
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
|
import classNames from 'classnames';
|
||||||
import UserSettingsStore from '../../UserSettingsStore';
|
import UserSettingsStore from '../../UserSettingsStore';
|
||||||
import shouldHideEvent from '../../shouldHideEvent';
|
import shouldHideEvent from '../../shouldHideEvent';
|
||||||
import dis from "../../dispatcher";
|
import dis from "../../dispatcher";
|
||||||
|
@ -78,9 +79,6 @@ module.exports = React.createClass({
|
||||||
// callback which is called when more content is needed.
|
// callback which is called when more content is needed.
|
||||||
onFillRequest: React.PropTypes.func,
|
onFillRequest: React.PropTypes.func,
|
||||||
|
|
||||||
// opacity for dynamic UI fading effects
|
|
||||||
opacity: React.PropTypes.number,
|
|
||||||
|
|
||||||
// className for the panel
|
// className for the panel
|
||||||
className: React.PropTypes.string.isRequired,
|
className: React.PropTypes.string.isRequired,
|
||||||
|
|
||||||
|
@ -353,7 +351,7 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isMembershipChange(collapsedMxEv) ||
|
if (!isMembershipChange(collapsedMxEv) ||
|
||||||
this._wantsDateSeparator(this.props.events[i], collapsedMxEv.getDate())) {
|
this._wantsDateSeparator(mxEv, collapsedMxEv.getDate())) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,9 +374,7 @@ module.exports = React.createClass({
|
||||||
// of MemberEventListSummary, render each member event as if the previous
|
// of MemberEventListSummary, render each member event as if the previous
|
||||||
// one was itself. This way, the timestamp of the previous event === the
|
// one was itself. This way, the timestamp of the previous event === the
|
||||||
// timestamp of the current event, and no DateSeperator is inserted.
|
// timestamp of the current event, and no DateSeperator is inserted.
|
||||||
const ret = this._getTilesForEvent(e, e, e === lastShownEvent);
|
return this._getTilesForEvent(e, e, e === lastShownEvent);
|
||||||
prevEvent = e;
|
|
||||||
return ret;
|
|
||||||
}).reduce((a, b) => a.concat(b));
|
}).reduce((a, b) => a.concat(b));
|
||||||
|
|
||||||
if (eventTiles.length === 0) {
|
if (eventTiles.length === 0) {
|
||||||
|
@ -397,6 +393,7 @@ module.exports = React.createClass({
|
||||||
ret.push(this._getReadMarkerTile(visible));
|
ret.push(this._getReadMarkerTile(visible));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prevEvent = mxEv;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -649,12 +646,13 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
const style = this.props.hidden ? { display: 'none' } : {};
|
const style = this.props.hidden ? { display: 'none' } : {};
|
||||||
style.opacity = this.props.opacity;
|
|
||||||
|
|
||||||
let className = this.props.className + " mx_fadable";
|
const className = classNames(
|
||||||
if (this.props.alwaysShowTimestamps) {
|
this.props.className,
|
||||||
className += " mx_MessagePanel_alwaysShowTimestamps";
|
{
|
||||||
}
|
"mx_MessagePanel_alwaysShowTimestamps": this.props.alwaysShowTimestamps,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScrollPanel ref="scrollPanel" className={className}
|
<ScrollPanel ref="scrollPanel" className={className}
|
||||||
|
|
|
@ -45,7 +45,6 @@ const NotificationPanel = React.createClass({
|
||||||
manageReadMarkers={false}
|
manageReadMarkers={false}
|
||||||
timelineSet={timelineSet}
|
timelineSet={timelineSet}
|
||||||
showUrlPreview = {false}
|
showUrlPreview = {false}
|
||||||
opacity={this.props.opacity}
|
|
||||||
tileShape="notif"
|
tileShape="notif"
|
||||||
empty={_t('You have no visible notifications')}
|
empty={_t('You have no visible notifications')}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1697,7 +1697,7 @@ module.exports = React.createClass({
|
||||||
onResize={this.onChildResize}
|
onResize={this.onChildResize}
|
||||||
uploadFile={this.uploadFile}
|
uploadFile={this.uploadFile}
|
||||||
callState={this.state.callState}
|
callState={this.state.callState}
|
||||||
opacity={this.props.opacity}
|
disabled={this.props.disabled}
|
||||||
showApps={this.state.showApps}
|
showApps={this.state.showApps}
|
||||||
/>;
|
/>;
|
||||||
}
|
}
|
||||||
|
@ -1758,7 +1758,6 @@ module.exports = React.createClass({
|
||||||
className="mx_RoomView_messagePanel mx_RoomView_searchResultsPanel"
|
className="mx_RoomView_messagePanel mx_RoomView_searchResultsPanel"
|
||||||
onFillRequest={this.onSearchResultsFillRequest}
|
onFillRequest={this.onSearchResultsFillRequest}
|
||||||
onResize={this.onSearchResultsResize}
|
onResize={this.onSearchResultsResize}
|
||||||
style={{ opacity: this.props.opacity }}
|
|
||||||
>
|
>
|
||||||
<li className={scrollheader_classes}></li>
|
<li className={scrollheader_classes}></li>
|
||||||
{ this.getSearchResultTiles() }
|
{ this.getSearchResultTiles() }
|
||||||
|
@ -1789,7 +1788,6 @@ module.exports = React.createClass({
|
||||||
onScroll={this.onMessageListScroll}
|
onScroll={this.onMessageListScroll}
|
||||||
onReadMarkerUpdated={this._updateTopUnreadMessagesBar}
|
onReadMarkerUpdated={this._updateTopUnreadMessagesBar}
|
||||||
showUrlPreview = {this.state.showUrlPreview}
|
showUrlPreview = {this.state.showUrlPreview}
|
||||||
opacity={this.props.opacity}
|
|
||||||
className="mx_RoomView_messagePanel"
|
className="mx_RoomView_messagePanel"
|
||||||
/>);
|
/>);
|
||||||
|
|
||||||
|
@ -1797,7 +1795,7 @@ module.exports = React.createClass({
|
||||||
if (this.state.showTopUnreadMessagesBar) {
|
if (this.state.showTopUnreadMessagesBar) {
|
||||||
const TopUnreadMessagesBar = sdk.getComponent('rooms.TopUnreadMessagesBar');
|
const TopUnreadMessagesBar = sdk.getComponent('rooms.TopUnreadMessagesBar');
|
||||||
topUnreadMessagesBar = (
|
topUnreadMessagesBar = (
|
||||||
<div className="mx_RoomView_topUnreadMessagesBar mx_fadable" style={{ opacity: this.props.opacity }}>
|
<div className="mx_RoomView_topUnreadMessagesBar">
|
||||||
<TopUnreadMessagesBar
|
<TopUnreadMessagesBar
|
||||||
onScrollUpClick={this.jumpToReadMarker}
|
onScrollUpClick={this.jumpToReadMarker}
|
||||||
onCloseClick={this.forgetReadMarker}
|
onCloseClick={this.forgetReadMarker}
|
||||||
|
@ -1805,10 +1803,19 @@ module.exports = React.createClass({
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
let statusBarAreaClass = "mx_RoomView_statusArea mx_fadable";
|
const statusBarAreaClass = classNames(
|
||||||
if (isStatusAreaExpanded) {
|
"mx_RoomView_statusArea",
|
||||||
statusBarAreaClass += " mx_RoomView_statusArea_expanded";
|
{
|
||||||
}
|
"mx_RoomView_statusArea_expanded": isStatusAreaExpanded,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const fadableSectionClasses = classNames(
|
||||||
|
"mx_RoomView_body", "mx_fadable",
|
||||||
|
{
|
||||||
|
"mx_fadable_faded": this.props.disabled,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={"mx_RoomView" + (inCall ? " mx_RoomView_inCall" : "")} ref="roomView">
|
<div className={"mx_RoomView" + (inCall ? " mx_RoomView_inCall" : "")} ref="roomView">
|
||||||
|
@ -1827,10 +1834,11 @@ module.exports = React.createClass({
|
||||||
onLeaveClick={(myMember && myMember.membership === "join") ? this.onLeaveClick : null}
|
onLeaveClick={(myMember && myMember.membership === "join") ? this.onLeaveClick : null}
|
||||||
/>
|
/>
|
||||||
{ auxPanel }
|
{ auxPanel }
|
||||||
|
<div className={fadableSectionClasses}>
|
||||||
{ topUnreadMessagesBar }
|
{ topUnreadMessagesBar }
|
||||||
{ messagePanel }
|
{ messagePanel }
|
||||||
{ searchResultsPanel }
|
{ searchResultsPanel }
|
||||||
<div className={statusBarAreaClass} style={{opacity: this.props.opacity}}>
|
<div className={statusBarAreaClass}>
|
||||||
<div className="mx_RoomView_statusAreaBox">
|
<div className="mx_RoomView_statusAreaBox">
|
||||||
<div className="mx_RoomView_statusAreaBox_line"></div>
|
<div className="mx_RoomView_statusAreaBox_line"></div>
|
||||||
{ statusBar }
|
{ statusBar }
|
||||||
|
@ -1838,6 +1846,7 @@ module.exports = React.createClass({
|
||||||
</div>
|
</div>
|
||||||
{ messageComposer }
|
{ messageComposer }
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -89,9 +89,6 @@ var TimelinePanel = React.createClass({
|
||||||
// callback which is called when the read-up-to mark is updated.
|
// callback which is called when the read-up-to mark is updated.
|
||||||
onReadMarkerUpdated: React.PropTypes.func,
|
onReadMarkerUpdated: React.PropTypes.func,
|
||||||
|
|
||||||
// opacity for dynamic UI fading effects
|
|
||||||
opacity: React.PropTypes.number,
|
|
||||||
|
|
||||||
// maximum number of events to show in a timeline
|
// maximum number of events to show in a timeline
|
||||||
timelineCap: React.PropTypes.number,
|
timelineCap: React.PropTypes.number,
|
||||||
|
|
||||||
|
@ -1157,7 +1154,6 @@ var TimelinePanel = React.createClass({
|
||||||
onScroll={this.onMessageListScroll}
|
onScroll={this.onMessageListScroll}
|
||||||
onFillRequest={this.onMessageListFillRequest}
|
onFillRequest={this.onMessageListFillRequest}
|
||||||
onUnfillRequest={this.onMessageListUnfillRequest}
|
onUnfillRequest={this.onMessageListUnfillRequest}
|
||||||
opacity={this.props.opacity}
|
|
||||||
isTwelveHour={this.state.isTwelveHour}
|
isTwelveHour={this.state.isTwelveHour}
|
||||||
alwaysShowTimestamps={this.state.alwaysShowTimestamps}
|
alwaysShowTimestamps={this.state.alwaysShowTimestamps}
|
||||||
className={this.props.className}
|
className={this.props.className}
|
||||||
|
|
|
@ -118,6 +118,10 @@ const SETTINGS_LABELS = [
|
||||||
id: 'TextualBody.disableBigEmoji',
|
id: 'TextualBody.disableBigEmoji',
|
||||||
label: _td('Disable big emoji in chat'),
|
label: _td('Disable big emoji in chat'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'VideoView.flipVideoHorizontally',
|
||||||
|
label: _td('Mirror local video feed'),
|
||||||
|
},
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
id: 'useFixedWidthFont',
|
id: 'useFixedWidthFont',
|
||||||
|
@ -271,9 +275,9 @@ module.exports = React.createClass({
|
||||||
MatrixClientPeg.get().on("RoomMember.membership", this._onInviteStateChange);
|
MatrixClientPeg.get().on("RoomMember.membership", this._onInviteStateChange);
|
||||||
|
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'ui_opacity',
|
action: 'panel_disable',
|
||||||
sideOpacity: 0.3,
|
sideDisabled: true,
|
||||||
middleOpacity: 0.3,
|
middleDisabled: true,
|
||||||
});
|
});
|
||||||
this._refreshFromServer();
|
this._refreshFromServer();
|
||||||
|
|
||||||
|
@ -311,9 +315,9 @@ module.exports = React.createClass({
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
this._unmounted = true;
|
this._unmounted = true;
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'ui_opacity',
|
action: 'panel_disable',
|
||||||
sideOpacity: 1.0,
|
sideDisabled: false,
|
||||||
middleOpacity: 1.0,
|
middleDisabled: false,
|
||||||
});
|
});
|
||||||
dis.unregister(this.dispatcherRef);
|
dis.unregister(this.dispatcherRef);
|
||||||
const cli = MatrixClientPeg.get();
|
const cli = MatrixClientPeg.get();
|
||||||
|
@ -1328,8 +1332,11 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
<div className="mx_UserSettings_avatarPicker">
|
<div className="mx_UserSettings_avatarPicker">
|
||||||
<div className="mx_UserSettings_avatarPicker_remove" onClick={this.onAvatarRemoveClick}>
|
<div className="mx_UserSettings_avatarPicker_remove" onClick={this.onAvatarRemoveClick}>
|
||||||
<img src="img/cancel.svg" width="15" height="15"
|
<img src="img/cancel.svg"
|
||||||
alt={_t("Remove avatar")} title={_t("Remove avatar")} />
|
width="15" height="15"
|
||||||
|
className="mx_filterFlipColor"
|
||||||
|
alt={_t("Remove avatar")}
|
||||||
|
title={_t("Remove avatar")} />
|
||||||
</div>
|
</div>
|
||||||
<div onClick={this.onAvatarPickerClick} className="mx_UserSettings_avatarPicker_imgContainer">
|
<div onClick={this.onAvatarPickerClick} className="mx_UserSettings_avatarPicker_imgContainer">
|
||||||
<ChangeAvatar ref="changeAvatar" initialAvatarUrl={avatarUrl}
|
<ChangeAvatar ref="changeAvatar" initialAvatarUrl={avatarUrl}
|
||||||
|
|
|
@ -272,20 +272,27 @@ module.exports = React.createClass({
|
||||||
const topicEvent = room.currentState.getStateEvents('m.room.topic', '');
|
const topicEvent = room.currentState.getStateEvents('m.room.topic', '');
|
||||||
const name = nameEvent ? nameEvent.getContent().name : '';
|
const name = nameEvent ? nameEvent.getContent().name : '';
|
||||||
const canonicalAlias = room.getCanonicalAlias();
|
const canonicalAlias = room.getCanonicalAlias();
|
||||||
|
const aliasEvents = room.currentState.getStateEvents('m.room.aliases');
|
||||||
|
const aliases = aliasEvents.map((ev) => ev.getContent().aliases).reduce((a, b) => {
|
||||||
|
return a.concat(b);
|
||||||
|
}, []);
|
||||||
const topic = topicEvent ? topicEvent.getContent().topic : '';
|
const topic = topicEvent ? topicEvent.getContent().topic : '';
|
||||||
|
|
||||||
const nameMatch = (name || '').toLowerCase().includes(lowerCaseQuery);
|
const nameMatch = (name || '').toLowerCase().includes(lowerCaseQuery);
|
||||||
const aliasMatch = (canonicalAlias || '').toLowerCase().includes(lowerCaseQuery);
|
const aliasMatch = aliases.some((alias) =>
|
||||||
|
(alias || '').toLowerCase().includes(lowerCaseQuery),
|
||||||
|
);
|
||||||
const topicMatch = (topic || '').toLowerCase().includes(lowerCaseQuery);
|
const topicMatch = (topic || '').toLowerCase().includes(lowerCaseQuery);
|
||||||
if (!(nameMatch || topicMatch || aliasMatch)) {
|
if (!(nameMatch || topicMatch || aliasMatch)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const avatarEvent = room.currentState.getStateEvents('m.room.avatar', '');
|
const avatarEvent = room.currentState.getStateEvents('m.room.avatar', '');
|
||||||
const avatarUrl = avatarEvent ? avatarEvent.getContent().url : undefined;
|
const avatarUrl = avatarEvent ? avatarEvent.getContent().url : undefined;
|
||||||
|
|
||||||
results.push({
|
results.push({
|
||||||
room_id: room.roomId,
|
room_id: room.roomId,
|
||||||
avatar_url: avatarUrl,
|
avatar_url: avatarUrl,
|
||||||
name: name || canonicalAlias,
|
name: name || canonicalAlias || aliases[0] || _t('Unnamed Room'),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this._processResults(results, query);
|
this._processResults(results, query);
|
||||||
|
|
|
@ -172,19 +172,30 @@ export default React.createClass({
|
||||||
*/
|
*/
|
||||||
_onDeleteClick: function() {
|
_onDeleteClick: function() {
|
||||||
if (this._canUserModify()) {
|
if (this._canUserModify()) {
|
||||||
console.log("Delete widget %s", this.props.id);
|
// Show delete confirmation dialog
|
||||||
|
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
|
Modal.createTrackedDialog('Delete Widget', '', QuestionDialog, {
|
||||||
|
title: _t("Delete Widget"),
|
||||||
|
description: _t(
|
||||||
|
"Deleting a widget removes it for all users in this room." +
|
||||||
|
" Are you sure you want to delete this widget?"),
|
||||||
|
button: _t("Delete widget"),
|
||||||
|
onFinished: (confirmed) => {
|
||||||
|
if (!confirmed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.setState({deleting: true});
|
this.setState({deleting: true});
|
||||||
MatrixClientPeg.get().sendStateEvent(
|
MatrixClientPeg.get().sendStateEvent(
|
||||||
this.props.room.roomId,
|
this.props.room.roomId,
|
||||||
'im.vector.modular.widgets',
|
'im.vector.modular.widgets',
|
||||||
{}, // empty content
|
{}, // empty content
|
||||||
this.props.id,
|
this.props.id,
|
||||||
).then(() => {
|
).catch((e) => {
|
||||||
console.log('Deleted widget');
|
|
||||||
}, (e) => {
|
|
||||||
console.error('Failed to delete widget', e);
|
console.error('Failed to delete widget', e);
|
||||||
this.setState({deleting: false});
|
this.setState({deleting: false});
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log("Revoke widget permissions - %s", this.props.id);
|
console.log("Revoke widget permissions - %s", this.props.id);
|
||||||
this._revokeWidgetPermission();
|
this._revokeWidgetPermission();
|
||||||
|
@ -305,7 +316,7 @@ export default React.createClass({
|
||||||
let deleteIcon = 'img/cancel.svg';
|
let deleteIcon = 'img/cancel.svg';
|
||||||
let deleteClasses = 'mx_filterFlipColor mx_AppTileMenuBarWidget';
|
let deleteClasses = 'mx_filterFlipColor mx_AppTileMenuBarWidget';
|
||||||
if(this._canUserModify()) {
|
if(this._canUserModify()) {
|
||||||
deleteIcon = 'img/cancel-red.svg';
|
deleteIcon = 'img/icon-delete-pink.svg';
|
||||||
deleteClasses += ' mx_AppTileMenuBarWidgetDelete';
|
deleteClasses += ' mx_AppTileMenuBarWidgetDelete';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,8 @@ module.exports = React.createClass({
|
||||||
onItemAdded: PropTypes.func,
|
onItemAdded: PropTypes.func,
|
||||||
onItemEdited: PropTypes.func,
|
onItemEdited: PropTypes.func,
|
||||||
onItemRemoved: PropTypes.func,
|
onItemRemoved: PropTypes.func,
|
||||||
|
|
||||||
|
canEdit: PropTypes.bool,
|
||||||
},
|
},
|
||||||
|
|
||||||
getDefaultProps: function() {
|
getDefaultProps: function() {
|
||||||
|
@ -136,6 +138,7 @@ module.exports = React.createClass({
|
||||||
{ label }
|
{ label }
|
||||||
</div>
|
</div>
|
||||||
{ editableItems }
|
{ editableItems }
|
||||||
|
{ this.props.canEdit ?
|
||||||
<EditableItem
|
<EditableItem
|
||||||
key={-1}
|
key={-1}
|
||||||
initialValue={this.props.newItem}
|
initialValue={this.props.newItem}
|
||||||
|
@ -143,7 +146,8 @@ module.exports = React.createClass({
|
||||||
onChange={this.onNewItemChanged}
|
onChange={this.onNewItemChanged}
|
||||||
addOnChange={true}
|
addOnChange={true}
|
||||||
placeholder={this.props.placeholder}
|
placeholder={this.props.placeholder}
|
||||||
/>
|
/> : <div />
|
||||||
|
}
|
||||||
</div>);
|
</div>);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -173,7 +173,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
<div className="mx_MemberInfo">
|
<div className="mx_MemberInfo">
|
||||||
<GeminiScrollbar autoshow={true}>
|
<GeminiScrollbar autoshow={true}>
|
||||||
<AccessibleButton className="mx_MemberInfo_cancel"onClick={this._onCancel}>
|
<AccessibleButton className="mx_MemberInfo_cancel"onClick={this._onCancel}>
|
||||||
<img src="img/cancel.svg" width="18" height="18" />
|
<img src="img/cancel.svg" width="18" height="18" className="mx_filterFlipColor" />
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
<div className="mx_MemberInfo_avatar">
|
<div className="mx_MemberInfo_avatar">
|
||||||
{ avatar }
|
{ avatar }
|
||||||
|
|
|
@ -120,8 +120,11 @@ const GroupRoomTile = React.createClass({
|
||||||
<div className="mx_GroupRoomTile_name">
|
<div className="mx_GroupRoomTile_name">
|
||||||
{ this.state.name }
|
{ this.state.name }
|
||||||
</div>
|
</div>
|
||||||
<AccessibleButton className="mx_GroupRoomTile_delete" onClick={this.onDeleteClick}>
|
<AccessibleButton className="mx_GroupRoomTile_delete"
|
||||||
<img src="img/cancel-small.svg" />
|
onClick={this.onDeleteClick}
|
||||||
|
tooltip={_t("Remove this room from the community")}
|
||||||
|
>
|
||||||
|
<img src="img/cancel.svg" width="15" height="15" className="mx_filterFlipColor" />
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
);
|
);
|
||||||
|
|
|
@ -25,7 +25,10 @@ module.exports = React.createClass({
|
||||||
render: function() {
|
render: function() {
|
||||||
let tooltip = _t("Removed or unknown message type");
|
let tooltip = _t("Removed or unknown message type");
|
||||||
if (this.props.mxEvent.isRedacted()) {
|
if (this.props.mxEvent.isRedacted()) {
|
||||||
tooltip = _t("Message removed by %(userId)s", {userId: this.props.mxEvent.getSender()});
|
const redactedBecauseUserId = this.props.mxEvent.getUnsigned().redacted_because.sender;
|
||||||
|
tooltip = redactedBecauseUserId ?
|
||||||
|
_t("Message removed by %(userId)s", { userId: redactedBecauseUserId }) :
|
||||||
|
_t("Message removed");
|
||||||
}
|
}
|
||||||
|
|
||||||
const text = this.props.mxEvent.getContent().body;
|
const text = this.props.mxEvent.getContent().body;
|
||||||
|
|
|
@ -262,6 +262,7 @@ module.exports = React.createClass({
|
||||||
items={this.state.domainToAliases[localDomain] || []}
|
items={this.state.domainToAliases[localDomain] || []}
|
||||||
newItem={this.state.newAlias}
|
newItem={this.state.newAlias}
|
||||||
onNewItemChanged={this.onNewAliasChanged}
|
onNewItemChanged={this.onNewAliasChanged}
|
||||||
|
canEdit={this.props.canSetAliases}
|
||||||
onItemAdded={this.onLocalAliasAdded}
|
onItemAdded={this.onLocalAliasAdded}
|
||||||
onItemEdited={this.onLocalAliasChanged}
|
onItemEdited={this.onLocalAliasChanged}
|
||||||
onItemRemoved={this.onLocalAliasDeleted}
|
onItemRemoved={this.onLocalAliasDeleted}
|
||||||
|
|
|
@ -27,7 +27,7 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
roomId: React.PropTypes.string.isRequired,
|
roomId: React.PropTypes.string.isRequired,
|
||||||
canSetRelatedRooms: React.PropTypes.bool.isRequired,
|
canSetRelatedGroups: React.PropTypes.bool.isRequired,
|
||||||
relatedGroupsEvent: React.PropTypes.instanceOf(MatrixEvent),
|
relatedGroupsEvent: React.PropTypes.instanceOf(MatrixEvent),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
getDefaultProps: function() {
|
getDefaultProps: function() {
|
||||||
return {
|
return {
|
||||||
canSetRelatedRooms: false,
|
canSetRelatedGroups: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -110,6 +110,7 @@ module.exports = React.createClass({
|
||||||
items={this.state.newGroupsList}
|
items={this.state.newGroupsList}
|
||||||
className={"mx_RelatedGroupSettings"}
|
className={"mx_RelatedGroupSettings"}
|
||||||
newItem={this.state.newGroupId}
|
newItem={this.state.newGroupId}
|
||||||
|
canEdit={this.props.canSetRelatedGroups}
|
||||||
onNewItemChanged={this.onNewGroupChanged}
|
onNewItemChanged={this.onNewGroupChanged}
|
||||||
onItemAdded={this.onGroupAdded}
|
onItemAdded={this.onGroupAdded}
|
||||||
onItemEdited={this.onGroupEdited}
|
onItemEdited={this.onGroupEdited}
|
||||||
|
|
|
@ -30,10 +30,9 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'ui_opacity',
|
action: 'panel_disable',
|
||||||
leftOpacity: 1.0,
|
rightDisabled: true,
|
||||||
rightOpacity: 0.3,
|
middleDisabled: true,
|
||||||
middleOpacity: 0.5,
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -43,9 +42,9 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'ui_opacity',
|
action: 'panel_disable',
|
||||||
sideOpacity: 1.0,
|
sideDisabled: false,
|
||||||
middleOpacity: 1.0,
|
middleDisabled: false,
|
||||||
});
|
});
|
||||||
document.removeEventListener('keydown', this._onKeyDown);
|
document.removeEventListener('keydown', this._onKeyDown);
|
||||||
},
|
},
|
||||||
|
|
|
@ -133,7 +133,8 @@ module.exports = React.createClass({
|
||||||
{ p["og:description"] }
|
{ p["og:description"] }
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<img className="mx_LinkPreviewWidget_cancel" src="img/cancel.svg" width="18" height="18"
|
<img className="mx_LinkPreviewWidget_cancel mx_filterFlipColor"
|
||||||
|
src="img/cancel.svg" width="18" height="18"
|
||||||
onClick={this.props.onCancelClick} />
|
onClick={this.props.onCancelClick} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -39,6 +39,7 @@ import { findReadReceiptFromUserId } from '../../../utils/Receipt';
|
||||||
import withMatrixClient from '../../../wrappers/withMatrixClient';
|
import withMatrixClient from '../../../wrappers/withMatrixClient';
|
||||||
import AccessibleButton from '../elements/AccessibleButton';
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
import GeminiScrollbar from 'react-gemini-scrollbar';
|
import GeminiScrollbar from 'react-gemini-scrollbar';
|
||||||
|
import RoomViewStore from '../../../stores/RoomViewStore';
|
||||||
|
|
||||||
|
|
||||||
module.exports = withMatrixClient(React.createClass({
|
module.exports = withMatrixClient(React.createClass({
|
||||||
|
@ -81,6 +82,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
cli.on("Room.receipt", this.onRoomReceipt);
|
cli.on("Room.receipt", this.onRoomReceipt);
|
||||||
cli.on("RoomState.events", this.onRoomStateEvents);
|
cli.on("RoomState.events", this.onRoomStateEvents);
|
||||||
cli.on("RoomMember.name", this.onRoomMemberName);
|
cli.on("RoomMember.name", this.onRoomMemberName);
|
||||||
|
cli.on("RoomMember.membership", this.onRoomMemberMembership);
|
||||||
cli.on("accountData", this.onAccountData);
|
cli.on("accountData", this.onAccountData);
|
||||||
|
|
||||||
this._checkIgnoreState();
|
this._checkIgnoreState();
|
||||||
|
@ -91,7 +93,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillReceiveProps: function(newProps) {
|
componentWillReceiveProps: function(newProps) {
|
||||||
if (this.props.member.userId != newProps.member.userId) {
|
if (this.props.member.userId !== newProps.member.userId) {
|
||||||
this._updateStateForNewMember(newProps.member);
|
this._updateStateForNewMember(newProps.member);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -107,6 +109,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
client.removeListener("Room.receipt", this.onRoomReceipt);
|
client.removeListener("Room.receipt", this.onRoomReceipt);
|
||||||
client.removeListener("RoomState.events", this.onRoomStateEvents);
|
client.removeListener("RoomState.events", this.onRoomStateEvents);
|
||||||
client.removeListener("RoomMember.name", this.onRoomMemberName);
|
client.removeListener("RoomMember.name", this.onRoomMemberName);
|
||||||
|
client.removeListener("RoomMember.membership", this.onRoomMemberMembership);
|
||||||
client.removeListener("accountData", this.onAccountData);
|
client.removeListener("accountData", this.onAccountData);
|
||||||
}
|
}
|
||||||
if (this._cancelDeviceList) {
|
if (this._cancelDeviceList) {
|
||||||
|
@ -122,12 +125,12 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
_disambiguateDevices: function(devices) {
|
_disambiguateDevices: function(devices) {
|
||||||
const names = Object.create(null);
|
const names = Object.create(null);
|
||||||
for (let i = 0; i < devices.length; i++) {
|
for (let i = 0; i < devices.length; i++) {
|
||||||
var name = devices[i].getDisplayName();
|
const name = devices[i].getDisplayName();
|
||||||
const indexList = names[name] || [];
|
const indexList = names[name] || [];
|
||||||
indexList.push(i);
|
indexList.push(i);
|
||||||
names[name] = indexList;
|
names[name] = indexList;
|
||||||
}
|
}
|
||||||
for (name in names) {
|
for (const name in names) {
|
||||||
if (names[name].length > 1) {
|
if (names[name].length > 1) {
|
||||||
names[name].forEach((j)=>{
|
names[name].forEach((j)=>{
|
||||||
devices[j].ambiguous = true;
|
devices[j].ambiguous = true;
|
||||||
|
@ -141,7 +144,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userId == this.props.member.userId) {
|
if (userId === this.props.member.userId) {
|
||||||
// no need to re-download the whole thing; just update our copy of
|
// no need to re-download the whole thing; just update our copy of
|
||||||
// the list.
|
// the list.
|
||||||
|
|
||||||
|
@ -186,8 +189,12 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onRoomMemberMembership: function(ev, member) {
|
||||||
|
if (this.props.member.userId === member.userId) this.forceUpdate();
|
||||||
|
},
|
||||||
|
|
||||||
onAccountData: function(ev) {
|
onAccountData: function(ev) {
|
||||||
if (ev.getType() == 'm.direct') {
|
if (ev.getType() === 'm.direct') {
|
||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -242,7 +249,9 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
ignoredUsers.push(this.props.member.userId);
|
ignoredUsers.push(this.props.member.userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.matrixClient.setIgnoredUsers(ignoredUsers).then(() => this.setState({isIgnoring: !this.state.isIgnoring}));
|
this.props.matrixClient.setIgnoredUsers(ignoredUsers).then(() => {
|
||||||
|
return this.setState({isIgnoring: !this.state.isIgnoring});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onKick: function() {
|
onKick: function() {
|
||||||
|
@ -252,7 +261,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
Modal.createTrackedDialog('Confirm User Action Dialog', 'onKick', ConfirmUserActionDialog, {
|
Modal.createTrackedDialog('Confirm User Action Dialog', 'onKick', ConfirmUserActionDialog, {
|
||||||
member: this.props.member,
|
member: this.props.member,
|
||||||
action: kickLabel,
|
action: kickLabel,
|
||||||
askReason: membership == "join",
|
askReason: membership === "join",
|
||||||
danger: true,
|
danger: true,
|
||||||
onFinished: (proceed, reason) => {
|
onFinished: (proceed, reason) => {
|
||||||
if (!proceed) return;
|
if (!proceed) return;
|
||||||
|
@ -284,15 +293,15 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
const ConfirmUserActionDialog = sdk.getComponent("dialogs.ConfirmUserActionDialog");
|
const ConfirmUserActionDialog = sdk.getComponent("dialogs.ConfirmUserActionDialog");
|
||||||
Modal.createTrackedDialog('Confirm User Action Dialog', 'onBanOrUnban', ConfirmUserActionDialog, {
|
Modal.createTrackedDialog('Confirm User Action Dialog', 'onBanOrUnban', ConfirmUserActionDialog, {
|
||||||
member: this.props.member,
|
member: this.props.member,
|
||||||
action: this.props.member.membership == 'ban' ? _t("Unban") : _t("Ban"),
|
action: this.props.member.membership === 'ban' ? _t("Unban") : _t("Ban"),
|
||||||
askReason: this.props.member.membership != 'ban',
|
askReason: this.props.member.membership !== 'ban',
|
||||||
danger: this.props.member.membership != 'ban',
|
danger: this.props.member.membership !== 'ban',
|
||||||
onFinished: (proceed, reason) => {
|
onFinished: (proceed, reason) => {
|
||||||
if (!proceed) return;
|
if (!proceed) return;
|
||||||
|
|
||||||
this.setState({ updating: this.state.updating + 1 });
|
this.setState({ updating: this.state.updating + 1 });
|
||||||
let promise;
|
let promise;
|
||||||
if (this.props.member.membership == 'ban') {
|
if (this.props.member.membership === 'ban') {
|
||||||
promise = this.props.matrixClient.unban(
|
promise = this.props.matrixClient.unban(
|
||||||
this.props.member.roomId, this.props.member.userId,
|
this.props.member.roomId, this.props.member.userId,
|
||||||
);
|
);
|
||||||
|
@ -327,15 +336,11 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
const roomId = this.props.member.roomId;
|
const roomId = this.props.member.roomId;
|
||||||
const target = this.props.member.userId;
|
const target = this.props.member.userId;
|
||||||
const room = this.props.matrixClient.getRoom(roomId);
|
const room = this.props.matrixClient.getRoom(roomId);
|
||||||
if (!room) {
|
if (!room) return;
|
||||||
return;
|
|
||||||
}
|
const powerLevelEvent = room.currentState.getStateEvents("m.room.power_levels", "");
|
||||||
const powerLevelEvent = room.currentState.getStateEvents(
|
if (!powerLevelEvent) return;
|
||||||
"m.room.power_levels", "",
|
|
||||||
);
|
|
||||||
if (!powerLevelEvent) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const isMuted = this.state.muted;
|
const isMuted = this.state.muted;
|
||||||
const powerLevels = powerLevelEvent.getContent();
|
const powerLevels = powerLevelEvent.getContent();
|
||||||
const levelToSend = (
|
const levelToSend = (
|
||||||
|
@ -350,7 +355,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
}
|
}
|
||||||
level = parseInt(level);
|
level = parseInt(level);
|
||||||
|
|
||||||
if (level !== NaN) {
|
if (!isNaN(level)) {
|
||||||
this.setState({ updating: this.state.updating + 1 });
|
this.setState({ updating: this.state.updating + 1 });
|
||||||
this.props.matrixClient.setPowerLevel(roomId, target, level, powerLevelEvent).then(
|
this.props.matrixClient.setPowerLevel(roomId, target, level, powerLevelEvent).then(
|
||||||
function() {
|
function() {
|
||||||
|
@ -375,19 +380,14 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
const roomId = this.props.member.roomId;
|
const roomId = this.props.member.roomId;
|
||||||
const target = this.props.member.userId;
|
const target = this.props.member.userId;
|
||||||
const room = this.props.matrixClient.getRoom(roomId);
|
const room = this.props.matrixClient.getRoom(roomId);
|
||||||
if (!room) {
|
if (!room) return;
|
||||||
return;
|
|
||||||
}
|
const powerLevelEvent = room.currentState.getStateEvents("m.room.power_levels", "");
|
||||||
const powerLevelEvent = room.currentState.getStateEvents(
|
if (!powerLevelEvent) return;
|
||||||
"m.room.power_levels", "",
|
|
||||||
);
|
|
||||||
if (!powerLevelEvent) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const me = room.getMember(this.props.matrixClient.credentials.userId);
|
const me = room.getMember(this.props.matrixClient.credentials.userId);
|
||||||
if (!me) {
|
if (!me) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
const defaultLevel = powerLevelEvent.getContent().users_default;
|
const defaultLevel = powerLevelEvent.getContent().users_default;
|
||||||
let modLevel = me.powerLevel - 1;
|
let modLevel = me.powerLevel - 1;
|
||||||
if (modLevel > 50 && defaultLevel < 50) modLevel = 50; // try to stick with the vector level defaults
|
if (modLevel > 50 && defaultLevel < 50) modLevel = 50; // try to stick with the vector level defaults
|
||||||
|
@ -400,7 +400,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
// get out of sync if we force setState here!
|
// get out of sync if we force setState here!
|
||||||
console.log("Mod toggle success");
|
console.log("Mod toggle success");
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
if (err.errcode == 'M_GUEST_ACCESS_FORBIDDEN') {
|
if (err.errcode === 'M_GUEST_ACCESS_FORBIDDEN') {
|
||||||
dis.dispatch({action: 'view_set_mxid'});
|
dis.dispatch({action: 'view_set_mxid'});
|
||||||
} else {
|
} else {
|
||||||
console.error("Toggle moderator error:" + err);
|
console.error("Toggle moderator error:" + err);
|
||||||
|
@ -436,7 +436,6 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onPowerChange: function(powerLevel) {
|
onPowerChange: function(powerLevel) {
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
const roomId = this.props.member.roomId;
|
const roomId = this.props.member.roomId;
|
||||||
const target = this.props.member.userId;
|
const target = this.props.member.userId;
|
||||||
const room = this.props.matrixClient.getRoom(roomId);
|
const room = this.props.matrixClient.getRoom(roomId);
|
||||||
|
@ -497,19 +496,14 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
modifyLevel: false,
|
modifyLevel: false,
|
||||||
};
|
};
|
||||||
const room = this.props.matrixClient.getRoom(member.roomId);
|
const room = this.props.matrixClient.getRoom(member.roomId);
|
||||||
if (!room) {
|
if (!room) return defaultPerms;
|
||||||
return defaultPerms;
|
|
||||||
}
|
const powerLevels = room.currentState.getStateEvents("m.room.power_levels", "");
|
||||||
const powerLevels = room.currentState.getStateEvents(
|
if (!powerLevels) return defaultPerms;
|
||||||
"m.room.power_levels", "",
|
|
||||||
);
|
|
||||||
if (!powerLevels) {
|
|
||||||
return defaultPerms;
|
|
||||||
}
|
|
||||||
const me = room.getMember(this.props.matrixClient.credentials.userId);
|
const me = room.getMember(this.props.matrixClient.credentials.userId);
|
||||||
if (!me) {
|
if (!me) return defaultPerms;
|
||||||
return defaultPerms;
|
|
||||||
}
|
|
||||||
const them = member;
|
const them = member;
|
||||||
return {
|
return {
|
||||||
can: this._calculateCanPermissions(
|
can: this._calculateCanPermissions(
|
||||||
|
@ -545,14 +539,13 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
can.ban = me.powerLevel >= powerLevels.ban;
|
can.ban = me.powerLevel >= powerLevels.ban;
|
||||||
can.mute = me.powerLevel >= editPowerLevel;
|
can.mute = me.powerLevel >= editPowerLevel;
|
||||||
can.toggleMod = me.powerLevel > them.powerLevel && them.powerLevel >= levelToSend;
|
can.toggleMod = me.powerLevel > them.powerLevel && them.powerLevel >= levelToSend;
|
||||||
can.modifyLevel = me.powerLevel > them.powerLevel;
|
can.modifyLevel = me.powerLevel > them.powerLevel && me.powerLevel >= editPowerLevel;
|
||||||
return can;
|
return can;
|
||||||
},
|
},
|
||||||
|
|
||||||
_isMuted: function(member, powerLevelContent) {
|
_isMuted: function(member, powerLevelContent) {
|
||||||
if (!powerLevelContent || !member) {
|
if (!powerLevelContent || !member) return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const levelToSend = (
|
const levelToSend = (
|
||||||
(powerLevelContent.events ? powerLevelContent.events["m.room.message"] : null) ||
|
(powerLevelContent.events ? powerLevelContent.events["m.room.message"] : null) ||
|
||||||
powerLevelContent.events_default
|
powerLevelContent.events_default
|
||||||
|
@ -568,14 +561,15 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onMemberAvatarClick: function() {
|
onMemberAvatarClick: function() {
|
||||||
const avatarUrl = this.props.member.user ? this.props.member.user.avatarUrl : this.props.member.events.member.getContent().avatar_url;
|
const member = this.props.member;
|
||||||
|
const avatarUrl = member.user ? member.user.avatarUrl : member.events.member.getContent().avatar_url;
|
||||||
if(!avatarUrl) return;
|
if(!avatarUrl) return;
|
||||||
|
|
||||||
const httpUrl = this.props.matrixClient.mxcUrlToHttp(avatarUrl);
|
const httpUrl = this.props.matrixClient.mxcUrlToHttp(avatarUrl);
|
||||||
const ImageView = sdk.getComponent("elements.ImageView");
|
const ImageView = sdk.getComponent("elements.ImageView");
|
||||||
const params = {
|
const params = {
|
||||||
src: httpUrl,
|
src: httpUrl,
|
||||||
name: this.props.member.name,
|
name: member.name,
|
||||||
};
|
};
|
||||||
|
|
||||||
Modal.createDialog(ImageView, params, "mx_Dialog_lightbox");
|
Modal.createDialog(ImageView, params, "mx_Dialog_lightbox");
|
||||||
|
@ -589,9 +583,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
_renderDevices: function() {
|
_renderDevices: function() {
|
||||||
if (!this._enableDevices) {
|
if (!this._enableDevices) return null;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const devices = this.state.devices;
|
const devices = this.state.devices;
|
||||||
const MemberDeviceInfo = sdk.getComponent('rooms.MemberDeviceInfo');
|
const MemberDeviceInfo = sdk.getComponent('rooms.MemberDeviceInfo');
|
||||||
|
@ -630,6 +622,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
|
|
||||||
let ignoreButton = null;
|
let ignoreButton = null;
|
||||||
let insertPillButton = null;
|
let insertPillButton = null;
|
||||||
|
let inviteUserButton = null;
|
||||||
let readReceiptButton = null;
|
let readReceiptButton = null;
|
||||||
|
|
||||||
// Only allow the user to ignore the user if its not ourselves
|
// Only allow the user to ignore the user if its not ourselves
|
||||||
|
@ -673,9 +666,30 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!member || !member.membership || member.membership === 'leave') {
|
||||||
|
const roomId = member && member.roomId ? member.roomId : RoomViewStore.getRoomId();
|
||||||
|
const onInviteUserButton = async () => {
|
||||||
|
try {
|
||||||
|
await cli.invite(roomId, member.userId);
|
||||||
|
} catch (err) {
|
||||||
|
const ErrorDialog = sdk.getComponent('dialogs.ErrorDialog');
|
||||||
|
Modal.createTrackedDialog('Failed to invite', '', ErrorDialog, {
|
||||||
|
title: _t('Failed to invite'),
|
||||||
|
description: ((err && err.message) ? err.message : "Operation failed"),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
inviteUserButton = (
|
||||||
|
<AccessibleButton onClick={onInviteUserButton} className="mx_MemberInfo_field">
|
||||||
|
{ _t('Invite') }
|
||||||
|
</AccessibleButton>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ignoreButton && !readReceiptButton && !insertPillButton) return null;
|
if (!ignoreButton && !readReceiptButton && !insertPillButton && !inviteUserButton) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
@ -684,13 +698,20 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
{ readReceiptButton }
|
{ readReceiptButton }
|
||||||
{ insertPillButton }
|
{ insertPillButton }
|
||||||
{ ignoreButton }
|
{ ignoreButton }
|
||||||
|
{ inviteUserButton }
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
let startChat, kickButton, banButton, muteButton, giveModButton, spinner;
|
let startChat;
|
||||||
|
let kickButton;
|
||||||
|
let banButton;
|
||||||
|
let muteButton;
|
||||||
|
let giveModButton;
|
||||||
|
let spinner;
|
||||||
|
|
||||||
if (this.props.member.userId !== this.props.matrixClient.credentials.userId) {
|
if (this.props.member.userId !== this.props.matrixClient.credentials.userId) {
|
||||||
const dmRoomMap = new DMRoomMap(this.props.matrixClient);
|
const dmRoomMap = new DMRoomMap(this.props.matrixClient);
|
||||||
const dmRooms = dmRoomMap.getDMRoomsForUserId(this.props.member.userId);
|
const dmRooms = dmRoomMap.getDMRoomsForUserId(this.props.member.userId);
|
||||||
|
@ -704,7 +725,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
const me = room.getMember(this.props.matrixClient.credentials.userId);
|
const me = room.getMember(this.props.matrixClient.credentials.userId);
|
||||||
const highlight = (
|
const highlight = (
|
||||||
room.getUnreadNotificationCount('highlight') > 0 ||
|
room.getUnreadNotificationCount('highlight') > 0 ||
|
||||||
me.membership == "invite"
|
me.membership === "invite"
|
||||||
);
|
);
|
||||||
tiles.push(
|
tiles.push(
|
||||||
<RoomTile key={room.roomId} room={room}
|
<RoomTile key={room.roomId} room={room}
|
||||||
|
@ -712,7 +733,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
selected={false}
|
selected={false}
|
||||||
unread={Unread.doesRoomHaveUnreadMessages(room)}
|
unread={Unread.doesRoomHaveUnreadMessages(room)}
|
||||||
highlight={highlight}
|
highlight={highlight}
|
||||||
isInvite={me.membership == "invite"}
|
isInvite={me.membership === "invite"}
|
||||||
onClick={this.onRoomTileClick}
|
onClick={this.onRoomTileClick}
|
||||||
/>,
|
/>,
|
||||||
);
|
);
|
||||||
|
@ -757,7 +778,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
}
|
}
|
||||||
if (this.state.can.ban) {
|
if (this.state.can.ban) {
|
||||||
let label = _t("Ban");
|
let label = _t("Ban");
|
||||||
if (this.props.member.membership == 'ban') {
|
if (this.props.member.membership === 'ban') {
|
||||||
label = _t("Unban");
|
label = _t("Unban");
|
||||||
}
|
}
|
||||||
banButton = (
|
banButton = (
|
||||||
|
@ -783,9 +804,6 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
</AccessibleButton>;
|
</AccessibleButton>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: we should have an invite button if this MemberInfo is showing a user who isn't actually in the current room yet
|
|
||||||
// e.g. clicking on a linkified userid in a room
|
|
||||||
|
|
||||||
let adminTools;
|
let adminTools;
|
||||||
if (kickButton || banButton || muteButton || giveModButton) {
|
if (kickButton || banButton || muteButton || giveModButton) {
|
||||||
adminTools =
|
adminTools =
|
||||||
|
@ -803,16 +821,39 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
|
|
||||||
const memberName = this.props.member.name;
|
const memberName = this.props.member.name;
|
||||||
|
|
||||||
|
let presenceState;
|
||||||
|
let presenceLastActiveAgo;
|
||||||
|
let presenceCurrentlyActive;
|
||||||
|
|
||||||
if (this.props.member.user) {
|
if (this.props.member.user) {
|
||||||
var presenceState = this.props.member.user.presence;
|
presenceState = this.props.member.user.presence;
|
||||||
var presenceLastActiveAgo = this.props.member.user.lastActiveAgo;
|
presenceLastActiveAgo = this.props.member.user.lastActiveAgo;
|
||||||
const presenceLastTs = this.props.member.user.lastPresenceTs;
|
presenceCurrentlyActive = this.props.member.user.currentlyActive;
|
||||||
var presenceCurrentlyActive = this.props.member.user.currentlyActive;
|
}
|
||||||
|
|
||||||
|
let roomMemberDetails = null;
|
||||||
|
|
||||||
|
if (this.props.member.roomId) { // is in room
|
||||||
|
const PowerSelector = sdk.getComponent('elements.PowerSelector');
|
||||||
|
const PresenceLabel = sdk.getComponent('rooms.PresenceLabel');
|
||||||
|
roomMemberDetails = <div>
|
||||||
|
<div className="mx_MemberInfo_profileField">
|
||||||
|
{ _t("Level:") } <b>
|
||||||
|
<PowerSelector controlled={true}
|
||||||
|
value={parseInt(this.props.member.powerLevel)}
|
||||||
|
disabled={!this.state.can.modifyLevel}
|
||||||
|
onChange={this.onPowerChange} />
|
||||||
|
</b>
|
||||||
|
</div>
|
||||||
|
<div className="mx_MemberInfo_profileField">
|
||||||
|
<PresenceLabel activeAgo={presenceLastActiveAgo}
|
||||||
|
currentlyActive={presenceCurrentlyActive}
|
||||||
|
presenceState={presenceState} />
|
||||||
|
</div>
|
||||||
|
</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MemberAvatar = sdk.getComponent('avatars.MemberAvatar');
|
const MemberAvatar = sdk.getComponent('avatars.MemberAvatar');
|
||||||
const PowerSelector = sdk.getComponent('elements.PowerSelector');
|
|
||||||
const PresenceLabel = sdk.getComponent('rooms.PresenceLabel');
|
|
||||||
const EmojiText = sdk.getComponent('elements.EmojiText');
|
const EmojiText = sdk.getComponent('elements.EmojiText');
|
||||||
return (
|
return (
|
||||||
<div className="mx_MemberInfo">
|
<div className="mx_MemberInfo">
|
||||||
|
@ -828,14 +869,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
<div className="mx_MemberInfo_profileField">
|
<div className="mx_MemberInfo_profileField">
|
||||||
{ this.props.member.userId }
|
{ this.props.member.userId }
|
||||||
</div>
|
</div>
|
||||||
<div className="mx_MemberInfo_profileField">
|
{ roomMemberDetails }
|
||||||
{ _t("Level:") } <b><PowerSelector controlled={true} value={parseInt(this.props.member.powerLevel)} disabled={!this.state.can.modifyLevel} onChange={this.onPowerChange} /></b>
|
|
||||||
</div>
|
|
||||||
<div className="mx_MemberInfo_profileField">
|
|
||||||
<PresenceLabel activeAgo={presenceLastActiveAgo}
|
|
||||||
currentlyActive={presenceCurrentlyActive}
|
|
||||||
presenceState={presenceState} />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{ this._renderUserOptions() }
|
{ this._renderUserOptions() }
|
||||||
|
|
|
@ -371,7 +371,7 @@ export default class MessageComposer extends React.Component {
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_MessageComposer mx_fadable" style={{ opacity: this.props.opacity }}>
|
<div className="mx_MessageComposer">
|
||||||
<div className="mx_MessageComposer_wrapper">
|
<div className="mx_MessageComposer_wrapper">
|
||||||
<div className="mx_MessageComposer_row">
|
<div className="mx_MessageComposer_row">
|
||||||
{ controls }
|
{ controls }
|
||||||
|
@ -410,9 +410,6 @@ MessageComposer.propTypes = {
|
||||||
// callback when a file to upload is chosen
|
// callback when a file to upload is chosen
|
||||||
uploadFile: React.PropTypes.func.isRequired,
|
uploadFile: React.PropTypes.func.isRequired,
|
||||||
|
|
||||||
// opacity for dynamic UI fading effects
|
|
||||||
opacity: React.PropTypes.number,
|
|
||||||
|
|
||||||
// string representing the current room app drawer state
|
// string representing the current room app drawer state
|
||||||
showApps: React.PropTypes.bool,
|
showApps: React.PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
|
@ -95,7 +95,9 @@ module.exports = React.createClass({
|
||||||
return (
|
return (
|
||||||
<div className="mx_PinnedEventsPanel">
|
<div className="mx_PinnedEventsPanel">
|
||||||
<div className="mx_PinnedEventsPanel_body">
|
<div className="mx_PinnedEventsPanel_body">
|
||||||
<AccessibleButton className="mx_PinnedEventsPanel_cancel" onClick={this.props.onCancelClick}><img src="img/cancel.svg" width="18" height="18" /></AccessibleButton>
|
<AccessibleButton className="mx_PinnedEventsPanel_cancel" onClick={this.props.onCancelClick}>
|
||||||
|
<img className="mx_filterFlipColor" src="img/cancel.svg" width="18" height="18" />
|
||||||
|
</AccessibleButton>
|
||||||
<h3 className="mx_PinnedEventsPanel_header">{ _t("Pinned Messages") }</h3>
|
<h3 className="mx_PinnedEventsPanel_header">{ _t("Pinned Messages") }</h3>
|
||||||
{ tiles }
|
{ tiles }
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -281,8 +281,11 @@ module.exports = React.createClass({
|
||||||
<input id="avatarInput" type="file" onChange={this.onAvatarSelected} />
|
<input id="avatarInput" type="file" onChange={this.onAvatarSelected} />
|
||||||
</div>
|
</div>
|
||||||
<div className="mx_RoomHeader_avatarPicker_remove" onClick={this.onAvatarRemoveClick}>
|
<div className="mx_RoomHeader_avatarPicker_remove" onClick={this.onAvatarRemoveClick}>
|
||||||
<img src="img/cancel.svg" width="10"
|
<img src="img/cancel.svg"
|
||||||
alt={_t("Remove avatar")} title={_t("Remove avatar")} />
|
className="mx_filterFlipColor"
|
||||||
|
width="10"
|
||||||
|
alt={_t("Remove avatar")}
|
||||||
|
title={_t("Remove avatar")} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -19,7 +19,6 @@ import Promise from 'bluebird';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { _t, _tJsx, _td } from '../../../languageHandler';
|
import { _t, _tJsx, _td } from '../../../languageHandler';
|
||||||
import MatrixClientPeg from '../../../MatrixClientPeg';
|
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||||
import SdkConfig from '../../../SdkConfig';
|
|
||||||
import sdk from '../../../index';
|
import sdk from '../../../index';
|
||||||
import Modal from '../../../Modal';
|
import Modal from '../../../Modal';
|
||||||
import ObjectUtils from '../../../ObjectUtils';
|
import ObjectUtils from '../../../ObjectUtils';
|
||||||
|
@ -158,9 +157,9 @@ module.exports = React.createClass({
|
||||||
});
|
});
|
||||||
|
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'ui_opacity',
|
action: 'panel_disable',
|
||||||
sideOpacity: 0.3,
|
sideDisabled: true,
|
||||||
middleOpacity: 0.3,
|
middleDisabled: true,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -171,9 +170,9 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'ui_opacity',
|
action: 'panel_disable',
|
||||||
sideOpacity: 1.0,
|
sideDisabled: false,
|
||||||
middleOpacity: 1.0,
|
middleDisabled: false,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,13 @@ limitations under the License.
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import sdk from '../../../index';
|
import sdk from '../../../index';
|
||||||
import dis from '../../../dispatcher';
|
import dis from '../../../dispatcher';
|
||||||
|
|
||||||
|
import UserSettingsStore from '../../../UserSettingsStore';
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
displayName: 'VideoView',
|
displayName: 'VideoView',
|
||||||
|
|
||||||
|
@ -108,14 +111,18 @@ module.exports = React.createClass({
|
||||||
document.mozFullScreenElement ||
|
document.mozFullScreenElement ||
|
||||||
document.webkitFullscreenElement);
|
document.webkitFullscreenElement);
|
||||||
const maxVideoHeight = fullscreenElement ? null : this.props.maxHeight;
|
const maxVideoHeight = fullscreenElement ? null : this.props.maxHeight;
|
||||||
|
const localVideoFeedClasses = classNames("mx_VideoView_localVideoFeed",
|
||||||
|
{ "mx_VideoView_localVideoFeed_flipped":
|
||||||
|
UserSettingsStore.getSyncedSetting('VideoView.flipVideoHorizontally', false),
|
||||||
|
},
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<div className="mx_VideoView" ref={this.setContainer} onClick={this.props.onClick}>
|
<div className="mx_VideoView" ref={this.setContainer} onClick={this.props.onClick}>
|
||||||
<div className="mx_VideoView_remoteVideoFeed">
|
<div className="mx_VideoView_remoteVideoFeed">
|
||||||
<VideoFeed ref="remote" onResize={this.props.onResize}
|
<VideoFeed ref="remote" onResize={this.props.onResize}
|
||||||
maxHeight={maxVideoHeight} />
|
maxHeight={maxVideoHeight} />
|
||||||
</div>
|
</div>
|
||||||
<div className="mx_VideoView_localVideoFeed">
|
<div className={localVideoFeedClasses}>
|
||||||
<VideoFeed ref="local" />
|
<VideoFeed ref="local" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -240,6 +240,7 @@
|
||||||
"Unignore": "Unignore",
|
"Unignore": "Unignore",
|
||||||
"Ignore": "Ignore",
|
"Ignore": "Ignore",
|
||||||
"Jump to read receipt": "Jump to read receipt",
|
"Jump to read receipt": "Jump to read receipt",
|
||||||
|
"Invite": "Invite",
|
||||||
"User Options": "User Options",
|
"User Options": "User Options",
|
||||||
"Direct chats": "Direct chats",
|
"Direct chats": "Direct chats",
|
||||||
"Unmute": "Unmute",
|
"Unmute": "Unmute",
|
||||||
|
@ -451,6 +452,7 @@
|
||||||
"You are about to be taken to a third-party site so you can authenticate your account for use with %(integrationsUrl)s. Do you wish to continue?": "You are about to be taken to a third-party site so you can authenticate your account for use with %(integrationsUrl)s. Do you wish to continue?",
|
"You are about to be taken to a third-party site so you can authenticate your account for use with %(integrationsUrl)s. Do you wish to continue?": "You are about to be taken to a third-party site so you can authenticate your account for use with %(integrationsUrl)s. Do you wish to continue?",
|
||||||
"Removed or unknown message type": "Removed or unknown message type",
|
"Removed or unknown message type": "Removed or unknown message type",
|
||||||
"Message removed by %(userId)s": "Message removed by %(userId)s",
|
"Message removed by %(userId)s": "Message removed by %(userId)s",
|
||||||
|
"Message removed": "Message removed",
|
||||||
"Robot check is currently unavailable on desktop - please use a <a>web browser</a>": "Robot check is currently unavailable on desktop - please use a <a>web browser</a>",
|
"Robot check is currently unavailable on desktop - please use a <a>web browser</a>": "Robot check is currently unavailable on desktop - please use a <a>web browser</a>",
|
||||||
"This Home Server would like to make sure you are not a robot": "This Home Server would like to make sure you are not a robot",
|
"This Home Server would like to make sure you are not a robot": "This Home Server would like to make sure you are not a robot",
|
||||||
"Sign in with CAS": "Sign in with CAS",
|
"Sign in with CAS": "Sign in with CAS",
|
||||||
|
@ -494,10 +496,13 @@
|
||||||
"Are you sure you want to remove '%(roomName)s' from %(groupId)s?": "Are you sure you want to remove '%(roomName)s' from %(groupId)s?",
|
"Are you sure you want to remove '%(roomName)s' from %(groupId)s?": "Are you sure you want to remove '%(roomName)s' from %(groupId)s?",
|
||||||
"Removing a room from the community will also remove it from the community page.": "Removing a room from the community will also remove it from the community page.",
|
"Removing a room from the community will also remove it from the community page.": "Removing a room from the community will also remove it from the community page.",
|
||||||
"Remove": "Remove",
|
"Remove": "Remove",
|
||||||
|
"Remove this room from the community": "Remove this room from the community",
|
||||||
"Unknown Address": "Unknown Address",
|
"Unknown Address": "Unknown Address",
|
||||||
"NOTE: Apps are not end-to-end encrypted": "NOTE: Apps are not end-to-end encrypted",
|
"NOTE: Apps are not end-to-end encrypted": "NOTE: Apps are not end-to-end encrypted",
|
||||||
"Do you want to load widget from URL:": "Do you want to load widget from URL:",
|
"Do you want to load widget from URL:": "Do you want to load widget from URL:",
|
||||||
"Allow": "Allow",
|
"Allow": "Allow",
|
||||||
|
"Delete Widget": "Delete Widget",
|
||||||
|
"Deleting a widget removes it for all users in this room. Are you sure you want to delete this widget?": "Deleting a widget removes it for all users in this room. Are you sure you want to delete this widget?",
|
||||||
"Delete widget": "Delete widget",
|
"Delete widget": "Delete widget",
|
||||||
"Revoke widget access": "Revoke widget access",
|
"Revoke widget access": "Revoke widget access",
|
||||||
"Edit": "Edit",
|
"Edit": "Edit",
|
||||||
|
@ -677,17 +682,17 @@
|
||||||
"Leave %(groupName)s?": "Leave %(groupName)s?",
|
"Leave %(groupName)s?": "Leave %(groupName)s?",
|
||||||
"Leave": "Leave",
|
"Leave": "Leave",
|
||||||
"Unable to leave room": "Unable to leave room",
|
"Unable to leave room": "Unable to leave room",
|
||||||
|
"Community Settings": "Community Settings",
|
||||||
"Add rooms to this community": "Add rooms to this community",
|
"Add rooms to this community": "Add rooms to this community",
|
||||||
"Featured Rooms:": "Featured Rooms:",
|
"Featured Rooms:": "Featured Rooms:",
|
||||||
"Featured Users:": "Featured Users:",
|
"Featured Users:": "Featured Users:",
|
||||||
"%(inviter)s has invited you to join this community": "%(inviter)s has invited you to join this community",
|
"%(inviter)s has invited you to join this community": "%(inviter)s has invited you to join this community",
|
||||||
"You are a member of this community": "You are a member of this community",
|
|
||||||
"You are an administrator of this community": "You are an administrator of this community",
|
"You are an administrator of this community": "You are an administrator of this community",
|
||||||
|
"You are a member of this community": "You are a member of this community",
|
||||||
"Community Member Settings": "Community Member Settings",
|
"Community Member Settings": "Community Member Settings",
|
||||||
"Publish this community on your profile": "Publish this community on your profile",
|
"Publish this community on your profile": "Publish this community on your profile",
|
||||||
"Long Description (HTML)": "Long Description (HTML)",
|
"Long Description (HTML)": "Long Description (HTML)",
|
||||||
"Description": "Description",
|
"Description": "Description",
|
||||||
"Community Settings": "Community Settings",
|
|
||||||
"Community %(groupId)s not found": "Community %(groupId)s not found",
|
"Community %(groupId)s not found": "Community %(groupId)s not found",
|
||||||
"This Home server does not support communities": "This Home server does not support communities",
|
"This Home server does not support communities": "This Home server does not support communities",
|
||||||
"Failed to load %(groupId)s": "Failed to load %(groupId)s",
|
"Failed to load %(groupId)s": "Failed to load %(groupId)s",
|
||||||
|
@ -753,6 +758,7 @@
|
||||||
"Disable Emoji suggestions while typing": "Disable Emoji suggestions while typing",
|
"Disable Emoji suggestions while typing": "Disable Emoji suggestions while typing",
|
||||||
"Hide avatars in user and room mentions": "Hide avatars in user and room mentions",
|
"Hide avatars in user and room mentions": "Hide avatars in user and room mentions",
|
||||||
"Disable big emoji in chat": "Disable big emoji in chat",
|
"Disable big emoji in chat": "Disable big emoji in chat",
|
||||||
|
"Mirror local video feed": "Mirror local video feed",
|
||||||
"Opt out of analytics": "Opt out of analytics",
|
"Opt out of analytics": "Opt out of analytics",
|
||||||
"Disable Peer-to-Peer for 1:1 calls": "Disable Peer-to-Peer for 1:1 calls",
|
"Disable Peer-to-Peer for 1:1 calls": "Disable Peer-to-Peer for 1:1 calls",
|
||||||
"Never send encrypted messages to unverified devices from this device": "Never send encrypted messages to unverified devices from this device",
|
"Never send encrypted messages to unverified devices from this device": "Never send encrypted messages to unverified devices from this device",
|
||||||
|
|
Loading…
Reference in a new issue