accept own locations

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2034 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2010-01-14 00:38:36 +00:00
parent 79ead807a2
commit a51df4ba6b
2 changed files with 25 additions and 6 deletions

View file

@ -1998,6 +1998,13 @@ void p3ConnectMgr::peerConnectRequest(std::string id, struct sockaddr_in radd
bool p3ConnectMgr::addFriend(std::string id, std::string gpg_id, uint32_t netMode, uint32_t visState, time_t lastContact)
{
if (id == AuthSSL::getAuthSSL()->OwnId()) {
#ifdef CONN_DEBUG
std::cerr << "p3ConnectMgr::addFriend() cannot add own id as a friend." << std::endl;
#endif
/* (1) already exists */
return false;
}
/* so four possibilities
* (1) already exists as friend -> do nothing.
* (2) is in others list -> move over.
@ -2028,7 +2035,7 @@ bool p3ConnectMgr::addFriend(std::string id, std::string gpg_id, uint32_t netMod
}
//Authentication is now tested at connection time, we don't store the ssl cert anymore
if (!AuthGPG::getAuthGPG()->isGPGAccepted(gpg_id))
if (!AuthGPG::getAuthGPG()->isGPGAccepted(gpg_id) && gpg_id != AuthGPG::getAuthGPG()->getGPGOwnId())
{
#ifdef CONN_DEBUG
std::cerr << "p3ConnectMgr::addFriend() gpg is not accepted" << std::endl;