fixed a few gui issues with acceptance of unknown peer

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-GenericTunneling@6345 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-04-29 22:32:58 +00:00
parent ca279ec0c2
commit 34e6fb6fa2
4 changed files with 75 additions and 10 deletions

View file

@ -352,6 +352,22 @@ void MessageComposer::processSettings(bool bLoad)
Settings->endGroup();
}
/*static*/ void MessageComposer::msgDistantPeer(const std::string& hash,const std::string& pgp_id)
{
// std::cerr << "MessageComposer::msgfriend()" << std::endl;
/* create a message */
MessageComposer *pMsgDialog = MessageComposer::newMsg();
if (pMsgDialog == NULL)
return;
pMsgDialog->addRecipient(TO, hash,pgp_id) ;
pMsgDialog->show();
/* window will destroy itself! */
}
/*static*/ void MessageComposer::msgFriend(const std::string &id, bool group)
{
@ -1402,7 +1418,13 @@ void MessageComposer::setRecipientToRow(int row, enumType type, std::string id,
}
} else {
RsPeerDetails details;
if (rsPeers->getPeerDetails(id, details)) {
if(_distant_peers.find(id) != _distant_peers.end())
{
name = tr("Distant peer (PGP key: %1)").arg(QString::fromStdString(_distant_peers[id])) ;
icon = QIcon(StatusDefs::imageUser(RS_STATUS_ONLINE));
}
else if (rsPeers->getPeerDetails(id, details))
{
name = PeerDefs::nameWithLocation(details);
StatusInfo peerStatusInfo;
@ -1546,6 +1568,32 @@ void MessageComposer::editingRecipientFinished()
lineEdit->setText(text);
}
void MessageComposer::addRecipient(enumType type, const std::string& hash,const std::string& pgp_id)
{
_distant_peers[hash] = pgp_id ;
int rowCount = ui.recipientWidget->rowCount();
int row;
for (row = 0; row < rowCount; row++)
{
enumType rowType;
std::string rowId;
bool rowGroup;
if (getRecipientFromRow(row, rowType, rowId, rowGroup) == true)
{
if (rowId.empty()) // use row
break;
if (rowId == hash && rowType == type) // existing row
break;
}
else // use row
break;
}
setRecipientToRow(row, type, hash, false);
}
void MessageComposer::addRecipient(enumType type, const std::string &id, bool group)
{
std::list<std::string> sslIds;