mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fixed recommend friend.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4197 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e42c7b6323
commit
4d4c4c0a47
@ -234,12 +234,18 @@ bool RetroShareLink::createFile(const QString& name, uint64_t size, const QStrin
|
|||||||
return valid();
|
return valid();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RetroShareLink::createPerson(const QString& name, const QString& hash)
|
bool RetroShareLink::createPerson(const std::string& id)
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
_name = name;
|
RsPeerDetails detail;
|
||||||
_hash = hash;
|
if (rsPeers->getPeerDetails(id, detail) == false) {
|
||||||
|
std::cerr << "RetroShareLink::createPerson() Couldn't find peer id " << id << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
_hash = QString::fromStdString(id);
|
||||||
|
_name = QString::fromUtf8(detail.name.c_str());
|
||||||
|
|
||||||
_type = TYPE_PERSON;
|
_type = TYPE_PERSON;
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ class RetroShareLink
|
|||||||
RetroShareLink(const QString& url);
|
RetroShareLink(const QString& url);
|
||||||
|
|
||||||
bool createFile(const QString& name, uint64_t size, const QString& hash);
|
bool createFile(const QString& name, uint64_t size, const QString& hash);
|
||||||
bool createPerson(const QString& name, const QString& hash);
|
bool createPerson(const std::string& id);
|
||||||
bool createForum(const std::string& id, const std::string& msgId);
|
bool createForum(const std::string& id, const std::string& msgId);
|
||||||
bool createChannel(const std::string& id, const std::string& msgId);
|
bool createChannel(const std::string& id, const std::string& msgId);
|
||||||
bool createSearch(const QString& keywords);
|
bool createSearch(const QString& keywords);
|
||||||
|
@ -377,17 +377,10 @@ static QString BuildRecommendHtml(std::list<std::string> &peerids)
|
|||||||
/* process peer ids */
|
/* process peer ids */
|
||||||
std::list <std::string>::iterator peerid;
|
std::list <std::string>::iterator peerid;
|
||||||
for (peerid = peerids.begin(); peerid != peerids.end(); peerid++) {
|
for (peerid = peerids.begin(); peerid != peerids.end(); peerid++) {
|
||||||
RsPeerDetails detail;
|
|
||||||
if (rsPeers->getPeerDetails(*peerid, detail) == false) {
|
|
||||||
std::cerr << "MessageComposer::recommendFriend() Couldn't find peer id " << *peerid << std::endl;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
RetroShareLink link;
|
RetroShareLink link;
|
||||||
if (link.createPerson(QString::fromUtf8(detail.name.c_str()), QString::fromStdString(detail.id))) {
|
if (link.createPerson(*peerid)) {
|
||||||
continue;
|
text += link.toHtml() + "<br>";
|
||||||
}
|
}
|
||||||
text += link.toHtmlFull() + "<br>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
|
Loading…
Reference in New Issue
Block a user