mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-02 19:26:31 -04:00
fixed subscribe policy to GxsTrans groups as a function of last available post and group usage
This commit is contained in:
parent
dc605c02f1
commit
37edcc1e37
2 changed files with 7 additions and 6 deletions
|
@ -20,7 +20,7 @@
|
|||
#include "gxstrans/p3gxstrans.h"
|
||||
#include "util/stacktrace.h"
|
||||
|
||||
#define DEBUG_GXSTRANS 1
|
||||
//#define DEBUG_GXSTRANS 1
|
||||
|
||||
typedef unsigned int uint;
|
||||
|
||||
|
@ -183,14 +183,15 @@ void p3GxsTrans::handleResponse(uint32_t token, uint32_t req_type)
|
|||
|
||||
const RsGroupMetaData& meta = grp->meta;
|
||||
bool subscribed = IS_GROUP_SUBSCRIBED(meta.mSubscribeFlags);
|
||||
bool old = olderThen( meta.mLastPost, UNUSED_GROUP_UNSUBSCRIBE_INTERVAL );
|
||||
bool old = meta.mLastPost > 0 && olderThen( meta.mLastPost, UNUSED_GROUP_UNSUBSCRIBE_INTERVAL );
|
||||
uint32_t token;
|
||||
|
||||
bool shouldSubscribe = false ;
|
||||
bool shouldUnSubscribe = false ;
|
||||
{
|
||||
RS_STACK_MUTEX(mDataMutex);
|
||||
bool shouldSubscribe = !subscribed && ( !old || meta.mGroupId == mPreferredGroupId );
|
||||
|
||||
bool shouldSubscribe = !subscribed && ((!old)|| meta.mGroupId == mPreferredGroupId );
|
||||
bool shouldUnSubscribe = subscribed && old && meta.mGroupId != mPreferredGroupId;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue