mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-15 17:37:12 -05:00
Changed the recommendation of friends from person link to certificate link.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4838 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ecf49d0e14
commit
cb9111ad88
@ -376,7 +376,7 @@ void FriendList::peerTreeWidgetCostumPopupMenu()
|
|||||||
// contextMnu.addAction(QIcon(IMAGE_PEERINFO), tr("Profile View"), this, SLOT(viewprofile()));
|
// contextMnu.addAction(QIcon(IMAGE_PEERINFO), tr("Profile View"), this, SLOT(viewprofile()));
|
||||||
// action = contextMnu.addAction(QIcon(IMAGE_EXPORTFRIEND), tr("Export Friend"), this, SLOT(exportfriend()));
|
// action = contextMnu.addAction(QIcon(IMAGE_EXPORTFRIEND), tr("Export Friend"), this, SLOT(exportfriend()));
|
||||||
|
|
||||||
if (type == TYPE_GPG) {
|
if (type == TYPE_GPG || type == TYPE_SSL) {
|
||||||
contextMnu.addAction(QIcon(IMAGE_EXPORTFRIEND), tr("Recommend this Friend to..."), this, SLOT(recommendfriend()));
|
contextMnu.addAction(QIcon(IMAGE_EXPORTFRIEND), tr("Recommend this Friend to..."), this, SLOT(recommendfriend()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1247,8 +1247,20 @@ void FriendList::recommendfriend()
|
|||||||
if (!peer)
|
if (!peer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
std::string peerId = getRsId(peer);
|
||||||
std::list<std::string> ids;
|
std::list<std::string> ids;
|
||||||
ids.push_back(getRsId(peer));
|
|
||||||
|
switch (peer->type()) {
|
||||||
|
case TYPE_SSL:
|
||||||
|
ids.push_back(peerId);
|
||||||
|
break;
|
||||||
|
case TYPE_GPG:
|
||||||
|
rsPeers->getAssociatedSSLIds(peerId, ids);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
MessageComposer::recommendFriend(ids);
|
MessageComposer::recommendFriend(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,15 +388,15 @@ void MessageComposer::processSettings(bool bLoad)
|
|||||||
/* window will destroy itself! */
|
/* window will destroy itself! */
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString BuildRecommendHtml(std::list<std::string> &peerids)
|
static QString buildRecommendHtml(std::list<std::string> &sslIds)
|
||||||
{
|
{
|
||||||
QString text;
|
QString text;
|
||||||
|
|
||||||
/* process peer ids */
|
/* process ssl ids */
|
||||||
std::list <std::string>::iterator peerid;
|
std::list <std::string>::iterator sslIt;
|
||||||
for (peerid = peerids.begin(); peerid != peerids.end(); peerid++) {
|
for (sslIt = sslIds.begin(); sslIt != sslIds.end(); sslIt++) {
|
||||||
RetroShareLink link;
|
RetroShareLink link;
|
||||||
if (link.createPerson(*peerid)) {
|
if (link.createCertificate(*sslIt)) {
|
||||||
text += link.toHtml() + "<br>";
|
text += link.toHtml() + "<br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -404,11 +404,11 @@ static QString BuildRecommendHtml(std::list<std::string> &peerids)
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageComposer::recommendFriend(std::list <std::string> &peerids)
|
void MessageComposer::recommendFriend(std::list <std::string> &sslIds)
|
||||||
{
|
{
|
||||||
// std::cerr << "MessageComposer::recommendFriend()" << std::endl;
|
// std::cerr << "MessageComposer::recommendFriend()" << std::endl;
|
||||||
|
|
||||||
if (peerids.size() == 0) {
|
if (sslIds.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -419,11 +419,11 @@ void MessageComposer::recommendFriend(std::list <std::string> &peerids)
|
|||||||
|
|
||||||
QString sMsgText = tr("I recommend a good friend of me, you can trust him too when you trust me. <br> Copy friend link and paste to Friends list");
|
QString sMsgText = tr("I recommend a good friend of me, you can trust him too when you trust me. <br> Copy friend link and paste to Friends list");
|
||||||
sMsgText += "<br><br>";
|
sMsgText += "<br><br>";
|
||||||
sMsgText += BuildRecommendHtml(peerids);
|
sMsgText += buildRecommendHtml(sslIds);
|
||||||
pMsgDialog->insertMsgText(sMsgText);
|
pMsgDialog->insertMsgText(sMsgText);
|
||||||
|
|
||||||
std::list <std::string>::iterator peerIt;
|
std::list <std::string>::iterator peerIt;
|
||||||
for (peerIt = peerids.begin(); peerIt != peerids.end(); peerIt++) {
|
for (peerIt = sslIds.begin(); peerIt != sslIds.end(); peerIt++) {
|
||||||
pMsgDialog->addRecipient(CC, *peerIt, false);
|
pMsgDialog->addRecipient(CC, *peerIt, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2355,7 +2355,7 @@ void MessageComposer::addBcc()
|
|||||||
|
|
||||||
void MessageComposer::addRecommend()
|
void MessageComposer::addRecommend()
|
||||||
{
|
{
|
||||||
std::list<std::string> gpgIds;
|
std::list<std::string> sslIds;
|
||||||
|
|
||||||
QTreeWidgetItemIterator itemIterator(ui.msgSendList);
|
QTreeWidgetItemIterator itemIterator(ui.msgSendList);
|
||||||
QTreeWidgetItem *item;
|
QTreeWidgetItem *item;
|
||||||
@ -2372,35 +2372,36 @@ void MessageComposer::addRecommend()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<std::string>::iterator it;
|
std::list<std::string>::iterator gpgIt;
|
||||||
for (it = groupInfo.peerIds.begin(); it != groupInfo.peerIds.end(); it++) {
|
for (gpgIt = groupInfo.peerIds.begin(); gpgIt != groupInfo.peerIds.end(); gpgIt++) {
|
||||||
if (std::find(gpgIds.begin(), gpgIds.end(), *it) == gpgIds.end()) {
|
std::list<std::string> groupSslIds;
|
||||||
gpgIds.push_back(*it);
|
rsPeers->getAssociatedSSLIds(*gpgIt, groupSslIds);
|
||||||
|
|
||||||
|
std::list<std::string>::iterator sslIt;
|
||||||
|
for (sslIt = groupSslIds.begin(); sslIt != groupSslIds.end(); sslIt++) {
|
||||||
|
if (std::find(sslIds.begin(), sslIds.end(), *sslIt) == sslIds.end()) {
|
||||||
|
sslIds.push_back(*sslIt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
RsPeerDetails detail;
|
if (std::find(sslIds.begin(), sslIds.end(), id) == sslIds.end()) {
|
||||||
if (rsPeers->getPeerDetails(id, detail) == false) {
|
sslIds.push_back(id);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (std::find(gpgIds.begin(), gpgIds.end(), detail.gpg_id) == gpgIds.end()) {
|
|
||||||
gpgIds.push_back(detail.gpg_id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gpgIds.empty()) {
|
if (sslIds.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list <std::string>::iterator it;
|
std::list <std::string>::iterator it;
|
||||||
for (it = gpgIds.begin(); it != gpgIds.end(); it++) {
|
for (it = sslIds.begin(); it != sslIds.end(); it++) {
|
||||||
addRecipient(CC, *it, false);
|
addRecipient(CC, *it, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString text = BuildRecommendHtml(gpgIds);
|
QString text = buildRecommendHtml(sslIds);
|
||||||
ui.msgText->textCursor().insertHtml(text);
|
ui.msgText->textCursor().insertHtml(text);
|
||||||
ui.msgText->setFocus(Qt::OtherFocusReason);
|
ui.msgText->setFocus(Qt::OtherFocusReason);
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ public:
|
|||||||
~MessageComposer();
|
~MessageComposer();
|
||||||
|
|
||||||
static void msgFriend(std::string id, bool group);
|
static void msgFriend(std::string id, bool group);
|
||||||
static void recommendFriend(std::list <std::string> &peerids);
|
static void recommendFriend(std::list <std::string> &sslIds);
|
||||||
|
|
||||||
static MessageComposer *newMsg(const std::string &msgId = "");
|
static MessageComposer *newMsg(const std::string &msgId = "");
|
||||||
static MessageComposer *replyMsg(const std::string &msgId, bool all);
|
static MessageComposer *replyMsg(const std::string &msgId, bool all);
|
||||||
|
Loading…
Reference in New Issue
Block a user