summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Olm.cpp5
-rw-r--r--src/RegisterPage.cpp4
-rw-r--r--src/Utils.cpp4
3 files changed, 8 insertions, 5 deletions
diff --git a/src/Olm.cpp b/src/Olm.cpp

index 808279a3..1f58758c 100644 --- a/src/Olm.cpp +++ b/src/Olm.cpp
@@ -602,8 +602,9 @@ send_key_request_for(mtx::events::EncryptedEvent<mtx::events::msg::Encrypted> e, e.content.session_id); mtx::events::msg::KeyRequest request; - request.action = !cancel ? mtx::events::msg::RequestAction::Request - : mtx::events::msg::RequestAction::Cancellation; + request.action = cancel ? mtx::events::msg::RequestAction::Cancellation + : mtx::events::msg::RequestAction::Request; + request.algorithm = MEGOLM_ALGO; request.room_id = e.room_id; request.sender_key = e.content.sender_key; diff --git a/src/RegisterPage.cpp b/src/RegisterPage.cpp
index 26a66ab7..44ad7a3d 100644 --- a/src/RegisterPage.cpp +++ b/src/RegisterPage.cpp
@@ -405,7 +405,9 @@ void RegisterPage::onRegisterButtonClicked() { if (!checkFields()) { - showError(error_label_, tr("One or more fields have invalid inputs. Please correct those issues and try again.")); + showError(error_label_, + tr("One or more fields have invalid inputs. Please correct those issues " + "and try again.")); return; } else { auto username = username_input_->text().toStdString(); diff --git a/src/Utils.cpp b/src/Utils.cpp
index 463c8af3..7fcaf5e2 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp
@@ -638,8 +638,8 @@ utils::luminance(const QColor &col) qreal lumRgb[3]; for (int i = 0; i < 3; i++) { - qreal v = colRgb[i] / 255.0; - v <= 0.03928 ? lumRgb[i] = v / 12.92 : lumRgb[i] = qPow((v + 0.055) / 1.055, 2.4); + qreal v = colRgb[i] / 255.0; + lumRgb[i] = v <= 0.03928 ? v / 12.92 : qPow((v + 0.055) / 1.055, 2.4); } auto lum = lumRgb[0] * 0.2126 + lumRgb[1] * 0.7152 + lumRgb[2] * 0.0722;