From b4a9dd410c44e99dd1eb6775deea50f042899e15 Mon Sep 17 00:00:00 2001 From: Silarn Date: Sun, 27 Jan 2019 23:04:58 -0600 Subject: Fix issue with endorsement response parsing --- src/mainwindow.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c2b61614..f875c95c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -5569,17 +5569,15 @@ void MainWindow::nxmDescriptionAvailable(QString gameName, int modID, QVariant u void MainWindow::nxmEndorsementToggled(QString, int, QVariant, QVariant resultData, int) { QMap results = resultData.toMap(); - if (results["code"].toInt() == 200 || results["code"].toInt() == 201) { - if (results["status"].toString().compare("Endorsed") == 0) { - QMessageBox::information(this, tr("Thank you!"), tr("Thank you for your endorsement!")); - } else if (results["status"].toString().compare("Abstained") == 0) { - QMessageBox::information(this, tr("Okay."), tr("This mod will not be endorsed and will no longer ask you to endorse.")); - } - ui->actionEndorseMO->setVisible(false); - if (!disconnect(sender(), SIGNAL(nxmEndorsementToggled(QString, int, QVariant, QVariant, int)), - this, SLOT(nxmEndorsementToggled(QString, int, QVariant, QVariant, int)))) { - qCritical("failed to disconnect endorsement slot"); - } + if (results["status"].toString().compare("Endorsed") == 0) { + QMessageBox::information(this, tr("Thank you!"), tr("Thank you for your endorsement!")); + } else if (results["status"].toString().compare("Abstained") == 0) { + QMessageBox::information(this, tr("Okay."), tr("This mod will not be endorsed and will no longer ask you to endorse.")); + } + ui->actionEndorseMO->setVisible(false); + if (!disconnect(sender(), SIGNAL(nxmEndorsementToggled(QString, int, QVariant, QVariant, int)), + this, SLOT(nxmEndorsementToggled(QString, int, QVariant, QVariant, int)))) { + qCritical("failed to disconnect endorsement slot"); } } -- cgit v1.3.1