mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed a few bugs in the People tab
This commit is contained in:
parent
218977170c
commit
f5e55e849b
@ -151,6 +151,7 @@ p3GxsReputation::p3GxsReputation(p3LinkMgr *lm)
|
||||
mStoreTime = 0;
|
||||
mReputationsUpdated = false;
|
||||
mLastActiveFriendsUpdate = time(NULL) - 0.5*ACTIVE_FRIENDS_UPDATE_PERIOD; // avoids doing it too soon since the TS from rsIdentity needs to be loaded already
|
||||
mLastIdentityFlagsUpdate = time(NULL) - 3;
|
||||
mAverageActiveFriends = 0 ;
|
||||
mLastBannedNodesUpdate = 0 ;
|
||||
|
||||
@ -189,22 +190,18 @@ int p3GxsReputation::tick()
|
||||
mLastActiveFriendsUpdate = now ;
|
||||
}
|
||||
|
||||
static time_t last_identity_flags_update = 0 ;
|
||||
|
||||
// no more than once per 5 second chunk.
|
||||
|
||||
if(now > IDENTITY_FLAGS_UPDATE_DELAY+last_identity_flags_update)
|
||||
if(now > IDENTITY_FLAGS_UPDATE_DELAY+mLastIdentityFlagsUpdate)
|
||||
{
|
||||
last_identity_flags_update = now ;
|
||||
|
||||
updateIdentityFlags() ;
|
||||
mLastIdentityFlagsUpdate = now ;
|
||||
}
|
||||
if(now > BANNED_NODES_UPDATE_DELAY+mLastBannedNodesUpdate) // 613 is not a multiple of 100, to avoid piling up work
|
||||
{
|
||||
mLastBannedNodesUpdate = now ;
|
||||
|
||||
updateIdentityFlags() ; // needed before updateBannedNodesList!
|
||||
updateBannedNodesList();
|
||||
mLastBannedNodesUpdate = now ;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_REPUTATION
|
||||
@ -241,7 +238,7 @@ void p3GxsReputation::setNodeAutoPositiveOpinionForContacts(bool b)
|
||||
|
||||
if(b != mAutoSetPositiveOptionToContacts)
|
||||
{
|
||||
mLastBannedNodesUpdate = 0 ;
|
||||
mLastIdentityFlagsUpdate = 0 ;
|
||||
mAutoSetPositiveOptionToContacts = b ;
|
||||
IndicateConfigChanged() ;
|
||||
}
|
||||
@ -953,7 +950,7 @@ bool p3GxsReputation::saveList(bool& cleanup, std::list<RsItem*> &savelist)
|
||||
vitem->tlvkvs.pairs.push_back(kv) ;
|
||||
|
||||
kv.key = "AUTO_BAN_IDENTITIES_THRESHOLD" ;
|
||||
rs_sprintf(kv.value, "%d", mAutoBanIdentitiesLimit);
|
||||
rs_sprintf(kv.value, "%f", mAutoBanIdentitiesLimit);
|
||||
vitem->tlvkvs.pairs.push_back(kv) ;
|
||||
|
||||
kv.key = "AUTO_POSITIVE_CONTACTS" ;
|
||||
@ -1017,6 +1014,7 @@ bool p3GxsReputation::loadList(std::list<RsItem *>& loadList)
|
||||
if(kit->key == "AUTO_BAN_IDENTITIES_THRESHOLD")
|
||||
{
|
||||
float val ;
|
||||
|
||||
if (sscanf(kit->value.c_str(), "%f", &val) == 1)
|
||||
{
|
||||
mAutoBanIdentitiesLimit = val ;
|
||||
|
@ -149,6 +149,7 @@ private:
|
||||
time_t mRequestTime;
|
||||
time_t mStoreTime;
|
||||
time_t mLastBannedNodesUpdate ;
|
||||
time_t mLastIdentityFlagsUpdate ;
|
||||
bool mReputationsUpdated;
|
||||
uint32_t mAverageActiveFriends ;
|
||||
|
||||
|
@ -42,7 +42,7 @@ bool PeoplePage::save(QString &/*errmsg*/)
|
||||
else
|
||||
rsReputations->setNodeAutoBanThreshold(ui.identityBanThreshold_SB->value()) ;
|
||||
|
||||
if(!ui.autoPositiveOpinion_CB->isChecked())
|
||||
if(ui.autoPositiveOpinion_CB->isChecked())
|
||||
rsReputations->setNodeAutoPositiveOpinionForContacts(true) ;
|
||||
else
|
||||
rsReputations->setNodeAutoPositiveOpinionForContacts(false) ;
|
||||
|
@ -64,10 +64,10 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="autoPositiveOpinion_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Anyone in your contact list will automatically have a positive opinion. This allows to automatically raise reputations of used nodes. </p></body></html></string>
|
||||
<string><html><head/><body><p>Anyone in your contact list will automatically have a positive opinion if not set. This allows to automatically raise reputations of used nodes. </p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>automatically give "Positive" option to my contacts</string>
|
||||
<string>automatically give "Positive" opinion to my contacts</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
|
Loading…
Reference in New Issue
Block a user