mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-12 07:16:19 -05:00
fixed up display of GroupStatisticsReq and moved priorities to RsTokReqOptions
This commit is contained in:
parent
7c77e82b1e
commit
ebee69df96
9 changed files with 119 additions and 78 deletions
|
|
@ -360,7 +360,10 @@ public:
|
|||
/// @see RsTokenService::requestServiceStatistic
|
||||
void requestServiceStatistic(uint32_t& token)
|
||||
{
|
||||
mTokenService.requestServiceStatistic(token);
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_SERVICE_STATS;
|
||||
|
||||
mTokenService.requestServiceStatistic(token,opts);
|
||||
|
||||
RS_STACK_MUTEX(mMtx);
|
||||
mActiveTokens[token]=TokenRequestType::SERVICE_STATISTICS;
|
||||
|
|
@ -371,7 +374,10 @@ public:
|
|||
/// @see RsTokenService::requestGroupStatistic
|
||||
bool requestGroupStatistic(uint32_t& token, const RsGxsGroupId& grpId)
|
||||
{
|
||||
mTokenService.requestGroupStatistic(token, grpId);
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_STATS;
|
||||
|
||||
mTokenService.requestGroupStatistic(token, grpId,opts);
|
||||
|
||||
RS_STACK_MUTEX(mMtx);
|
||||
mActiveTokens[token]=TokenRequestType::GROUP_STATISTICS;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,13 @@ struct RsMsgMetaData;
|
|||
|
||||
typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > MsgMetaResult;
|
||||
|
||||
enum class GxsRequestPriority {
|
||||
VERY_HIGH = 0x00,
|
||||
HIGH = 0x01,
|
||||
NORMAL = 0x02,
|
||||
LOW = 0x03,
|
||||
VERY_LOW = 0x04,
|
||||
};
|
||||
|
||||
class RsGxsGrpMetaData;
|
||||
class RsGxsMsgMetaData;
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ struct RsTokReqOptions
|
|||
{
|
||||
RsTokReqOptions() : mOptions(0), mStatusFilter(0), mStatusMask(0),
|
||||
mMsgFlagMask(0), mMsgFlagFilter(0), mReqType(0), mSubscribeFilter(0),
|
||||
mSubscribeMask(0), mBefore(0), mAfter(0) {}
|
||||
mSubscribeMask(0), mBefore(0), mAfter(0),mPriority(GxsRequestPriority::NORMAL) {}
|
||||
|
||||
/**
|
||||
* Can be one or multiple RS_TOKREQOPT_*
|
||||
|
|
@ -107,6 +107,8 @@ struct RsTokReqOptions
|
|||
// Time range... again applied after Options.
|
||||
rstime_t mBefore;
|
||||
rstime_t mAfter;
|
||||
|
||||
GxsRequestPriority mPriority;
|
||||
};
|
||||
|
||||
/*!
|
||||
|
|
@ -181,6 +183,25 @@ public:
|
|||
*/
|
||||
virtual bool requestMsgRelatedInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::vector<RsGxsGrpMsgIdPair>& msgIds) = 0;
|
||||
|
||||
/*!
|
||||
* This request statistics on amount of data held
|
||||
* number of groups
|
||||
* number of groups subscribed
|
||||
* number of messages
|
||||
* size of db store
|
||||
* total size of messages
|
||||
* total size of groups
|
||||
* @param token
|
||||
*/
|
||||
virtual void requestServiceStatistic(uint32_t& token, const RsTokReqOptions &opts) = 0;
|
||||
|
||||
/*!
|
||||
* To request statistic on a group
|
||||
* @param token set to value to be redeemed to get statistic
|
||||
* @param grpId the id of the group
|
||||
*/
|
||||
virtual void requestGroupStatistic(uint32_t& token, const RsGxsGroupId& grpId, const RsTokReqOptions &opts) = 0;
|
||||
|
||||
|
||||
/* Poll */
|
||||
|
||||
|
|
@ -194,25 +215,6 @@ public:
|
|||
*/
|
||||
virtual GxsRequestStatus requestStatus(const uint32_t token) = 0;
|
||||
|
||||
/*!
|
||||
* This request statistics on amount of data held
|
||||
* number of groups
|
||||
* number of groups subscribed
|
||||
* number of messages
|
||||
* size of db store
|
||||
* total size of messages
|
||||
* total size of groups
|
||||
* @param token
|
||||
*/
|
||||
virtual void requestServiceStatistic(uint32_t& token) = 0;
|
||||
|
||||
/*!
|
||||
* To request statistic on a group
|
||||
* @param token set to value to be redeemed to get statistic
|
||||
* @param grpId the id of the group
|
||||
*/
|
||||
virtual void requestGroupStatistic(uint32_t& token, const RsGxsGroupId& grpId) = 0;
|
||||
|
||||
/*!
|
||||
* @brief Cancel Request
|
||||
* If this function returns false, it may be that the request has completed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue