fixed bugs causing short invites to not generate/parse hidden nodes with correct options to keep hidden address

This commit is contained in:
csoler 2020-10-06 23:02:00 +02:00
parent ab6688f1eb
commit 3912c6562e
4 changed files with 11 additions and 9 deletions

View File

@ -1392,7 +1392,7 @@ bool p3Peers::parseShortInvite(const std::string& inviteStrUrl, RsPeerDetails& d
case RsShortInviteFieldType::HIDDEN_LOCATOR:
details.hiddenType = (((uint32_t)buf[0]) << 24)+(((uint32_t)buf[1])<<16)+(((uint32_t)buf[2])<<8) + (uint32_t)buf[3];
details.hiddenNodePort = (((uint32_t)buf[4]) << 8)+ (uint32_t)buf[5];
details.isHiddenNode = true;
details.hiddenNodeAddress = std::string((char*)&buf[6],s-6);
break;
@ -1538,7 +1538,7 @@ std::string p3Peers::GetRetroshareInvite(
if (getPeerDetails(ssl_id, detail))
{
if(!includeExtraLocators) detail.ipAddressList.clear();
if(!includeExtraLocators && !detail.isHiddenNode) detail.ipAddressList.clear();
unsigned char *mem_block = nullptr;
size_t mem_block_size = 0;

View File

@ -189,8 +189,6 @@ void HomePage::updateOwnCert()
void HomePage::updateOwnId()
{
bool include_extra_locators = mIncludeAllIPs;
RsPeerDetails detail;
if (!rsPeers->getPeerDetails(rsPeers->getOwnId(), detail))
@ -199,9 +197,10 @@ void HomePage::updateOwnId()
return ;
}
std::string invite ;
bool include_extra_locators = mIncludeAllIPs || detail.isHiddenNode;
std::string invite ;
rsPeers->getShortInvite(invite,rsPeers->getOwnId(),true,!mIncludeAllIPs);
rsPeers->getShortInvite(invite,rsPeers->getOwnId(),true,!include_extra_locators);
ui->retroshareid->setText(QString::fromUtf8(invite.c_str()));
}

View File

@ -174,7 +174,7 @@ private and secure decentralized communication platform.
<string>...</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="icons.qrc">
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
</property>
<property name="checkable">
@ -232,6 +232,9 @@ private and secure decentralized communication platform.
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
@ -338,8 +341,8 @@ private and secure decentralized communication platform.
</layout>
</widget>
<resources>
<include location="images.qrc"/>
<include location="icons.qrc"/>
<include location="images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -277,7 +277,7 @@ void ConfCertDialog::loadInvitePage()
if(ui._shortFormat_CB->isChecked())
{
rsPeers->getShortInvite(invite,detail.id,true,!ui._includeIPHistory_CB->isChecked() );
rsPeers->getShortInvite(invite,detail.id,true,!(ui._includeIPHistory_CB->isChecked()|| detail.isHiddenNode) );
ui.stabWidget->setTabText(1, tr("Retroshare ID"));
}
else