mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #642 from G10h4ck/ccleanup
Documentation and code cleanup
This commit is contained in:
commit
e4960e07c8
@ -238,11 +238,12 @@ void RsGenExchange::tick()
|
||||
|
||||
bool RsGenExchange::messagePublicationTest(const RsGxsMsgMetaData& meta)
|
||||
{
|
||||
time_t now = time(NULL) ;
|
||||
time_t st = MESSAGE_STORE_PERIOD;
|
||||
if(mNetService) st = mNetService->getKeepAge(meta.mGroupId, st);
|
||||
time_t storageTimeLimit = meta.mPublishTs + st;
|
||||
|
||||
uint32_t store_limit = (mNetService == NULL)?MESSAGE_STORE_PERIOD:mNetService->getKeepAge(meta.mGroupId,MESSAGE_STORE_PERIOD) ;
|
||||
|
||||
return meta.mMsgStatus & GXS_SERV::GXS_MSG_STATUS_KEEP || store_limit == 0 || meta.mPublishTs + store_limit >= now ;
|
||||
return meta.mMsgStatus & GXS_SERV::GXS_MSG_STATUS_KEEP ||
|
||||
storageTimeLimit == 0 || storageTimeLimit >= time(NULL);
|
||||
}
|
||||
|
||||
bool RsGenExchange::acknowledgeTokenMsg(const uint32_t& token,
|
||||
|
@ -428,11 +428,10 @@ protected:
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Assigns a token value to passed integer
|
||||
* The status of the token can still be queried from request status feature
|
||||
* @warning the token space is shared with RsGenExchange backend, so do not
|
||||
* modify tokens except does you have created by calling generatePublicToken()
|
||||
* @return token
|
||||
* Generate a new token, the status of the token can be queried from request
|
||||
* status feature.
|
||||
* @attention the token space is shared with RsGenExchange backend.
|
||||
* @return Generated token
|
||||
*/
|
||||
uint32_t generatePublicToken();
|
||||
|
||||
@ -486,7 +485,7 @@ public:
|
||||
* This allows the client service to acknowledge that their grps has \n
|
||||
* been created/modified and retrieve the create/modified grp ids
|
||||
* @param token the token related to modification/create request
|
||||
* @param msgIds vector of ids of groups created/modified
|
||||
* @param grpId ids of created/modified group
|
||||
* @return true if token exists false otherwise
|
||||
*/
|
||||
bool acknowledgeTokenGrp(const uint32_t& token, RsGxsGroupId& grpId);
|
||||
|
@ -34,26 +34,11 @@ class RsGxsGrpMetaData;
|
||||
class RsGxsMsgMetaData;
|
||||
|
||||
|
||||
class RsGroupMetaData
|
||||
struct RsGroupMetaData
|
||||
{
|
||||
public:
|
||||
|
||||
RsGroupMetaData()
|
||||
{
|
||||
mGroupFlags = 0;
|
||||
mSignFlags = 0;
|
||||
mSubscribeFlags = 0;
|
||||
|
||||
mPop = 0;
|
||||
mVisibleMsgCount = 0;
|
||||
mLastPost = 0;
|
||||
|
||||
mGroupStatus = 0;
|
||||
mCircleType = 0;
|
||||
mAuthenFlags = 0;
|
||||
|
||||
mPublishTs = 0;
|
||||
}
|
||||
RsGroupMetaData() : mGroupFlags(0), mSignFlags(0), mPublishTs(0),
|
||||
mCircleType(0), mAuthenFlags(0), mSubscribeFlags(0), mPop(0),
|
||||
mVisibleMsgCount(0), mLastPost(0), mGroupStatus(0) {}
|
||||
|
||||
void operator =(const RsGxsGrpMetaData& rGxsMeta);
|
||||
|
||||
@ -90,19 +75,9 @@ public:
|
||||
|
||||
|
||||
|
||||
class RsMsgMetaData
|
||||
struct RsMsgMetaData
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
RsMsgMetaData()
|
||||
{
|
||||
mPublishTs = 0;
|
||||
mMsgFlags = 0;
|
||||
|
||||
mMsgStatus = 0;
|
||||
mChildTs = 0;
|
||||
}
|
||||
RsMsgMetaData() : mPublishTs(0), mMsgFlags(0), mMsgStatus(0), mChildTs(0) {}
|
||||
|
||||
void operator =(const RsGxsMsgMetaData& rGxsMeta);
|
||||
|
||||
|
@ -11,22 +11,17 @@ typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > GxsMsgMetaMap;
|
||||
typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsMsgMetaData> > GxsMsgRelatedMetaMap;
|
||||
|
||||
/*!
|
||||
* The aim of this class is to abstract
|
||||
* how changes are represented so
|
||||
* they can be determined outside the
|
||||
* client API without explcitly
|
||||
* enumerating all possible changes
|
||||
* at the interface
|
||||
* The aim of this class is to abstract how changes are represented so they can
|
||||
* be determined outside the client API without explcitly enumerating all
|
||||
* possible changes at the interface
|
||||
*/
|
||||
class RsGxsNotify
|
||||
struct RsGxsNotify
|
||||
{
|
||||
public:
|
||||
|
||||
enum NotifyType { TYPE_PUBLISH, TYPE_RECEIVE, TYPE_PROCESSED, TYPE_PUBLISHKEY };
|
||||
|
||||
virtual ~RsGxsNotify() {return; }
|
||||
virtual NotifyType getType() = 0;
|
||||
enum NotifyType
|
||||
{ TYPE_PUBLISH, TYPE_RECEIVE, TYPE_PROCESSED, TYPE_PUBLISHKEY };
|
||||
|
||||
virtual ~RsGxsNotify() {}
|
||||
virtual NotifyType getType() = 0;
|
||||
};
|
||||
|
||||
/*!
|
||||
|
@ -53,17 +53,15 @@ const uint32_t GXSFORUMS_MSG_STORE_PERIOD = 60*60*24*31*12; // 12 months / 1 yea
|
||||
/******************* Startup / Tick ******************************************/
|
||||
/********************************************************************************/
|
||||
|
||||
p3GxsForums::p3GxsForums(RsGeneralDataService *gds, RsNetworkExchangeService *nes, RsGixs* gixs)
|
||||
: RsGenExchange(gds, nes, new RsGxsForumSerialiser(), RS_SERVICE_GXS_TYPE_FORUMS, gixs, forumsAuthenPolicy(), GXSFORUMS_MSG_STORE_PERIOD), RsGxsForums(this)
|
||||
p3GxsForums::p3GxsForums( RsGeneralDataService *gds,
|
||||
RsNetworkExchangeService *nes, RsGixs* gixs ) :
|
||||
RsGenExchange( gds, nes, new RsGxsForumSerialiser(),
|
||||
RS_SERVICE_GXS_TYPE_FORUMS, gixs, forumsAuthenPolicy(),
|
||||
GXSFORUMS_MSG_STORE_PERIOD),
|
||||
RsGxsForums(this), mGenToken(0), mGenActive(false), mGenCount(0)
|
||||
{
|
||||
// For Dummy Msgs.
|
||||
mGenActive = false;
|
||||
mGenCount = 0;
|
||||
mGenToken = 0;
|
||||
|
||||
// Test Data disabled in Repo.
|
||||
//RsTickEvent::schedule_in(FORUM_TESTEVENT_DUMMYDATA, DUMMYDATA_PERIOD);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user