diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index bde6396074..1065fa9f9f 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -128,11 +128,6 @@ module.exports = React.createClass({ hasNewVersion: false, newVersionReleaseNotes: null, - // The username to default to when upgrading an account from a guest - upgradeUsername: null, - // The access token we had for our guest account, used when upgrading to a normal account - guestAccessToken: null, - // Parameters used in the registration dance with the IS register_client_secret: null, register_session_id: null, @@ -315,8 +310,6 @@ module.exports = React.createClass({ viewUserId: null, loggedIn: false, ready: false, - upgradeUsername: null, - guestAccessToken: null, }; Object.assign(newState, state); this.setState(newState); @@ -351,25 +344,6 @@ module.exports = React.createClass({ screen: 'post_registration', }); break; - case 'start_upgrade_registration': - // also stash our credentials, then if we restore the session, - // we can just do it the same way whether we started upgrade - // registration or explicitly logged out - this.setStateForNewScreen({ - guestCreds: MatrixClientPeg.getCredentials(), - screen: "register", - upgradeUsername: MatrixClientPeg.get().getUserIdLocalpart(), - guestAccessToken: MatrixClientPeg.get().getAccessToken(), - }); - - // stop the client: if we are syncing whilst the registration - // is completed in another browser, we'll be 401ed for using - // a guest access token for a non-guest account. - // It will be restarted in onReturnToGuestClick - Lifecycle.stopMatrixClient(); - - this.notifyNewScreen('register'); - break; case 'start_password_recovery': this.setStateForNewScreen({ screen: 'forgot_password', @@ -1401,8 +1375,6 @@ module.exports = React.createClass({ idSid={this.state.register_id_sid} email={this.props.startingFragmentQueryParams.email} referrer={this.props.startingFragmentQueryParams.referrer} - username={this.state.upgradeUsername} - guestAccessToken={this.state.guestAccessToken} defaultHsUrl={this.getDefaultHsUrl()} defaultIsUrl={this.getDefaultIsUrl()} brand={this.props.config.brand} diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index e87bde6d87..e73f0335f0 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -310,11 +310,6 @@ module.exports = React.createClass({ }, onAvatarPickerClick: function(ev) { - if (MatrixClientPeg.get().isGuest()) { - dis.dispatch({action: 'view_set_mxid'}); - return; - } - if (this.refs.file_label) { this.refs.file_label.click(); } @@ -397,12 +392,6 @@ module.exports = React.createClass({ dis.dispatch({action: 'password_changed'}); }, - onUpgradeClicked: function() { - dis.dispatch({ - action: "start_upgrade_registration", - }); - }, - onEnableNotificationsChange: function(event) { UserSettingsStore.setEnableNotifications(event.target.checked); }, @@ -817,12 +806,6 @@ module.exports = React.createClass({ // TODO: this ought to be a separate component so that we don't need // to rebind the onChange each time we render const onChange = (e) => { - if (MatrixClientPeg.get().isGuest()) { - e.target.checked = false; - dis.dispatch({action: 'view_set_mxid'}); - return; - } - UserSettingsStore.setFeatureEnabled(feature.id, e.target.checked); this.forceUpdate(); }; @@ -852,9 +835,6 @@ module.exports = React.createClass({ }, _renderDeactivateAccount: function() { - // We can't deactivate a guest account. - if (MatrixClientPeg.get().isGuest()) return null; - return

{ _t("Deactivate Account") }

@@ -1111,7 +1091,7 @@ module.exports = React.createClass({ let addEmailSection; if (this.state.email_add_pending) { addEmailSection = ; - } else if (!MatrixClientPeg.get().isGuest()) { + } else { addEmailSection = (
@@ -1139,16 +1119,7 @@ module.exports = React.createClass({ threepidsSection.push(addEmailSection); threepidsSection.push(addMsisdnSection); - let accountJsx; - - if (MatrixClientPeg.get().isGuest()) { - accountJsx = ( -
- { _t("Create an account") } -
- ); - } else { - accountJsx = ( + const accountJsx = ( - ); - } + ); + let notificationArea; - if (!MatrixClientPeg.get().isGuest() && this.state.threepids !== undefined) { + if (this.state.threepids !== undefined) { notificationArea = (

{ _t("Notifications") }

diff --git a/src/components/structures/login/Registration.js b/src/components/structures/login/Registration.js index 943376cb8e..17fbf445b2 100644 --- a/src/components/structures/login/Registration.js +++ b/src/components/structures/login/Registration.js @@ -45,8 +45,6 @@ module.exports = React.createClass({ brand: React.PropTypes.string, email: React.PropTypes.string, referrer: React.PropTypes.string, - username: React.PropTypes.string, - guestAccessToken: React.PropTypes.string, teamServerConfig: React.PropTypes.shape({ // Email address to request new teams supportEmail: React.PropTypes.string.isRequired, @@ -295,17 +293,6 @@ module.exports = React.createClass({ }, _makeRegisterRequest: function(auth) { - let guestAccessToken = this.props.guestAccessToken; - - if ( - this.state.formVals.username !== this.props.username || - this.state.hsUrl != this.props.defaultHsUrl - ) { - // don't try to upgrade if we changed our username - // or are registering on a different HS - guestAccessToken = null; - } - // Only send the bind params if we're sending username / pw params // (Since we need to send no params at all to use the ones saved in the // session). @@ -320,7 +307,7 @@ module.exports = React.createClass({ undefined, // session id: included in the auth dict already auth, bindThreepids, - guestAccessToken, + null, ); }, @@ -357,10 +344,6 @@ module.exports = React.createClass({ } else if (this.state.busy || this.state.teamServerBusy) { registerBody = ; } else { - let guestUsername = this.props.username; - if (this.state.hsUrl != this.props.defaultHsUrl) { - guestUsername = null; - } let errorSection; if (this.state.errorText) { errorSection =
{this.state.errorText}
; @@ -374,7 +357,6 @@ module.exports = React.createClass({ defaultPhoneNumber={this.state.formVals.phoneNumber} defaultPassword={this.state.formVals.password} teamsConfig={this.state.teamsConfig} - guestUsername={guestUsername} minPasswordLength={MIN_PASSWORD_LENGTH} onError={this.onFormValidationFailed} onRegisterClick={this.onFormSubmit} diff --git a/src/components/views/dialogs/NeedToRegisterDialog.js b/src/components/views/dialogs/NeedToRegisterDialog.js deleted file mode 100644 index 8b5980164d..0000000000 --- a/src/components/views/dialogs/NeedToRegisterDialog.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright 2016 OpenMarket 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. -*/ - -/* - * Usage: - * Modal.createDialog(NeedToRegisterDialog, { - * title: "some text", (default: "Registration required") - * description: "some more text", - * onFinished: someFunction, - * }); - */ - -import React from 'react'; -import dis from '../../../dispatcher'; -import sdk from '../../../index'; -import { _t } from '../../../languageHandler'; - -module.exports = React.createClass({ - displayName: 'NeedToRegisterDialog', - propTypes: { - title: React.PropTypes.string, - description: React.PropTypes.oneOfType([ - React.PropTypes.element, - React.PropTypes.string, - ]), - onFinished: React.PropTypes.func.isRequired, - }, - - onRegisterClicked: function() { - dis.dispatch({ - action: "start_upgrade_registration", - }); - if (this.props.onFinished) { - this.props.onFinished(); - } - }, - - render: function() { - const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); - return ( - -
- {this.props.description || _t('A registered account is required for this action')} -
-
- - -
-
- ); - }, -}); diff --git a/src/components/views/login/RegistrationForm.js b/src/components/views/login/RegistrationForm.js index 0ca4615a84..ff07cd36e5 100644 --- a/src/components/views/login/RegistrationForm.js +++ b/src/components/views/login/RegistrationForm.js @@ -54,11 +54,6 @@ module.exports = React.createClass({ })).required, }), - // A username that will be used if no username is entered. - // Specifying this param will also warn the user that entering - // a different username will cause a fresh account to be generated. - guestUsername: React.PropTypes.string, - minPasswordLength: React.PropTypes.number, onError: React.PropTypes.func, onRegisterClick: React.PropTypes.func.isRequired, // onRegisterClick(Object) => ?Promise @@ -123,7 +118,7 @@ module.exports = React.createClass({ _doSubmit: function(ev) { let email = this.refs.email.value.trim(); var promise = this.props.onRegisterClick({ - username: this.refs.username.value.trim() || this.props.guestUsername, + username: this.refs.username.value.trim(), password: this.refs.password.value.trim(), email: email, phoneCountry: this.state.phoneCountry, @@ -191,7 +186,7 @@ module.exports = React.createClass({ break; case FIELD_USERNAME: // XXX: SPEC-1 - var username = this.refs.username.value.trim() || this.props.guestUsername; + var username = this.refs.username.value.trim(); if (encodeURIComponent(username) != username) { this.markFieldValid( field_id, @@ -339,9 +334,6 @@ module.exports = React.createClass({ ); let placeholderUserName = _t("User name"); - if (this.props.guestUsername) { - placeholderUserName += " " + _t("(default: %(userName)s)", {userName: this.props.guestUsername}); - } return (
@@ -354,9 +346,6 @@ module.exports = React.createClass({ className={this._classForField(FIELD_USERNAME, 'mx_Login_field')} onBlur={function() {self.validateField(FIELD_USERNAME);}} />
- { this.props.guestUsername ? -
{_t("Setting a user name will create a fresh account")}
: null - } disabled URL previews by default.": "Vous avez désactivé les aperçus d’URL par défaut.", "You have enabled URL previews by default.": "Vous avez activé les aperçus d’URL par défaut.", diff --git a/src/i18n/strings/nl.json b/src/i18n/strings/nl.json index 226706c884..074e7e9fd4 100644 --- a/src/i18n/strings/nl.json +++ b/src/i18n/strings/nl.json @@ -120,7 +120,6 @@ "zh-sg": "Chinees (Singapore)", "zh-tw": "Chinees (Taiwan)", "zu": "Zulu", - "A registered account is required for this action": "Voor deze actie is een geregistreerd account nodig", "A text message has been sent to +%(msisdn)s. Please enter the verification code it contains": "Voer alsjeblieft de verificatiecode in die is verstuurd naar +%(msisdn)s", "accept": "accepteer", "%(targetName)s accepted an invitation.": "%(targetName)s heeft een uitnodiging geaccepteerd.", diff --git a/src/i18n/strings/pt.json b/src/i18n/strings/pt.json index 850e95f61f..7ce73f8310 100644 --- a/src/i18n/strings/pt.json +++ b/src/i18n/strings/pt.json @@ -700,7 +700,6 @@ "%(oneUser)schanged their avatar %(repeats)s times": "%(oneUser)salterou sua imagem pública %(repeats)s vezes", "%(severalUsers)schanged their avatar": "%(severalUsers)salteraram sua imagem pública", "Ban": "Banir", - "A registered account is required for this action": "Uma conta registrada é necessária para esta ação", "Access Token:": "Token de acesso:", "Always show message timestamps": "Sempre mostrar as datas das mensagens", "Authentication": "Autenticação", @@ -716,7 +715,6 @@ "Mute": "Silenciar", "olm version:": "versão do olm:", "Operation failed": "A operação falhou", - "Registration required": "Registro obrigatório", "Remove %(threePid)s?": "Remover %(threePid)s?", "Report it": "Reportar", "riot-web version:": "versão do riot-web:", @@ -860,7 +858,6 @@ "Anyone": "Qualquer pessoa", "Are you sure you want to leave the room '%(roomName)s'?": "Você tem certeza que deseja sair da sala '%(roomName)s'?", "Custom level": "Nível personalizado", - "(default: %(userName)s)": "(padrão: %(userName)s)", "Device ID:": "ID do dispositivo:", "device id: ": "id do dispositivo: ", "Device key:": "Chave do dispositivo:", @@ -871,7 +868,6 @@ "Register": "Registre-se", "Remote addresses for this room:": "Endereços remotos para esta sala:", "Save": "Salvar", - "Setting a user name will create a fresh account": "Definir um nome de usuária(o) vai criar uma conta nova", "Tagged as: ": "Marcado como: ", "You have disabled URL previews by default.": "Você desabilitou pré-visualizações de links por padrão.", "You have enabled URL previews by default.": "Você habilitou pré-visualizações de links por padrão.", diff --git a/src/i18n/strings/pt_BR.json b/src/i18n/strings/pt_BR.json index 75d7a115b2..95e29c45ec 100644 --- a/src/i18n/strings/pt_BR.json +++ b/src/i18n/strings/pt_BR.json @@ -700,7 +700,6 @@ "%(oneUser)schanged their avatar %(repeats)s times": "%(oneUser)salterou sua imagem pública %(repeats)s vezes", "%(severalUsers)schanged their avatar": "%(severalUsers)salteraram sua imagem pública", "Ban": "Banir", - "A registered account is required for this action": "Uma conta registrada é necessária para esta ação", "Access Token:": "Token de acesso:", "Always show message timestamps": "Sempre mostrar as datas das mensagens", "Authentication": "Autenticação", @@ -716,7 +715,6 @@ "Mute": "Mudo", "olm version:": "versão do olm:", "Operation failed": "A operação falhou", - "Registration required": "Registro obrigatório", "Remove %(threePid)s?": "Remover %(threePid)s?", "Report it": "Reportar", "riot-web version:": "versão do riot-web:", @@ -860,7 +858,6 @@ "Anyone": "Qualquer pessoa", "Are you sure you want to leave the room '%(roomName)s'?": "Você tem certeza que deseja sair da sala '%(roomName)s'?", "Custom level": "Nível personalizado", - "(default: %(userName)s)": "(padrão: %(userName)s)", "Device ID:": "ID do dispositivo:", "device id: ": "id do dispositivo: ", "Device key:": "Chave do dispositivo:", @@ -871,7 +868,6 @@ "Register": "Registre-se", "Remote addresses for this room:": "Endereços remotos para esta sala:", "Save": "Salvar", - "Setting a user name will create a fresh account": "Definir um nome de usuária(o) vai criar uma conta nova", "Tagged as: ": "Marcado como: ", "You have disabled URL previews by default.": "Você desabilitou pré-visualizações de links por padrão.", "You have enabled URL previews by default.": "Você habilitou pré-visualizações de links por padrão.", diff --git a/src/i18n/strings/ru.json b/src/i18n/strings/ru.json index ea6487b16e..6e4179fa24 100644 --- a/src/i18n/strings/ru.json +++ b/src/i18n/strings/ru.json @@ -473,7 +473,6 @@ "Failed to forget room %(errCode)s": "Не удалось забыть комнату %(errCode)s", "Failed to join room": "Не удалось присоединиться к комнате", "Failed to join the room": "Не удалось войти в комнату", - "A registered account is required for this action": "Необходима зарегистрированная учетная запись для этого действия", "Access Token:": "Токен:", "Always show message timestamps": "Всегда показывать время сообщения", "Authentication": "Авторизация", @@ -531,7 +530,6 @@ "Press": "Нажать", "Profile": "Профиль", "Reason": "Причина", - "Registration required": "Требуется регистрация", "rejected": "отклонено", "%(targetName)s rejected the invitation.": "%(targetName)s отклонил приглашение.", "Reject invitation": "Отклонить приглашение", @@ -686,7 +684,6 @@ "%(senderDisplayName)s removed the room name.": "%(senderDisplayName)s удалил имя комнаты.", "Changing password will currently reset any end-to-end encryption keys on all devices, making encrypted chat history unreadable, unless you first export your room keys and re-import them afterwards. In future this will be improved.": "Смена пароля также сбросит все ключи шифрования на всех устройствах, сделав зашифрованную историю недоступной, если только вы сначала не экспортируете ключи шифрования и не импортируете их потом. В будущем это будет исправлено.", "Custom level": "Пользовательский уровень", - "(default: %(userName)s)": "(по-умолчанию: %(userName)s)", "Device already verified!": "Устройство уже верифицировано!", "Device ID:": "ID устройства:", "device id: ": "id устройства: ", @@ -729,7 +726,6 @@ "Session ID": "ID сессии", "%(senderName)s set a profile picture.": "%(senderName)s установил картинку профиля.", "%(senderName)s set their display name to %(displayName)s.": "%(senderName)s установил отображаемое имя %(displayName)s.", - "Setting a user name will create a fresh account": "Установка имени пользователя создаст новую учетную запись", "Signed Out": "Вышли", "Sorry, this homeserver is using a login which is not recognised ": "Извините, этот Home Server использует логин, который не удалось распознать ", "Tagged as: ": "Теги: ", diff --git a/src/i18n/strings/sv.json b/src/i18n/strings/sv.json index af5e27acc2..a5d8b2980d 100644 --- a/src/i18n/strings/sv.json +++ b/src/i18n/strings/sv.json @@ -119,7 +119,6 @@ "zh-sg": "Kinesiska (Singapore)", "zh-tw": "Kinesiska (Taiwan)", "zu": "Zulu", - "A registered account is required for this action": "Ett registrerat konto behövs för den här handlingen", "A text message has been sent to +%(msisdn)s. Please enter the verification code it contains": "Ett SMS har skickats till +%(msisdn)s. Vänligen ange verifieringskoden ur meddelandet", "accept": "acceptera", "%(targetName)s accepted an invitation.": "%(targetName)s accepterade en inbjudan.", @@ -222,7 +221,6 @@ "decline": "avböj", "Decrypt %(text)s": "Dekryptera %(text)s", "Decryption error": "Dekrypteringsfel", - "(default: %(userName)s)": "(standard: %(userName)s)", "Delete": "Radera", "demote": "degradera", "Deops user with given id": "Degraderar användaren med givet id", diff --git a/src/i18n/strings/th.json b/src/i18n/strings/th.json index a54f7fee42..edc197a1af 100644 --- a/src/i18n/strings/th.json +++ b/src/i18n/strings/th.json @@ -22,7 +22,6 @@ "Create Room": "สรัางห้อง", "Delete": "ลบ", "Default": "ค่าเริ่มต้น", - "(default: %(userName)s)": "(ค่าเริ่มต้น: %(userName)s)", "Default Device": "อุปกรณ์เริ่มต้น", "%(senderName)s banned %(targetName)s.": "%(senderName)s แบน %(targetName)s แล้ว", "%(senderDisplayName)s changed the topic to \"%(topic)s\".": "%(senderDisplayName)s เปลี่ยนหัวข้อเป็น \"%(topic)s\"", @@ -262,7 +261,6 @@ "Privileged Users": "ผู้ใช้ที่มีสิทธิพิเศษ", "Revoke Moderator": "เพิกถอนผู้ช่วยดูแล", "Refer a friend to Riot:": "แนะนำเพื่อนให้รู้จัก Riot:", - "Registration required": "ต้องลงทะเบียนก่อน", "rejected": "ปฏิเสธแล้ว", "%(targetName)s rejected the invitation.": "%(targetName)s ปฏิเสธคำเชิญแล้ว", "Reject invitation": "ปฏิเสธคำเชิญ", @@ -296,7 +294,6 @@ "Server unavailable, overloaded, or something else went wrong.": "เซิร์ฟเวอร์อาจไม่พร้อมใช้งาน ทำงานหนักเกินไป หรือบางอย่างผิดปกติ", "%(senderName)s set a profile picture.": "%(senderName)s ตั้งรูปโปรไฟล์", "%(senderName)s set their display name to %(displayName)s.": "%(senderName)s ตั้งชื่อที่แสดงเป็น %(displayName)s", - "Setting a user name will create a fresh account": "การตั้งชื่อผู้ใช้จะสร้างบัญชีใหม่", "Show panel": "แสดงหน้าต่าง", "Signed Out": "ออกจากระบบแล้ว", "Sign in": "เข้าสู่ระบบ", diff --git a/src/i18n/strings/zh_Hant.json b/src/i18n/strings/zh_Hant.json index c3b5c23191..a1c156b796 100644 --- a/src/i18n/strings/zh_Hant.json +++ b/src/i18n/strings/zh_Hant.json @@ -340,7 +340,6 @@ "device id: ": "裝置 id:", "Reason": "原因", "Register": "注冊", - "Registration required": "要求註冊", "rejected": "拒絕", "Default server": "默認的伺服器", "Custom server": "自定的伺服器",