mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-27 08:25:53 -04:00
added flags to invite system to unify the different variables and made sure the HomePage contains at least current IP (not fully tested)
This commit is contained in:
parent
d2bd947252
commit
9a2749dbe5
16 changed files with 339 additions and 313 deletions
|
@ -235,7 +235,7 @@ void GetStartedDialog::inviteFriends()
|
|||
{
|
||||
RsAutoUpdatePage::lockAllEvents();
|
||||
|
||||
cert = rsPeers->GetRetroshareInvite(RsPeerId(),false,false);
|
||||
cert = rsPeers->GetRetroshareInvite(RsPeerId(),RetroshareInviteFlags::DNS | RetroshareInviteFlags::CURRENT_IP | RetroshareInviteFlags::FULL_IP_HISTORY);
|
||||
|
||||
RsAutoUpdatePage::unlockAllEvents() ;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
#include "retroshare/rsinit.h"
|
||||
|
||||
#include "util/qtthreadsutils.h"
|
||||
|
||||
#include "gui/notifyqt.h"
|
||||
#include "gui/msgs/MessageComposer.h"
|
||||
#include "gui/connect/ConnectFriendWizard.h"
|
||||
|
@ -49,8 +51,7 @@ HomePage::HomePage(QWidget *parent) :
|
|||
MainPage(parent),
|
||||
ui(new Ui::HomePage),
|
||||
mIncludeAllIPs(false),
|
||||
mUseShortFormat(false),
|
||||
mUseBackwardCompatibleCert(false)
|
||||
mUseShortFormat(true)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
|
@ -86,7 +87,7 @@ HomePage::HomePage(QWidget *parent) :
|
|||
useOldFormatAct->setToolTip(tr("Displays the certificate format used up to version 0.6.5\nOld Retroshare nodes will not understand the\nnew short format"));
|
||||
connect(useOldFormatAct, SIGNAL(triggered()), this, SLOT(toggleUseOldFormat()));
|
||||
useOldFormatAct->setCheckable(true);
|
||||
useOldFormatAct->setChecked(mUseBackwardCompatibleCert);
|
||||
useOldFormatAct->setChecked(!mUseShortFormat);
|
||||
menu->addAction(useOldFormatAct);
|
||||
|
||||
menu->addSeparator();
|
||||
|
@ -96,27 +97,53 @@ HomePage::HomePage(QWidget *parent) :
|
|||
|
||||
ui->shareButton->setMenu(menu);
|
||||
|
||||
QObject::connect(ui->userCertEdit,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(certContextMenu(QPoint)));
|
||||
|
||||
connect(ui->openwebhelp,SIGNAL(clicked()), this,SLOT(openWebHelp())) ;
|
||||
|
||||
ui->userCertEdit->hide();
|
||||
|
||||
int S = QFontMetricsF(font()).height();
|
||||
QString help_str = tr(
|
||||
" <h1><img width=\"%1\" src=\":/icons/help_64.png\"> Welcome to Retroshare!</h1>\
|
||||
<p>You need to <b>make friends</b>! After you create a network of friends or join an existing network,\
|
||||
you'll be able to exchange files, chat, talk in forums, etc. </p>\
|
||||
<div align=center>\
|
||||
<IMG align=\"center\" width=\"%2\" src=\":/images/network_map.png\"/> \
|
||||
</div>\
|
||||
<p>To do so, copy your certificate on this page and send it to friends, and add your friends' certificate.</p> \
|
||||
<p>Another option is to search the internet for \"Retroshare chat servers\" (independently administrated). These servers allow you to exchange \
|
||||
certificates with a dedicated Retroshare node, through which\
|
||||
you will be able to anonymously meet other people.</p> ").arg(QString::number(2*S)).arg(width()*0.5);
|
||||
registerHelpButton(ui->helpButton,help_str,"HomePage") ;
|
||||
QString help_str = tr(
|
||||
" <h1><img width=\"%1\" src=\":/icons/help_64.png\"> Welcome to Retroshare!</h1>\
|
||||
<p>You need to <b>make friends</b>! After you create a network of friends or join an existing network,\
|
||||
you'll be able to exchange files, chat, talk in forums, etc. </p>\
|
||||
<div align=center>\
|
||||
<IMG align=\"center\" width=\"%2\" src=\":/images/network_map.png\"/> \
|
||||
</div>\
|
||||
<p>To do so, copy your certificate on this page and send it to friends, and add your friends' certificate.</p> \
|
||||
<p>Another option is to search the internet for \"Retroshare chat servers\" (independently administrated). These servers allow you to exchange \
|
||||
certificates with a dedicated Retroshare node, through which\
|
||||
you will be able to anonymously meet other people.</p> ").arg(QString::number(2*S)).arg(width()*0.5);
|
||||
registerHelpButton(ui->helpButton,help_str,"HomePage") ;
|
||||
|
||||
// register a event handler to catch IP updates
|
||||
|
||||
mEventHandlerId = 0;
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event) { handleEvent(event); }, mEventHandlerId, RsEventType::NETWORK );
|
||||
}
|
||||
|
||||
void HomePage::handleEvent(std::shared_ptr<const RsEvent> e)
|
||||
{
|
||||
if(e->mType != RsEventType::NETWORK)
|
||||
return;
|
||||
|
||||
const RsNetworkEvent *ne = dynamic_cast<const RsNetworkEvent*>(e.get());
|
||||
|
||||
if(ne)
|
||||
return;
|
||||
|
||||
// in any case we update the IPs
|
||||
|
||||
switch(ne->mNetworkEventCode)
|
||||
{
|
||||
case RsNetworkEventCode::LOCAL_IP_UPDATED: // [fallthrough]
|
||||
case RsNetworkEventCode::EXTERNAL_IP_UPDATED: // [fallthrough]
|
||||
RsQThreadUtils::postToObject( [=]()
|
||||
{
|
||||
updateCertificate();
|
||||
},this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
void HomePage::certContextMenu(QPoint point)
|
||||
{
|
||||
QMenu menu(this) ;
|
||||
|
@ -168,10 +195,7 @@ HomePage::~HomePage()
|
|||
|
||||
void HomePage::updateCertificate()
|
||||
{
|
||||
if(mUseBackwardCompatibleCert)
|
||||
updateOwnCert();
|
||||
else
|
||||
updateOwnId();
|
||||
updateOwnCert();
|
||||
}
|
||||
|
||||
void HomePage::updateOwnCert()
|
||||
|
@ -186,54 +210,43 @@ void HomePage::updateOwnCert()
|
|||
return ;
|
||||
}
|
||||
|
||||
std::string invite ;
|
||||
QString invite ;
|
||||
RetroshareInviteFlags invite_flags = RetroshareInviteFlags::CURRENT_IP;
|
||||
|
||||
if(mIncludeAllIPs)
|
||||
invite_flags |= RetroshareInviteFlags::FULL_IP_HISTORY;
|
||||
|
||||
if(mUseShortFormat)
|
||||
rsPeers->getShortInvite(invite,rsPeers->getOwnId(),true,!mIncludeAllIPs);
|
||||
else
|
||||
invite = rsPeers->GetRetroshareInvite(detail.id,false,include_extra_locators);
|
||||
{
|
||||
std::string short_invite;
|
||||
rsPeers->getShortInvite(short_invite,rsPeers->getOwnId(),invite_flags | RetroshareInviteFlags::RADIX_FORMAT);
|
||||
|
||||
ui->retroshareid->setText("\n"+QString::fromUtf8(invite.c_str())+"\n");
|
||||
QString S;
|
||||
QString txt;
|
||||
|
||||
for(uint32_t i=0;i<short_invite.size();)
|
||||
if(S.length() < 100)
|
||||
S += short_invite[i++];
|
||||
else
|
||||
{
|
||||
txt += S + "\n";
|
||||
S.clear();
|
||||
}
|
||||
|
||||
txt += S;
|
||||
|
||||
invite = txt; // the "\n" is here to make some space
|
||||
}
|
||||
else
|
||||
invite = QString::fromStdString(rsPeers->GetRetroshareInvite(detail.id,invite_flags));
|
||||
|
||||
ui->retroshareid->setText("\n"+invite+"\n");
|
||||
|
||||
QString description = ConfCertDialog::getCertificateDescription(detail,false,mUseShortFormat,include_extra_locators);
|
||||
|
||||
ui->retroshareid->setToolTip(description);
|
||||
}
|
||||
|
||||
void HomePage::updateOwnId()
|
||||
{
|
||||
RsPeerDetails detail;
|
||||
|
||||
if (!rsPeers->getPeerDetails(rsPeers->getOwnId(), detail))
|
||||
{
|
||||
std::cerr << "(EE) Cannot retrieve information about own certificate. That is a real problem!!" << std::endl;
|
||||
return ;
|
||||
}
|
||||
|
||||
bool include_extra_locators = mIncludeAllIPs || detail.isHiddenNode;
|
||||
std::string invite ;
|
||||
|
||||
rsPeers->getShortInvite(invite,rsPeers->getOwnId(),true,!include_extra_locators);
|
||||
|
||||
QString S;
|
||||
QString txt;
|
||||
int i=0;
|
||||
|
||||
for(uint32_t i=0;i<invite.size();)
|
||||
if(S.length() < 100)
|
||||
S += invite[i++];
|
||||
else
|
||||
{
|
||||
txt += S + "\n";
|
||||
S.clear();
|
||||
}
|
||||
|
||||
txt += S;
|
||||
|
||||
ui->retroshareid->setText("\n"+txt+"\n"); // the "\n" is here to make some space
|
||||
//#endif
|
||||
// ui->retroshareid->setText(QString::fromUtf8(invite.c_str()));
|
||||
}
|
||||
static void sendMail(QString sAddress, QString sSubject, QString sBody)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
|
@ -335,18 +348,6 @@ void HomePage::openWebHelp()
|
|||
|
||||
void HomePage::toggleUseOldFormat()
|
||||
{
|
||||
mUseBackwardCompatibleCert = !mUseBackwardCompatibleCert;
|
||||
mUseShortFormat = !mUseShortFormat;
|
||||
updateCertificate();
|
||||
|
||||
if (mUseBackwardCompatibleCert)
|
||||
{
|
||||
//ui->userCertEdit->show();
|
||||
//ui->expandButton->setToolTip(tr("Revert to normal Retroshare ID"));
|
||||
}
|
||||
else
|
||||
{
|
||||
//ui->userCertEdit->hide();
|
||||
//ui->expandButton->setToolTip(tr("Show full certificate (old format for backward compatibility)"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -50,7 +50,6 @@ private slots:
|
|||
void certContextMenu(QPoint);
|
||||
void updateOwnCert();
|
||||
void updateCertificate();
|
||||
void updateOwnId();
|
||||
void runEmailClient();
|
||||
void copyCert();
|
||||
void copyId();
|
||||
|
@ -69,8 +68,10 @@ private:
|
|||
|
||||
bool mIncludeAllIPs;
|
||||
bool mUseShortFormat;
|
||||
bool mUseBackwardCompatibleCert;
|
||||
|
||||
RsEventsHandlerId_t mEventHandlerId;
|
||||
|
||||
void handleEvent(std::shared_ptr<const RsEvent> event);
|
||||
};
|
||||
|
||||
#endif // HomePage_H
|
||||
|
|
|
@ -225,64 +225,7 @@ private and secure decentralized communication platform.
|
|||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="2" column="0" colspan="7">
|
||||
<widget class="QPlainTextEdit" name="userCertEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier New</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="lineWrapMode">
|
||||
<enum>QPlainTextEdit::NoWrap</enum>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="tabStopWidth">
|
||||
<number>80</number>
|
||||
</property>
|
||||
<property name="centerOnScroll">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="4">
|
||||
<widget class="QLabel" name="userCertLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>This is your Retroshare ID. Copy and share with your friends!</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="retroshareid">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
|
@ -312,24 +255,7 @@ private and secure decentralized communication platform.
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QToolButton" name="helpButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="shareButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
|
@ -361,6 +287,44 @@ private and secure decentralized communication platform.
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="userCertLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>This is your Retroshare ID. Copy and share with your friends!</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QToolButton" name="helpButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
@ -566,7 +566,7 @@ RetroShareLink RetroShareLink::createCertificate(const RsPeerId& ssl_id)
|
|||
} else {
|
||||
|
||||
link._type = TYPE_CERTIFICATE;
|
||||
link._radix = QString::fromUtf8(rsPeers->GetRetroshareInvite(ssl_id,false,false).c_str());
|
||||
link._radix = QString::fromUtf8(rsPeers->GetRetroshareInvite(ssl_id).c_str());
|
||||
link._name = QString::fromUtf8(detail.name.c_str());
|
||||
link._location = QString::fromUtf8(detail.location.c_str());
|
||||
link._radix.replace("\n","");
|
||||
|
|
|
@ -1255,7 +1255,8 @@ bool NewFriendList::exportFriendlist(QString &fileName)
|
|||
if (!rsPeers->getPeerDetails(*list_iter, detailSSL))
|
||||
continue;
|
||||
|
||||
std::string certificate = rsPeers->GetRetroshareInvite(detailSSL.id, true,true);
|
||||
std::string certificate = rsPeers->GetRetroshareInvite(detailSSL.id, RetroshareInviteFlags::CURRENT_IP | RetroshareInviteFlags::DNS | RetroshareInviteFlags::RADIX_FORMAT);
|
||||
|
||||
// remove \n from certificate
|
||||
certificate.erase(std::remove(certificate.begin(), certificate.end(), '\n'), certificate.end());
|
||||
|
||||
|
|
|
@ -275,15 +275,22 @@ void ConfCertDialog::loadInvitePage()
|
|||
// ui.userCertificateText_2->setText(QString::fromUtf8(pgp_key.c_str()));
|
||||
|
||||
std::string invite ;
|
||||
RetroshareInviteFlags flags = RetroshareInviteFlags::DNS | RetroshareInviteFlags::CURRENT_IP | RetroshareInviteFlags::RADIX_FORMAT;
|
||||
|
||||
if(!detail.isHiddenNode && ui._includeIPHistory_CB->isChecked())
|
||||
flags |= RetroshareInviteFlags::FULL_IP_HISTORY;
|
||||
|
||||
if(ui._shortFormat_CB->isChecked())
|
||||
{
|
||||
rsPeers->getShortInvite(invite,detail.id,true,!(ui._includeIPHistory_CB->isChecked()|| detail.isHiddenNode) );
|
||||
rsPeers->getShortInvite(invite,detail.id,flags);
|
||||
ui.stabWidget->setTabText(1, tr("Retroshare ID"));
|
||||
}
|
||||
else
|
||||
{
|
||||
invite = rsPeers->GetRetroshareInvite(detail.id, ui._shouldAddSignatures_CB->isChecked(), ui._includeIPHistory_CB->isChecked() ) ;
|
||||
if(ui._shouldAddSignatures_CB->isChecked())
|
||||
flags |= RetroshareInviteFlags::PGP_SIGNATURES;
|
||||
|
||||
invite = rsPeers->GetRetroshareInvite(detail.id, flags ) ;
|
||||
ui.stabWidget->setTabText(1, tr("Retroshare Certificate"));
|
||||
}
|
||||
|
||||
|
|
|
@ -104,11 +104,12 @@ void RsGxsChannelPostsModel::handleEvent_main_thread(std::shared_ptr<const RsEve
|
|||
case RsChannelEventCode::READ_STATUS_CHANGED:
|
||||
{
|
||||
// Normally we should just emit dataChanged() on the index of the data that has changed:
|
||||
//
|
||||
// We need to update the data!
|
||||
|
||||
// make a copy of e, so as to avoid destruction of the shared pointer during async thread execution, since [e] doesn't actually tell
|
||||
// the shared_ptr that it is copied! So no counter is updated.
|
||||
// the original shared_ptr that it is copied! So no counter is updated in event, which will be destroyed (as e will be) during or even before
|
||||
// the execution of the lambda.
|
||||
|
||||
RsGxsChannelEvent E(*e);
|
||||
|
||||
if(E.mChannelGroupId == mChannelGroup.mMeta.mGroupId)
|
||||
|
@ -120,8 +121,6 @@ void RsGxsChannelPostsModel::handleEvent_main_thread(std::shared_ptr<const RsEve
|
|||
std::vector<RsGxsComment> comments;
|
||||
std::vector<RsGxsVote> votes;
|
||||
|
||||
std::cerr << "display of e 1: " << E << std::endl;
|
||||
|
||||
if(!rsGxsChannels->getChannelContent(E.mChannelGroupId,std::set<RsGxsMessageId>{ E.mChannelMsgId }, posts,comments,votes))
|
||||
{
|
||||
std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve channel message data for channel/msg " << E.mChannelGroupId << "/" << E.mChannelMsgId << std::endl;
|
||||
|
@ -131,8 +130,6 @@ void RsGxsChannelPostsModel::handleEvent_main_thread(std::shared_ptr<const RsEve
|
|||
// Need to call this in order to get the actuall comment count. The previous call only retrieves the message, since we supplied the message ID.
|
||||
// another way to go would be to save the comment ids of the existing message and re-insert them before calling getChannelContent.
|
||||
|
||||
std::cerr << "display of e 2: " << E << std::endl;
|
||||
std::cerr << "Before call : IS_MSG_READ=" << IS_MSG_NEW(posts[0].mMeta.mMsgFlags) << " for message id " << E.mChannelMsgId << std::endl;
|
||||
if(!rsGxsChannels->getChannelComments(E.mChannelGroupId,std::set<RsGxsMessageId>{ E.mChannelMsgId },comments))
|
||||
{
|
||||
std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve message comment data for channel/msg " << E.mChannelGroupId << "/" << E.mChannelMsgId << std::endl;
|
||||
|
@ -141,7 +138,6 @@ void RsGxsChannelPostsModel::handleEvent_main_thread(std::shared_ptr<const RsEve
|
|||
|
||||
updateCommentCounts(posts,comments);
|
||||
|
||||
std::cerr << "After call : IS_MSG_READ=" << IS_MSG_NEW(posts[0].mMeta.mMsgFlags) << std::endl;
|
||||
// 2 - update the model in the UI thread.
|
||||
|
||||
RsQThreadUtils::postToObject( [posts,this]()
|
||||
|
|
|
@ -92,7 +92,8 @@ void ProfileWidget::statusmessagedlg()
|
|||
|
||||
void ProfileWidget::copyCert()
|
||||
{
|
||||
std::string cert = rsPeers->GetRetroshareInvite(RsPeerId(),false,false);
|
||||
std::string cert = rsPeers->GetRetroshareInvite(RsPeerId());
|
||||
|
||||
if (cert.empty()) {
|
||||
QMessageBox::information(this, tr("RetroShare"),
|
||||
tr("Sorry, create certificate failed"),
|
||||
|
|
|
@ -80,7 +80,7 @@ void CryptoPage::showEvent ( QShowEvent * /*event*/ )
|
|||
ui.pgpfingerprint->setText(misc::fingerPrintStyleSplit(QString::fromStdString(detail.fpr.toStdString())));
|
||||
|
||||
std::string invite ;
|
||||
rsPeers->getShortInvite(invite,rsPeers->getOwnId(),true,false);
|
||||
rsPeers->getShortInvite(invite,rsPeers->getOwnId(),RetroshareInviteFlags::RADIX_FORMAT | RetroshareInviteFlags::DNS | RetroshareInviteFlags::CURRENT_IP);
|
||||
ui.retroshareid->setText(QString::fromUtf8(invite.c_str()));
|
||||
|
||||
/* set retroshare version */
|
||||
|
@ -116,11 +116,22 @@ void
|
|||
CryptoPage::load()
|
||||
{
|
||||
std::string cert ;
|
||||
RetroshareInviteFlags flags = RetroshareInviteFlags::DNS | RetroshareInviteFlags::CURRENT_IP;
|
||||
|
||||
if(ui._shortFormat_CB->isChecked())
|
||||
rsPeers->getShortInvite(cert,rsPeers->getOwnId(), true, !ui._includeAllIPs_CB->isChecked());
|
||||
{
|
||||
if(ui._includeAllIPs_CB->isChecked())
|
||||
flags |= RetroshareInviteFlags::FULL_IP_HISTORY;
|
||||
|
||||
rsPeers->getShortInvite(cert,rsPeers->getOwnId(), RetroshareInviteFlags::RADIX_FORMAT | flags);
|
||||
}
|
||||
else
|
||||
cert = rsPeers->GetRetroshareInvite( rsPeers->getOwnId(), ui._includeSignatures_CB->isChecked(), ui._includeAllIPs_CB->isChecked() );
|
||||
{
|
||||
if(ui._includeSignatures_CB->isChecked())
|
||||
flags |= RetroshareInviteFlags::PGP_SIGNATURES;
|
||||
|
||||
cert = rsPeers->GetRetroshareInvite( rsPeers->getOwnId(), flags);
|
||||
}
|
||||
|
||||
ui.certplainTextEdit->setPlainText( QString::fromUtf8( cert.c_str() ) );
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue