mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-27 15:57:08 -05:00
fixed setting up avatar when creating a GxsId
This commit is contained in:
parent
f0500c3fd1
commit
499753f873
@ -969,16 +969,14 @@ bool p3IdService::createIdentity(
|
|||||||
{
|
{
|
||||||
if(!rsNotify->cachePgpPassphrase(pgpPassword))
|
if(!rsNotify->cachePgpPassphrase(pgpPassword))
|
||||||
{
|
{
|
||||||
RsErr() << __PRETTY_FUNCTION__ << " Failure caching password"
|
RsErr() << __PRETTY_FUNCTION__ << " Failure caching password" << std::endl;
|
||||||
<< std::endl;
|
|
||||||
ret = false;
|
ret = false;
|
||||||
goto LabelCreateIdentityCleanup;
|
goto LabelCreateIdentityCleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!rsNotify->setDisableAskPassword(true))
|
if(!rsNotify->setDisableAskPassword(true))
|
||||||
{
|
{
|
||||||
RsErr() << __PRETTY_FUNCTION__ << " Failure disabling password user"
|
RsErr() << __PRETTY_FUNCTION__ << " Failure disabling password user request" << std::endl;
|
||||||
<< " request" << std::endl;
|
|
||||||
ret = false;
|
ret = false;
|
||||||
goto LabelCreateIdentityCleanup;
|
goto LabelCreateIdentityCleanup;
|
||||||
}
|
}
|
||||||
@ -990,8 +988,7 @@ bool p3IdService::createIdentity(
|
|||||||
|
|
||||||
if(!createIdentity(token, params))
|
if(!createIdentity(token, params))
|
||||||
{
|
{
|
||||||
RsErr() << __PRETTY_FUNCTION__ << " Failed creating GXS group."
|
RsErr() << __PRETTY_FUNCTION__ << " Failed creating GXS group." << std::endl;
|
||||||
<< std::endl;
|
|
||||||
ret = false;
|
ret = false;
|
||||||
goto LabelCreateIdentityCleanup;
|
goto LabelCreateIdentityCleanup;
|
||||||
}
|
}
|
||||||
@ -1003,16 +1000,14 @@ bool p3IdService::createIdentity(
|
|||||||
token, std::chrono::seconds(10), std::chrono::milliseconds(20) ))
|
token, std::chrono::seconds(10), std::chrono::milliseconds(20) ))
|
||||||
!= RsTokenService::COMPLETE )
|
!= RsTokenService::COMPLETE )
|
||||||
{
|
{
|
||||||
RsErr() << __PRETTY_FUNCTION__ << " waitToken("<< token
|
RsErr() << __PRETTY_FUNCTION__ << " waitToken("<< token << ") failed with: " << wtStatus << std::endl;
|
||||||
<< ") failed with: " << wtStatus << std::endl;
|
|
||||||
ret = false;
|
ret = false;
|
||||||
goto LabelCreateIdentityCleanup;
|
goto LabelCreateIdentityCleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!RsGenExchange::getPublishedGroupMeta(token, meta))
|
if(!RsGenExchange::getPublishedGroupMeta(token, meta))
|
||||||
{
|
{
|
||||||
RsErr() << __PRETTY_FUNCTION__ << " Failure getting updated group data."
|
RsErr() << __PRETTY_FUNCTION__ << " Failure getting updated group data." << std::endl;
|
||||||
<< std::endl;
|
|
||||||
ret = false;
|
ret = false;
|
||||||
goto LabelCreateIdentityCleanup;
|
goto LabelCreateIdentityCleanup;
|
||||||
}
|
}
|
||||||
|
@ -547,18 +547,20 @@ void IdEditDialog::createId()
|
|||||||
params.nickname = groupname.toUtf8().constData();
|
params.nickname = groupname.toUtf8().constData();
|
||||||
params.isPgpLinked = (ui->radioButton_GpgId->isChecked());
|
params.isPgpLinked = (ui->radioButton_GpgId->isChecked());
|
||||||
|
|
||||||
if (!mAvatar.isNull())
|
mAvatar = ui->avatarLabel->extractCroppedScaledPicture();
|
||||||
{
|
|
||||||
QByteArray ba;
|
|
||||||
QBuffer buffer(&ba);
|
|
||||||
|
|
||||||
buffer.open(QIODevice::WriteOnly);
|
if (!mAvatar.isNull())
|
||||||
mAvatar.save(&buffer, "PNG"); // writes image into ba in PNG format
|
{
|
||||||
|
QByteArray ba;
|
||||||
|
QBuffer buffer(&ba);
|
||||||
|
|
||||||
params.mImage.copy((uint8_t *) ba.data(), ba.size());
|
buffer.open(QIODevice::WriteOnly);
|
||||||
}
|
mAvatar.save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||||
else
|
|
||||||
params.mImage.clear();
|
params.mImage.copy((uint8_t *) ba.data(), ba.size());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
params.mImage.clear();
|
||||||
|
|
||||||
RsGxsId keyId;
|
RsGxsId keyId;
|
||||||
std::string gpg_password;
|
std::string gpg_password;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user