Merge pull request #1534 from Nheko-Reborn/issue1494

Use @user:example.com for all sample mxids
This commit is contained in:
DeepBlueV7.X 2023-10-01 12:57:03 +00:00 committed by GitHub
commit e9104f8c69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View file

@ -100,7 +100,7 @@ ApplicationWindow {
property bool isValidMxid: text.match("@.+?:.{3,}") property bool isValidMxid: text.match("@.+?:.{3,}")
backgroundColor: palette.window backgroundColor: palette.window
placeholderText: qsTr("@joe:matrix.org", "Example user id. The name 'joe' can be localized however you want.") placeholderText: qsTr("@user:yourserver.example.com", "Example user id. The name 'user' can be localized however you want.")
Layout.fillWidth: true Layout.fillWidth: true
onAccepted: { onAccepted: {
if (isValidMxid) { if (isValidMxid) {

View file

@ -56,10 +56,10 @@ Item {
MatrixTextField { MatrixTextField {
id: matrixIdLabel id: matrixIdLabel
label: qsTr("Matrix ID") label: qsTr("Matrix ID")
placeholderText: qsTr("e.g @joe:matrix.org") placeholderText: qsTr("e.g @user:yourserver.example.com")
onEditingFinished: login.mxid = text onEditingFinished: login.mxid = text
ToolTip.text: qsTr("Your login name. A mxid should start with @ followed by the user ID. After the user ID you need to include your server name after a :.\nYou can also put your homeserver address there if your server doesn't support .well-known lookup.\nExample: @user:server.my\nIf Nheko fails to discover your homeserver, it will show you a field to enter the server manually.") ToolTip.text: qsTr("Your login name. A mxid should start with @ followed by the user ID. After the user ID you need to include your server name after a :.\nYou can also put your homeserver address there if your server doesn't support .well-known lookup.\nExample: @user:yourserver.example.com\nIf Nheko fails to discover your homeserver, it will show you a field to enter the server manually.")
Keys.forwardTo: [pwBtn, ssoRepeater] Keys.forwardTo: [pwBtn, ssoRepeater]
} }
@ -109,10 +109,10 @@ Item {
Layout.fillWidth: true Layout.fillWidth: true
label: qsTr("Homeserver address") label: qsTr("Homeserver address")
placeholderText: qsTr("server.my:8787") placeholderText: qsTr("yourserver.example.com:8787")
text: login.homeserver text: login.homeserver
onEditingFinished: login.homeserver = text onEditingFinished: login.homeserver = text
ToolTip.text: qsTr("The address that can be used to contact you homeserver's client API.\nExample: https://server.my:8787") ToolTip.text: qsTr("The address that can be used to contact your homeserver's client API.\nExample: https://yourserver.example.com:8787")
Keys.forwardTo: [pwBtn, ssoRepeater] Keys.forwardTo: [pwBtn, ssoRepeater]
} }

View file

@ -76,13 +76,13 @@ LoginPage::onMatrixIdEntered()
try { try {
user = parse<User>(mxid_.toStdString()); user = parse<User>(mxid_.toStdString());
} catch (const std::exception &) { } catch (const std::exception &) {
mxidError_ = tr("You have entered an invalid Matrix ID e.g @joe:matrix.org"); mxidError_ = tr("You have entered an invalid Matrix ID e.g. @user:yourserver.example.com");
emit mxidErrorChanged(); emit mxidErrorChanged();
return; return;
} }
if (user.hostname().empty() || user.localpart().empty()) { if (user.hostname().empty() || user.localpart().empty()) {
mxidError_ = tr("You have entered an invalid Matrix ID e.g @joe:matrix.org"); mxidError_ = tr("You have entered an invalid Matrix ID e.g. @user:yourserver.example.com");
emit mxidErrorChanged(); emit mxidErrorChanged();
return; return;
} else { } else {
@ -146,7 +146,7 @@ LoginPage::checkHomeserverVersion()
try { try {
User user = parse<User>(mxid_.toStdString()); User user = parse<User>(mxid_.toStdString());
} catch (const std::exception &) { } catch (const std::exception &) {
mxidError_ = tr("You have entered an invalid Matrix ID e.g @joe:matrix.org"); mxidError_ = tr("You have entered an invalid Matrix ID e.g. @user:yourserver.example.com");
emit mxidErrorChanged(); emit mxidErrorChanged();
return; return;
} }
@ -273,7 +273,7 @@ LoginPage::onLoginButtonClicked(LoginMethod loginMethod,
try { try {
user = parse<User>(userid.toStdString()); user = parse<User>(userid.toStdString());
} catch (const std::exception &) { } catch (const std::exception &) {
mxidError_ = tr("You have entered an invalid Matrix ID e.g @joe:matrix.org"); mxidError_ = tr("You have entered an invalid Matrix ID e.g. @user:yourserver.example.com");
emit mxidErrorChanged(); emit mxidErrorChanged();
return; return;
} }