MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / refreshCertFromServer

Method refreshCertFromServer

src/database/WizDatabase.cpp:3899–3935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3897}
3898
3899bool WizDatabase::refreshCertFromServer()
3900{
3901 auto refreshCore = [&]{
3902 if (isGroup())
3903 {
3904 WizDatabase* db = personalDatabase();
3905 WizKMAccountsServer server;
3906 if (!server.login(db->getUserId(), db->getPassword()))
3907 return false;
3908 //
3909 QString strN, stre, strd, strHint;
3910
3911 if (!server.getUserBizCert(bizGuid(), strN, stre, strd, strHint))
3912 return false;
3913 //
3914 return setUserCert(strN, stre, strd, strHint);
3915 }
3916 else
3917 {
3918 QString strN, stre, strd, strHint;
3919 //
3920 WizKMAccountsServer server;
3921 server.setUserInfo(WizToken::userInfo());
3922 if (!server.getCert(strN, stre, strd, strHint))
3923 return false;
3924 //
3925 return setUserCert(strN, stre, strd, strHint);
3926 }
3927 };
3928
3929 bool ret = false;
3930 WizExecutingActionDialog::executeAction(tr("Downloading cert..."), WIZ_THREAD_NETWORK, [&]{
3931 ret = refreshCore();
3932 });
3933 //
3934 return ret;
3935}
3936
3937bool WizDatabase::initCert(bool queryPassword)
3938{

Callers

nothing calls this directly

Calls 7

isGroupFunction · 0.85
loginMethod · 0.80
getUserIdMethod · 0.80
getUserBizCertMethod · 0.80
getCertMethod · 0.80
getPasswordMethod · 0.45
setUserInfoMethod · 0.45

Tested by

no test coverage detected