diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp index e6dcd6cf3..550826f43 100644 --- a/retroshare-gui/src/gui/GenCertDialog.cpp +++ b/retroshare-gui/src/gui/GenCertDialog.cpp @@ -587,8 +587,6 @@ void GenCertDialog::genPerson() std::cout << "RsAccounts::GenerateSSLCertificate" << std::endl; bool okGen = RsAccounts::GenerateSSLCertificate(PGPId, "", genLoc, "", isHiddenLoc, sslPasswd, sslId, err); - rsNotify->clearPgpPassphrase() ; - if (okGen) { /* complete the process */ diff --git a/retroshare-gui/src/gui/StartDialog.cpp b/retroshare-gui/src/gui/StartDialog.cpp index 2a25eff77..27853c3e6 100644 --- a/retroshare-gui/src/gui/StartDialog.cpp +++ b/retroshare-gui/src/gui/StartDialog.cpp @@ -117,8 +117,6 @@ void StartDialog::loadPerson() bool res = Rshare::loadCertificate(accountId, ui.autologin_checkbox->isChecked()) ; - rsNotify->clearPgpPassphrase(); - if(res) accept(); } diff --git a/retroshare-gui/src/gui/notifyqt.cpp b/retroshare-gui/src/gui/notifyqt.cpp index 91a6153a7..7e6195e5e 100644 --- a/retroshare-gui/src/gui/notifyqt.cpp +++ b/retroshare-gui/src/gui/notifyqt.cpp @@ -785,6 +785,13 @@ void NotifyQt::notifyListPreChange(int list, int /*type*/) * uses Flags, to detect changes */ +void NotifyQt::resetCachedPassphrases() +{ + std::cerr << "Clearing PGP passphrase." << std::endl; + + rsNotify->clearPgpPassphrase() ; +} + void NotifyQt::enable() { QMutexLocker m(&_mutex) ; diff --git a/retroshare-gui/src/gui/notifyqt.h b/retroshare-gui/src/gui/notifyqt.h index f04394eb1..446d8d9e2 100644 --- a/retroshare-gui/src/gui/notifyqt.h +++ b/retroshare-gui/src/gui/notifyqt.h @@ -155,6 +155,7 @@ class NotifyQt: public QObject, public NotifyClient public slots: void UpdateGUI(); /* called by timer */ void SetDisableAll(bool bValue); + void resetCachedPassphrases() ; private slots: void runningTick(); diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index 674e23065..1e2da635b 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -397,7 +397,6 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO); uint32_t token = 0; rsIdentity->createIdentity(token, params); } - // I'm using a signal to transfer the hashing info to the mainwindow, because Qt schedules signals properly to // avoid clashes between infos from threads. // @@ -443,6 +442,11 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO); WebuiPage::checkStartWebui(); #endif // ENABLE_WEBUI + // This is done using a timer, because the passphrase request from notify is asynchrouneous and therefore clearing the + // passphrase here makes it request for a passphrase when creating the default chat identity. + + QTimer::singleShot(10000, Qt::CoarseTimer, notify, SLOT(resetCachedPassphrases())) ; + /* dive into the endless loop */ int ti = rshare.exec(); delete w ;