diff --git a/src/components/views/room_settings/AliasSettings.js b/src/components/views/room_settings/AliasSettings.js index f68670b2f9..373e4dc9fb 100644 --- a/src/components/views/room_settings/AliasSettings.js +++ b/src/components/views/room_settings/AliasSettings.js @@ -22,6 +22,7 @@ const ObjectUtils = require("../../../ObjectUtils"); const MatrixClientPeg = require('../../../MatrixClientPeg'); const sdk = require("../../../index"); import { _t } from '../../../languageHandler'; +import Field from "../elements/Field"; const Modal = require("../../../Modal"); module.exports = React.createClass({ @@ -222,7 +223,8 @@ module.exports = React.createClass({ let found = false; const canonicalValue = this.state.canonicalAlias || ""; canonical_alias_section = ( - + ); } else { canonical_alias_section = ( @@ -278,10 +280,7 @@ module.exports = React.createClass({ return (
-

{ _t('Addresses') }

-
- { _t('The main address for this room is') }: { canonical_alias_section } -
+ {canonical_alias_section} { + // TODO: Live modification of aliases? + if (!this.refs.aliasSettings) return; + this.refs.aliasSettings.saveSettings(); + }; + render() { + const AliasSettings = sdk.getComponent("room_settings.AliasSettings"); + + const client = MatrixClientPeg.get(); + const room = client.getRoom(this.props.roomId); + + const canSetAliases = true; // Previously, we arbitrarily only allowed admins to do this + const canSetCanonical = room.currentState.mayClientSendStateEvent("m.room.canonical_alias", client); + const canonicalAliasEv = room.currentState.getStateEvents("m.room.canonical_alias", ''); + const aliasEvents = room.currentState.getStateEvents("m.room.aliases"); + return (
{_t("General")}
+ + {_t("Room Addresses")} +
+ + + {_t("Save")} + +
); } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index b2abba403f..3e65de9268 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -436,6 +436,7 @@ "Room Name": "Room Name", "Room Topic": "Room Topic", "General": "General", + "Room Addresses": "Room Addresses", "Failed to change password. Is your password correct?": "Failed to change password. Is your password correct?", "Success": "Success", "Your password was successfully changed. You will not receive push notifications on other devices until you log back in to them": "Your password was successfully changed. You will not receive push notifications on other devices until you log back in to them", @@ -765,11 +766,10 @@ "'%(alias)s' is not a valid format for an alias": "'%(alias)s' is not a valid format for an alias", "Invalid address format": "Invalid address format", "'%(alias)s' is not a valid format for an address": "'%(alias)s' is not a valid format for an address", + "Main address": "Main address", "not specified": "not specified", "not set": "not set", "Remote addresses for this room:": "Remote addresses for this room:", - "Addresses": "Addresses", - "The main address for this room is": "The main address for this room is", "Local addresses for this room:": "Local addresses for this room:", "This room has no local addresses": "This room has no local addresses", "New address (e.g. #foo:%(localDomain)s)": "New address (e.g. #foo:%(localDomain)s)",