Merge branch 'develop' into luke/groups-add-rooms

This commit is contained in:
Luke Barnard 2017-09-26 17:12:52 +01:00 committed by GitHub
commit 1b12602ea5
5 changed files with 45 additions and 13 deletions

View file

@ -107,6 +107,9 @@ export default class BasePlatform {
isElectron(): boolean { return false; } isElectron(): boolean { return false; }
setupScreenSharingForIframe() {
}
/** /**
* Restarts the application, without neccessarily reloading * Restarts the application, without neccessarily reloading
* any application code * any application code

View file

@ -597,9 +597,7 @@ export default React.createClass({
this.setState({ this.setState({
publicityBusy: true, publicityBusy: true,
}); });
MatrixClientPeg.get().setGroupPublicity(this.props.groupId, publicity).then(() => { this._groupSummaryStore.setGroupPublicity(publicity).then(() => {
this._loadGroupFromServer(this.props.groupId);
}).then(() => {
this.setState({ this.setState({
publicityBusy: false, publicityBusy: false,
}); });
@ -730,16 +728,16 @@ export default React.createClass({
} }
let publicisedSection; let publicisedSection;
if (this.state.summary.user && this.state.summary.user.is_public) { if (this.state.summary.user && this.state.summary.user.is_publicised) {
if (!this.state.publicityBusy) { if (!this.state.publicityBusy) {
publicisedButton = <AccessibleButton className="mx_GroupView_textButton mx_RoomHeader_textButton" publicisedButton = <AccessibleButton className="mx_GroupView_textButton mx_RoomHeader_textButton"
onClick={this._onPubliciseOffClick} onClick={this._onPubliciseOffClick}
> >
{_t("Make private")} {_t("Unpublish")}
</AccessibleButton>; </AccessibleButton>;
} }
publicisedSection = <div className="mx_GroupView_membershipSubSection"> publicisedSection = <div className="mx_GroupView_membershipSubSection">
{_t("Your membership of this group is public")} {_t("This group is published on your profile")}
<div className="mx_GroupView_membership_buttonContainer"> <div className="mx_GroupView_membership_buttonContainer">
{publicisedButton} {publicisedButton}
</div> </div>
@ -749,11 +747,11 @@ export default React.createClass({
publicisedButton = <AccessibleButton className="mx_GroupView_textButton mx_RoomHeader_textButton" publicisedButton = <AccessibleButton className="mx_GroupView_textButton mx_RoomHeader_textButton"
onClick={this._onPubliciseOnClick} onClick={this._onPubliciseOnClick}
> >
{_t("Make public")} {_t("Publish")}
</AccessibleButton>; </AccessibleButton>;
} }
publicisedSection = <div className="mx_GroupView_membershipSubSection"> publicisedSection = <div className="mx_GroupView_membershipSubSection">
{_t("Your membership of this group is private")} {_t("This group is not published on your profile")}
<div className="mx_GroupView_membership_buttonContainer"> <div className="mx_GroupView_membership_buttonContainer">
{publicisedButton} {publicisedButton}
</div> </div>

View file

@ -19,6 +19,7 @@ limitations under the License.
import url from 'url'; import url from 'url';
import React from 'react'; import React from 'react';
import MatrixClientPeg from '../../../MatrixClientPeg'; import MatrixClientPeg from '../../../MatrixClientPeg';
import PlatformPeg from '../../../PlatformPeg';
import ScalarAuthClient from '../../../ScalarAuthClient'; import ScalarAuthClient from '../../../ScalarAuthClient';
import SdkConfig from '../../../SdkConfig'; import SdkConfig from '../../../SdkConfig';
import Modal from '../../../Modal'; import Modal from '../../../Modal';
@ -127,6 +128,30 @@ export default React.createClass({
loading: false, loading: false,
}); });
}); });
window.addEventListener('message', this._onMessage, false);
},
componentWillUnmount() {
window.removeEventListener('message', this._onMessage);
},
_onMessage(event) {
if (this.props.type !== 'jitsi') {
return;
}
if (!event.origin) {
event.origin = event.originalEvent.origin;
}
if (!this.state.widgetUrl.startsWith(event.origin)) {
return;
}
if (event.data.widgetAction === 'jitsi_iframe_loaded') {
const iframe = this.refs.appFrame.contentWindow
.document.querySelector('iframe[id^="jitsiConferenceFrame"]');
PlatformPeg.get().setupScreenSharingForIframe(iframe);
}
}, },
_canUserModify: function() { _canUserModify: function() {

View file

@ -884,12 +884,12 @@
"The user '%(displayName)s' could not be removed from the summary.": "The user '%(displayName)s' could not be removed from the summary.", "The user '%(displayName)s' could not be removed from the summary.": "The user '%(displayName)s' could not be removed from the summary.",
"Failed to add the following rooms to the summary of %(groupId)s:": "Failed to add the following rooms to the summary of %(groupId)s:", "Failed to add the following rooms to the summary of %(groupId)s:": "Failed to add the following rooms to the summary of %(groupId)s:",
"The room '%(roomName)s' could not be removed from the summary.": "The room '%(roomName)s' could not be removed from the summary.", "The room '%(roomName)s' could not be removed from the summary.": "The room '%(roomName)s' could not be removed from the summary.",
"Your membership of this group is public": "Your membership of this group is public",
"Your membership of this group is private": "Your membership of this group is private",
"Make private": "Make private",
"Make public": "Make public",
"Add rooms to the group": "Add rooms to the group", "Add rooms to the group": "Add rooms to the group",
"Which rooms would you like to add to this group?": "Which rooms would you like to add to this group?", "Which rooms would you like to add to this group?": "Which rooms would you like to add to this group?",
"Add to group": "Add to group", "Add to group": "Add to group",
"Failed to add the following rooms to %(groupId)s:": "Failed to add the following rooms to %(groupId)s:" "Failed to add the following rooms to %(groupId)s:": "Failed to add the following rooms to %(groupId)s:",
"Unpublish": "Unpublish",
"This group is published on your profile": "This group is published on your profile",
"Publish": "Publish",
"This group is not published on your profile": "This group is not published on your profile"
} }

View file

@ -68,4 +68,10 @@ export default class GroupSummaryStore extends EventEmitter {
.removeUserFromGroupSummary(this._groupId, userId) .removeUserFromGroupSummary(this._groupId, userId)
.then(this._fetchSummary.bind(this)); .then(this._fetchSummary.bind(this));
} }
setGroupPublicity(isPublished) {
return this._matrixClient
.setGroupPublicity(this._groupId, isPublished)
.then(this._fetchSummary.bind(this));
}
} }