Adds a workaround to login on servers without .well_known

This commit is contained in:
Jan Bidler
2022-08-25 12:51:13 +02:00
committed by Tobias Fella
parent 4ed123fd52
commit 5f12e10fe9
2 changed files with 5 additions and 2 deletions

View File

@@ -156,7 +156,10 @@ void Login::login()
m_isLoggingIn = true;
Q_EMIT isLoggingInChanged();
m_connection->loginWithPassword(m_matrixId, m_password, m_deviceName, QString());
// Some servers do not have a .well_known file. So we login via the username part from the mxid,
// rather than with the full mxid, as that would lead to an invalid user.
QStringRef username(&m_matrixId, 1, m_matrixId.indexOf(":") - 1);
m_connection->loginWithPassword(username.toString(), m_password, m_deviceName, QString());
}
bool Login::supportsPassword() const

View File

@@ -29,7 +29,7 @@ LoginStep {
Kirigami.FormData.label: i18n("Matrix ID:")
placeholderText: "@user:matrix.org"
onTextChanged: {
if(acceptableInput) {
if (acceptableInput) {
LoginHelper.matrixId = text
}
}