added entry in rsgxsnetservice to change sync params

This commit is contained in:
csoler 2016-12-04 23:26:48 +01:00
parent 5612647672
commit d2ef2248c6
5 changed files with 33 additions and 9 deletions

View File

@ -4406,9 +4406,29 @@ void RsGxsNetService::pauseSynchronisation(bool /* enabled */)
} }
void RsGxsNetService::setSyncAge(uint32_t /* age */) void RsGxsNetService::setSyncAge(const RsGxsGroupId &grpId, uint32_t age_in_secs)
{ {
RS_STACK_MUTEX(mNxsMutex) ;
RsGxsGrpConfig& conf(mServerGrpConfigMap[grpId]) ;
if(conf.msg_req_delay != age_in_secs)
{
conf.msg_req_delay = age_in_secs;
IndicateConfigChanged();
}
}
void RsGxsNetService::setKeepAge(const RsGxsGroupId &grpId, uint32_t age_in_secs)
{
RS_STACK_MUTEX(mNxsMutex) ;
RsGxsGrpConfig& conf(mServerGrpConfigMap[grpId]) ;
if(conf.msg_keep_delay != age_in_secs)
{
conf.msg_keep_delay = age_in_secs;
IndicateConfigChanged();
}
} }
int RsGxsNetService::requestGrp(const std::list<RsGxsGroupId>& grpId, const RsPeerId& peerId) int RsGxsNetService::requestGrp(const std::list<RsGxsGroupId>& grpId, const RsPeerId& peerId)

View File

@ -103,11 +103,11 @@ public:
/*! /*!
* Use this to set how far back synchronisation of messages should take place * Use this to set how far back synchronisation and storage of messages should take place
* @param age the max age a sync item can to be allowed in a synchronisation * @param age the max age a sync/storage item can to be allowed in a synchronisation
*/ */
// NOT IMPLEMENTED virtual void setSyncAge(const RsGxsGroupId& grpId,uint32_t age_in_secs);
virtual void setSyncAge(uint32_t age); virtual void setKeepAge(const RsGxsGroupId& grpId,uint32_t age_in_secs);
/*! /*!
* pauses synchronisation of subscribed groups and request for group id * pauses synchronisation of subscribed groups and request for group id

View File

@ -65,9 +65,10 @@ public:
/*! /*!
* Use this to set how far back synchronisation of messages should take place * Use this to set how far back synchronisation of messages should take place
* @param age the max age a sync item can to be allowed in a synchronisation * @param age in seconds the max age a sync/store item can to be allowed in a synchronisation
*/ */
virtual void setSyncAge(uint32_t age) = 0; virtual void setSyncAge(const RsGxsGroupId& id,uint32_t age_in_secs) = 0;
virtual void setKeepAge(const RsGxsGroupId& id,uint32_t age_in_secs) = 0;
/*! /*!
* Initiates a search through the network * Initiates a search through the network

View File

@ -347,7 +347,6 @@ void GxsGroupDialog::setupVisibility()
ui.commentGroupBox->setVisible(mEnabledFlags & GXS_GROUP_FLAGS_COMMENTS); ui.commentGroupBox->setVisible(mEnabledFlags & GXS_GROUP_FLAGS_COMMENTS);
ui.commentsLabel->setVisible(mEnabledFlags & GXS_GROUP_FLAGS_COMMENTS); ui.commentsLabel->setVisible(mEnabledFlags & GXS_GROUP_FLAGS_COMMENTS);
ui.commentsValueLabel->setVisible(mEnabledFlags & GXS_GROUP_FLAGS_COMMENTS); ui.commentsValueLabel->setVisible(mEnabledFlags & GXS_GROUP_FLAGS_COMMENTS);
//ui.commentslabel->setVisible(mEnabledFlags & GXS_GROUP_FLAGS_COMMENTS);
ui.extraFrame->setVisible(mEnabledFlags & GXS_GROUP_FLAGS_EXTRA); ui.extraFrame->setVisible(mEnabledFlags & GXS_GROUP_FLAGS_EXTRA);
} }
@ -577,6 +576,9 @@ bool GxsGroupDialog::prepareGroupMetaData(RsGroupMetaData &meta)
meta.mGroupFlags = flags; meta.mGroupFlags = flags;
meta.mSignFlags = getGroupSignFlags(); meta.mSignFlags = getGroupSignFlags();
meta.mGrpDistribution_MaxStorageAge = ui.keepLimit_SB->value() * 86400 ;
meta.mGrpDistribution_MaxRequestAge = ui.syncLimit_SB->value() * 86400 ;
if (!setCircleParameters(meta)){ if (!setCircleParameters(meta)){
std::cerr << "GxsGroupDialog::prepareGroupMetaData()"; std::cerr << "GxsGroupDialog::prepareGroupMetaData()";
std::cerr << " Invalid Circles"; std::cerr << " Invalid Circles";

View File

@ -15,7 +15,8 @@ public:
RsDummyNetService(){ return;} RsDummyNetService(){ return;}
virtual ~RsDummyNetService() { } virtual ~RsDummyNetService() { }
void setSyncAge(uint32_t age){} void setSyncAge(const RsGxsGroupId& id,uint32_t age_in_secs){}
void setKeepAge(const RsGxsGroupId& id,uint32_t age_in_secs){}
void requestGroupsOfPeer(const std::string& peerId){} void requestGroupsOfPeer(const std::string& peerId){}