Merge pull request #1067 from PhenomRetroShare/Fix_SecurityIpItemIsSame

Fix SecurityIpItem isSame
This commit is contained in:
csoler 2017-10-22 15:55:48 +02:00 committed by GitHub
commit 9cc09d6d2b
3 changed files with 4 additions and 4 deletions

View File

@ -1116,7 +1116,7 @@ static bool addFeedItemIfUniqueCallback(FeedItem *feedItem, void *data)
if (findData->mSecurityIpItem) { if (findData->mSecurityIpItem) {
SecurityIpItem *securityIpItem = dynamic_cast<SecurityIpItem*>(feedItem); SecurityIpItem *securityIpItem = dynamic_cast<SecurityIpItem*>(feedItem);
if (securityIpItem && securityIpItem->isSame(findData->mId1, findData->mId2, findData->mType)) { if (securityIpItem && securityIpItem->isSame(RsPeerId(findData->mId1), findData->mId2, findData->mId3, findData->mType)) {
return true; return true;
} }
return false; return false;

View File

@ -79,9 +79,9 @@ void SecurityIpItem::setup()
updateItem(); updateItem();
} }
bool SecurityIpItem::isSame(const std::string& ipAddr, const std::string& ipAddrReported, uint32_t type) bool SecurityIpItem::isSame(const RsPeerId &sslId, const std::string& ipAddr, const std::string& ipAddrReported, uint32_t type)
{ {
if (mType == type && mIpAddr == ipAddr && mIpAddrReported == ipAddrReported) { if (mType == type && mSslId==sslId && mIpAddr == ipAddr && mIpAddrReported == ipAddrReported) {
return true; return true;
} }

View File

@ -44,7 +44,7 @@ public:
void updateItemStatic(); void updateItemStatic();
bool isSame(const std::string& ipAddr, const std::string& ipAddrReported, uint32_t type); bool isSame(const RsPeerId &sslId, const std::string& ipAddr, const std::string& ipAddrReported, uint32_t type);
protected: protected:
/* FeedItem */ /* FeedItem */