mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 00:49:28 -05:00
simple hack to have non active groups gradually loose popularity and number of posts.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8225 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
21d62edca2
commit
4624d53dd7
@ -854,12 +854,20 @@ bool RsGxsNetService::loadList(std::list<RsItem *> &load)
|
||||
|
||||
for(ClientMsgMap::iterator it = mClientMsgUpdateMap.begin();it!=mClientMsgUpdateMap.end();++it)
|
||||
for(std::map<RsGxsGroupId,RsGxsMsgUpdateItem::MsgUpdateInfo>::const_iterator it2(it->second->msgUpdateInfos.begin());it2!=it->second->msgUpdateInfos.end();++it2)
|
||||
{
|
||||
RsGroupNetworkStatsRecord& gnsr = mGroupNetworkStats[it2->first] ;
|
||||
{
|
||||
RsGroupNetworkStatsRecord& gnsr = mGroupNetworkStats[it2->first] ;
|
||||
|
||||
gnsr.suppliers.insert(it->first) ;
|
||||
gnsr.max_visible_count = std::max(it2->second.message_count,gnsr.max_visible_count) ;
|
||||
}
|
||||
// At each reload, divide the last count by 2. This gradually flushes old information away.
|
||||
|
||||
gnsr.max_visible_count = std::max(it2->second.message_count,gnsr.max_visible_count/2) ;
|
||||
|
||||
// Similarly, we remove some of the suppliers randomly. If they are
|
||||
// actual suppliers, they will come back automatically. If they are
|
||||
// not, they will be forgotten.
|
||||
|
||||
if(RSRandom::random_f32() > 0.2)
|
||||
gnsr.suppliers.insert(it->first) ;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user