fixed setting up avatar when creating a GxsId

This commit is contained in:
csoler 2021-02-10 20:57:55 +01:00
parent f0500c3fd1
commit 499753f873
2 changed files with 17 additions and 20 deletions

View File

@ -969,16 +969,14 @@ bool p3IdService::createIdentity(
{
if(!rsNotify->cachePgpPassphrase(pgpPassword))
{
RsErr() << __PRETTY_FUNCTION__ << " Failure caching password"
<< std::endl;
RsErr() << __PRETTY_FUNCTION__ << " Failure caching password" << std::endl;
ret = false;
goto LabelCreateIdentityCleanup;
}
if(!rsNotify->setDisableAskPassword(true))
{
RsErr() << __PRETTY_FUNCTION__ << " Failure disabling password user"
<< " request" << std::endl;
RsErr() << __PRETTY_FUNCTION__ << " Failure disabling password user request" << std::endl;
ret = false;
goto LabelCreateIdentityCleanup;
}
@ -990,8 +988,7 @@ bool p3IdService::createIdentity(
if(!createIdentity(token, params))
{
RsErr() << __PRETTY_FUNCTION__ << " Failed creating GXS group."
<< std::endl;
RsErr() << __PRETTY_FUNCTION__ << " Failed creating GXS group." << std::endl;
ret = false;
goto LabelCreateIdentityCleanup;
}
@ -1003,16 +1000,14 @@ bool p3IdService::createIdentity(
token, std::chrono::seconds(10), std::chrono::milliseconds(20) ))
!= RsTokenService::COMPLETE )
{
RsErr() << __PRETTY_FUNCTION__ << " waitToken("<< token
<< ") failed with: " << wtStatus << std::endl;
RsErr() << __PRETTY_FUNCTION__ << " waitToken("<< token << ") failed with: " << wtStatus << std::endl;
ret = false;
goto LabelCreateIdentityCleanup;
}
if(!RsGenExchange::getPublishedGroupMeta(token, meta))
{
RsErr() << __PRETTY_FUNCTION__ << " Failure getting updated group data."
<< std::endl;
RsErr() << __PRETTY_FUNCTION__ << " Failure getting updated group data." << std::endl;
ret = false;
goto LabelCreateIdentityCleanup;
}

View File

@ -547,18 +547,20 @@ void IdEditDialog::createId()
params.nickname = groupname.toUtf8().constData();
params.isPgpLinked = (ui->radioButton_GpgId->isChecked());
if (!mAvatar.isNull())
{
QByteArray ba;
QBuffer buffer(&ba);
mAvatar = ui->avatarLabel->extractCroppedScaledPicture();
buffer.open(QIODevice::WriteOnly);
mAvatar.save(&buffer, "PNG"); // writes image into ba in PNG format
if (!mAvatar.isNull())
{
QByteArray ba;
QBuffer buffer(&ba);
params.mImage.copy((uint8_t *) ba.data(), ba.size());
}
else
params.mImage.clear();
buffer.open(QIODevice::WriteOnly);
mAvatar.save(&buffer, "PNG"); // writes image into ba in PNG format
params.mImage.copy((uint8_t *) ba.data(), ba.size());
}
else
params.mImage.clear();
RsGxsId keyId;
std::string gpg_password;