mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-03 02:50:07 -05:00
Use sslid to add a location when accepting a friend request from the security item with a known pgp key.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6668 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8239c69963
commit
4559b48a9d
@ -139,7 +139,7 @@ void ConnectFriendWizard::setCertificate(const QString &certificate, bool friend
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectFriendWizard::setGpgId(const std::string &gpgId, bool friendRequest)
|
||||
void ConnectFriendWizard::setGpgId(const std::string &gpgId, const std::string &sslId, bool friendRequest)
|
||||
{
|
||||
if (!rsPeers->getPeerDetails(gpgId, peerDetails)) {
|
||||
setField("errorMessage", tr("Cannot get peer details of PGP key %1").arg(QString::fromStdString(gpgId)));
|
||||
@ -147,6 +147,9 @@ void ConnectFriendWizard::setGpgId(const std::string &gpgId, bool friendRequest)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set ssl id when available */
|
||||
peerDetails.id = sslId;
|
||||
|
||||
setStartId(friendRequest ? Page_FriendRequest : Page_Conclusion);
|
||||
}
|
||||
|
||||
@ -371,7 +374,23 @@ void ConnectFriendWizard::initializePage(int id)
|
||||
|
||||
ui->fr_nameEdit->setText(QString::fromUtf8(peerDetails.name.c_str()));
|
||||
ui->fr_emailEdit->setText(QString::fromUtf8(peerDetails.email.c_str()));
|
||||
ui->fr_locationEdit->setText(QString::fromUtf8(peerDetails.location.c_str()));
|
||||
|
||||
QString loc = QString::fromUtf8(peerDetails.location.c_str());
|
||||
if (!loc.isEmpty())
|
||||
{
|
||||
loc += " (";
|
||||
loc += QString::fromStdString(peerDetails.id);
|
||||
loc += ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!peerDetails.id.empty())
|
||||
{
|
||||
loc += QString::fromStdString(peerDetails.id);
|
||||
}
|
||||
}
|
||||
|
||||
ui->fr_locationEdit->setText(loc);
|
||||
|
||||
ui->fr_label->setText(tr("You have a friend request from") + " " + QString::fromUtf8(peerDetails.name.c_str()));
|
||||
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
~ConnectFriendWizard();
|
||||
|
||||
void setCertificate(const QString &certificate, bool friendRequest);
|
||||
void setGpgId(const std::string &gpgId, bool friendRequest);
|
||||
void setGpgId(const std::string &gpgId, const std::string &sslId, bool friendRequest);
|
||||
|
||||
virtual bool validateCurrentPage();
|
||||
virtual int nextId() const;
|
||||
|
@ -327,7 +327,7 @@ void SecurityItem::friendRequest()
|
||||
|
||||
ConnectFriendWizard *connectFriendWizard = new ConnectFriendWizard;
|
||||
connectFriendWizard->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
connectFriendWizard->setGpgId(mGpgId, true);
|
||||
connectFriendWizard->setGpgId(mGpgId, mSslId, true);
|
||||
connectFriendWizard->show();
|
||||
}
|
||||
|
||||
|
@ -23,8 +23,8 @@
|
||||
|
||||
#include <retroshare/rspeers.h>
|
||||
|
||||
FriendRequestToaster::FriendRequestToaster(const std::string &gpgId, const QString &sslName, const std::string &/*peerId*/)
|
||||
: QWidget(NULL), mGpgId(gpgId)
|
||||
FriendRequestToaster::FriendRequestToaster(const std::string &gpgId, const QString &sslName, const std::string &peerId)
|
||||
: QWidget(NULL), mGpgId(gpgId), mSslId(peerId), mSslName(sslName)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
@ -59,7 +59,7 @@ void FriendRequestToaster::friendrequestButtonSlot()
|
||||
{
|
||||
ConnectFriendWizard *connectFriendWizard = new ConnectFriendWizard;
|
||||
connectFriendWizard->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
connectFriendWizard->setGpgId(mGpgId, true);
|
||||
connectFriendWizard->setGpgId(mGpgId, mSslId, true);
|
||||
connectFriendWizard->show();
|
||||
|
||||
hide();
|
||||
|
@ -39,6 +39,8 @@ private slots:
|
||||
|
||||
private:
|
||||
std::string mGpgId;
|
||||
std::string mSslId;
|
||||
QString mSslName;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::FriendRequestToaster ui;
|
||||
|
Loading…
x
Reference in New Issue
Block a user