mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-07 05:42:19 -04:00
re-disabled the code to update the server TS to last post as it can severely perturbate the distribution of posts. Added a call to update msgServerUpdateMap when new messages received
This commit is contained in:
parent
d6be4404d2
commit
3cd90ae11c
2 changed files with 22 additions and 7 deletions
|
@ -2096,14 +2096,16 @@ void RsGxsNetService::updateServerSyncTS()
|
||||||
else
|
else
|
||||||
msui = mapIT->second;
|
msui = mapIT->second;
|
||||||
|
|
||||||
if(grpMeta->mLastPost > msui->msgUpdateTS )
|
// (cyril) I'm removing this, becuse mLastPost is *never* updated. So this code it not useful at all.
|
||||||
{
|
//
|
||||||
change = true;
|
// if(grpMeta->mLastPost > msui->msgUpdateTS )
|
||||||
msui->msgUpdateTS = grpMeta->mLastPost;
|
// {
|
||||||
|
// change = true;
|
||||||
|
// msui->msgUpdateTS = grpMeta->mLastPost;
|
||||||
#ifdef NXS_NET_DEBUG_0
|
#ifdef NXS_NET_DEBUG_0
|
||||||
GXSNETDEBUG__G(grpId) << " updated msgUpdateTS to last post = " << time(NULL) - grpMeta->mLastPost << " secs ago for group "<< grpId << std::endl;
|
// GXSNETDEBUG__G(grpId) << " updated msgUpdateTS to last post = " << time(NULL) - grpMeta->mLastPost << " secs ago for group "<< grpId << std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
// }
|
||||||
|
|
||||||
// This is needed for group metadata updates to actually propagate: only a new grpUpdateTS will trigger the exchange of groups mPublishTs which
|
// This is needed for group metadata updates to actually propagate: only a new grpUpdateTS will trigger the exchange of groups mPublishTs which
|
||||||
// will then be compared and pssibly trigger a MetaData transmission. mRecvTS is upated when creating, receiving for the first time, or receiving
|
// will then be compared and pssibly trigger a MetaData transmission. mRecvTS is upated when creating, receiving for the first time, or receiving
|
||||||
|
@ -2596,6 +2598,8 @@ void RsGxsNetService::locked_processCompletedIncomingTrans(NxsTransaction* tr)
|
||||||
// for the grp id
|
// for the grp id
|
||||||
locked_doMsgUpdateWork(tr->mTransaction, grpId);
|
locked_doMsgUpdateWork(tr->mTransaction, grpId);
|
||||||
|
|
||||||
|
// also update server sync TS, since we need to send the new message list to friends for comparison
|
||||||
|
locked_stampMsgServerUpdateTS(grpId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(tr->mFlag == NxsTransaction::FLAG_STATE_FAILED)
|
else if(tr->mFlag == NxsTransaction::FLAG_STATE_FAILED)
|
||||||
|
@ -4897,6 +4901,11 @@ bool RsGxsNetService::stampMsgServerUpdateTS(const RsGxsGroupId& gid)
|
||||||
{
|
{
|
||||||
RS_STACK_MUTEX(mNxsMutex) ;
|
RS_STACK_MUTEX(mNxsMutex) ;
|
||||||
|
|
||||||
|
locked_stampMsgServerUpdateTS(gid) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RsGxsNetService::locked_stampMsgServerUpdateTS(const RsGxsGroupId& gid)
|
||||||
|
{
|
||||||
std::map<RsGxsGroupId,RsGxsServerMsgUpdateItem*>::iterator it = mServerMsgUpdateMap.find(gid) ;
|
std::map<RsGxsGroupId,RsGxsServerMsgUpdateItem*>::iterator it = mServerMsgUpdateMap.find(gid) ;
|
||||||
|
|
||||||
if(mServerMsgUpdateMap.end() == it)
|
if(mServerMsgUpdateMap.end() == it)
|
||||||
|
@ -4910,4 +4919,3 @@ bool RsGxsNetService::stampMsgServerUpdateTS(const RsGxsGroupId& gid)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -229,6 +229,13 @@ private:
|
||||||
*/
|
*/
|
||||||
void locked_completeTransaction(NxsTransaction* trans);
|
void locked_completeTransaction(NxsTransaction* trans);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief locked_stampMsgServerUpdateTS
|
||||||
|
* updates the server msg time stamp. This function is the locked method for the one above with similar name
|
||||||
|
* \param gid group id to stamp.
|
||||||
|
* \return
|
||||||
|
*/
|
||||||
|
bool locked_stampMsgServerUpdateTS(const RsGxsGroupId& gid);
|
||||||
/*!
|
/*!
|
||||||
* This retrieves a unique transaction id that
|
* This retrieves a unique transaction id that
|
||||||
* can be used in an outgoing transaction
|
* can be used in an outgoing transaction
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue