Skip to content

Commit 33b1ba2

Browse files
committed
Enable masking of cpid in privacy mode
1 parent bd96a4e commit 33b1ba2

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/qt/overviewpage.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,12 @@ void OverviewPage::setPrivacy(bool privacy)
340340

341341
ui->recentTransactionsNoResult->setVisible(m_privacy || !transaction_count);
342342
ui->listTransactions->setVisible(!m_privacy && transaction_count);
343-
if (researcherModel) researcherModel->setMaskAccrualAndMagnitude(m_privacy);
343+
if (researcherModel) researcherModel->setMaskCpidMagnitudeAccrual(m_privacy);
344344

345345
LogPrint(BCLog::LogFlags::QT, "INFO: %s: m_privacy = %u", __func__, m_privacy);
346346

347347
updateTransactions();
348+
updateResearcherStatus();
348349
updatePendingAccrual();
349350
}
350351

src/qt/researcher/researchermodel.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void ResearcherModel::setTheme(const QString& theme_name)
207207
emit beaconChanged();
208208
}
209209

210-
void ResearcherModel::setMaskAccrualAndMagnitude(bool privacy)
210+
void ResearcherModel::setMaskCpidMagnitudeAccrual(bool privacy)
211211
{
212212
m_privacy_enabled = privacy;
213213

@@ -306,7 +306,13 @@ QString ResearcherModel::email() const
306306

307307
QString ResearcherModel::formatCpid() const
308308
{
309-
return QString::fromStdString(m_researcher->Id().ToString());
309+
QString text = QString::fromStdString(m_researcher->Id().ToString());
310+
311+
if (m_privacy_enabled) {
312+
text = "################################";
313+
}
314+
315+
return text;
310316
}
311317

312318
QString ResearcherModel::formatMagnitude() const
@@ -315,7 +321,7 @@ QString ResearcherModel::formatMagnitude() const
315321

316322
if (outOfSync()) {
317323
text = "...";
318-
} else if (m_privacy_enabled){
324+
} else if (m_privacy_enabled) {
319325
text = "#";
320326
} else {
321327
text = QString::fromStdString(m_researcher->Magnitude().ToString());

src/qt/researcher/researchermodel.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class ResearcherModel : public QObject
8181

8282
void showWizard(WalletModel* wallet_model);
8383
void setTheme(const QString& theme_name);
84-
void setMaskAccrualAndMagnitude(bool privacy);
84+
void setMaskCpidMagnitudeAccrual(bool privacy);
8585

8686
bool configuredForInvestorMode() const;
8787
bool outOfSync() const;

0 commit comments

Comments
 (0)