mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 08:59:37 -05:00
fixed auto-positive opinions for contacts
This commit is contained in:
parent
c7576309a7
commit
3993fbf5cc
@ -266,7 +266,7 @@ static const uint32_t RS_NXS_ITEM_ENCRYPTION_STATUS_GXS_KEY_MISSING = 0x05 ;
|
|||||||
|| defined(NXS_NET_DEBUG_4) || defined(NXS_NET_DEBUG_5) || defined(NXS_NET_DEBUG_6) || defined(NXS_NET_DEBUG_7)
|
|| defined(NXS_NET_DEBUG_4) || defined(NXS_NET_DEBUG_5) || defined(NXS_NET_DEBUG_6) || defined(NXS_NET_DEBUG_7)
|
||||||
|
|
||||||
static const RsPeerId peer_to_print = RsPeerId(std::string("")) ;
|
static const RsPeerId peer_to_print = RsPeerId(std::string("")) ;
|
||||||
static const RsGxsGroupId group_id_to_print = RsGxsGroupId(std::string("30501fac090b65f5b9def169598b53ed" )) ; // use this to allow to this group id only, or "" for all IDs
|
static const RsGxsGroupId group_id_to_print = RsGxsGroupId(std::string("")) ; // use this to allow to this group id only, or "" for all IDs
|
||||||
static const uint32_t service_to_print = 0x211 ; // use this to allow to this service id only, or 0 for all services
|
static const uint32_t service_to_print = 0x211 ; // use this to allow to this service id only, or 0 for all services
|
||||||
// warning. Numbers should be SERVICE IDS (see serialiser/rsserviceids.h. E.g. 0x0215 for forums)
|
// warning. Numbers should be SERVICE IDS (see serialiser/rsserviceids.h. E.g. 0x0215 for forums)
|
||||||
|
|
||||||
|
@ -449,11 +449,11 @@ void p3IdService::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||||||
/* iterate through and grab any new messages */
|
/* iterate through and grab any new messages */
|
||||||
std::list<RsGxsGroupId> unprocessedGroups;
|
std::list<RsGxsGroupId> unprocessedGroups;
|
||||||
|
|
||||||
std::vector<RsGxsNotify *>::iterator it;
|
for(uint32_t i = 0;i<changes.size();++i)
|
||||||
for(it = changes.begin(); it != changes.end(); ++it)
|
|
||||||
{
|
{
|
||||||
RsGxsGroupChange *groupChange = dynamic_cast<RsGxsGroupChange *>(*it);
|
RsGxsGroupChange *groupChange = dynamic_cast<RsGxsGroupChange *>(changes[i]);
|
||||||
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(*it);
|
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(changes[i]);
|
||||||
|
|
||||||
if (msgChange && !msgChange->metaChange())
|
if (msgChange && !msgChange->metaChange())
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_IDS
|
#ifdef DEBUG_IDS
|
||||||
@ -479,10 +479,10 @@ void p3IdService::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||||||
std::cerr << "p3IdService::notifyChanges() Found Group Change Notification";
|
std::cerr << "p3IdService::notifyChanges() Found Group Change Notification";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::list<RsGxsGroupId> &groupList = groupChange->mGrpIdList;
|
std::list<RsGxsGroupId> &groupList = groupChange->mGrpIdList;
|
||||||
std::list<RsGxsGroupId>::iterator git;
|
std::list<RsGxsGroupId>::iterator git;
|
||||||
for(git = groupList.begin(); git != groupList.end(); ++git)
|
|
||||||
|
for(git = groupList.begin(); git != groupList.end();)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_IDS
|
#ifdef DEBUG_IDS
|
||||||
std::cerr << "p3IdService::notifyChanges() Auto Subscribe to Incoming Groups: " << *git;
|
std::cerr << "p3IdService::notifyChanges() Auto Subscribe to Incoming Groups: " << *git;
|
||||||
@ -496,15 +496,17 @@ void p3IdService::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||||||
// also time_stamp the key that this group represents
|
// also time_stamp the key that this group represents
|
||||||
|
|
||||||
timeStampKey(RsGxsId(*git)) ;
|
timeStampKey(RsGxsId(*git)) ;
|
||||||
|
|
||||||
|
++git;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
git = groupList.erase(git) ;
|
||||||
std::cerr << "(EE) Received banned identity " << *git << ": this should not happen. Deleting it!" << std::endl;
|
}
|
||||||
uint32_t token ;
|
|
||||||
RsGxsIdGroup group;
|
if(groupList.empty())
|
||||||
group.mMeta.mGroupId=RsGxsGroupId(*git);
|
{
|
||||||
deleteIdentity(token, group);
|
delete changes[i] ;
|
||||||
}
|
changes[i] = NULL ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -543,6 +545,12 @@ bool p3IdService::getIdDetails(const RsGxsId &id, RsIdentityDetails &details)
|
|||||||
|
|
||||||
if (mKeyCache.fetch(id, data))
|
if (mKeyCache.fetch(id, data))
|
||||||
{
|
{
|
||||||
|
// This step is needed, because p3GxsReputation does not know all identities, and might not have any data for
|
||||||
|
// the ones in the contact list. So we change them on demand.
|
||||||
|
|
||||||
|
if((details.mFlags & RS_IDENTITY_FLAGS_IS_A_CONTACT) && rsReputations->nodeAutoPositiveOpinionForContacts())
|
||||||
|
rsReputations->setOwnOpinion(id,RsReputations::OPINION_POSITIVE) ;
|
||||||
|
|
||||||
details = data.details;
|
details = data.details;
|
||||||
details.mLastUsageTS = locked_getLastUsageTS(id) ;
|
details.mLastUsageTS = locked_getLastUsageTS(id) ;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user