mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-12 15:25:34 -05:00
Merge pull request #1845 from csoler/v0.6-FT4
Removed TokenQueue from GxsTransportStatistics
This commit is contained in:
commit
e0462b8411
23 changed files with 275 additions and 209 deletions
|
|
@ -409,6 +409,14 @@ public:
|
|||
virtual bool subscribeToChannel( const RsGxsGroupId& channelId,
|
||||
bool subscribe ) = 0;
|
||||
|
||||
/**
|
||||
* \brief Retrieve statistics about the channel service
|
||||
* @jsonapi{development}
|
||||
* \param[out] stat Statistics structure
|
||||
* \return
|
||||
*/
|
||||
virtual bool getChannelServiceStatistics(GxsServiceStatistic& stat) =0;
|
||||
|
||||
/**
|
||||
* \brief Retrieve statistics about the given channel
|
||||
* @jsonapi{development}
|
||||
|
|
@ -418,6 +426,7 @@ public:
|
|||
*/
|
||||
virtual bool getChannelStatistics(const RsGxsGroupId& channelId,GxsGroupStatistic& stat) =0;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Request remote channels search
|
||||
* @jsonapi{development}
|
||||
|
|
|
|||
|
|
@ -219,6 +219,14 @@ public:
|
|||
*/
|
||||
virtual bool getForumsSummaries(std::list<RsGroupMetaData>& forums) = 0;
|
||||
|
||||
/**
|
||||
* @brief returns statistics for the forum service
|
||||
* @jsonapi{development}
|
||||
* @param[out] stat statistics struct
|
||||
* @return false if the call fails
|
||||
*/
|
||||
virtual bool getForumServiceStatistics(GxsServiceStatistic& stat) =0;
|
||||
|
||||
/**
|
||||
* @brief returns statistics about a particular forum
|
||||
* @jsonapi{development}
|
||||
|
|
@ -228,6 +236,7 @@ public:
|
|||
*/
|
||||
virtual bool getForumStatistics(const RsGxsGroupId& forumId,GxsGroupStatistic& stat)=0;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get forums information (description, thumbnail...).
|
||||
* Blocking API.
|
||||
|
|
|
|||
|
|
@ -85,8 +85,7 @@ public:
|
|||
* @param groupIds the ids return for given request token
|
||||
* @return false if request token is invalid, check token status for error report
|
||||
*/
|
||||
bool getGroupList(const uint32_t &token,
|
||||
std::list<RsGxsGroupId> &groupIds)
|
||||
bool getGroupList(const uint32_t &token, std::list<RsGxsGroupId> &groupIds)
|
||||
{
|
||||
return mGxs.getGroupList(token, groupIds);
|
||||
}
|
||||
|
|
@ -119,8 +118,7 @@ public:
|
|||
* @param groupInfo the ids returned for given request token
|
||||
* @return false if request token is invalid, check token status for error report
|
||||
*/
|
||||
bool getGroupSummary(const uint32_t &token,
|
||||
std::list<RsGroupMetaData> &groupInfo)
|
||||
bool getGroupSummary(const uint32_t &token, std::list<RsGroupMetaData> &groupInfo)
|
||||
{
|
||||
return mGxs.getGroupMeta(token, groupInfo);
|
||||
}
|
||||
|
|
@ -130,8 +128,7 @@ public:
|
|||
* @param msgInfo the message metadata returned for given request token
|
||||
* @return false if request token is invalid, check token status for error report
|
||||
*/
|
||||
bool getMsgSummary(const uint32_t &token,
|
||||
GxsMsgMetaMap &msgInfo)
|
||||
bool getMsgSummary(const uint32_t &token, GxsMsgMetaMap &msgInfo)
|
||||
{
|
||||
return mGxs.getMsgMeta(token, msgInfo);
|
||||
}
|
||||
|
|
@ -358,7 +355,7 @@ public:
|
|||
{ return mTokenService.requestStatus(token); }
|
||||
|
||||
/// @see RsTokenService::requestServiceStatistic
|
||||
void requestServiceStatistic(uint32_t& token)
|
||||
bool requestServiceStatistic(uint32_t& token)
|
||||
{
|
||||
mTokenService.requestServiceStatistic(token);
|
||||
|
||||
|
|
@ -366,6 +363,7 @@ public:
|
|||
mActiveTokens[token]=TokenRequestType::SERVICE_STATISTICS;
|
||||
|
||||
locked_dumpTokens();
|
||||
return true;
|
||||
}
|
||||
|
||||
/// @see RsTokenService::requestGroupStatistic
|
||||
|
|
|
|||
|
|
@ -70,10 +70,8 @@ enum class GxsTransSendStatus : uint8_t
|
|||
|
||||
typedef uint64_t RsGxsTransId;
|
||||
|
||||
class RsGxsTransGroup
|
||||
class RsGxsTransGroup: public RsGxsGenericGroupData
|
||||
{
|
||||
public:
|
||||
RsGroupMetaData mMeta;
|
||||
};
|
||||
|
||||
class RsGxsTransMsg
|
||||
|
|
@ -103,7 +101,34 @@ struct RsGxsTransOutgoingRecord
|
|||
RsGxsGroupId group_id ;
|
||||
};
|
||||
|
||||
class RsGxsTransGroupStatistics: public GxsGroupStatistic
|
||||
{
|
||||
public:
|
||||
RsGxsTransGroupStatistics()
|
||||
{
|
||||
last_publish_TS = 0;
|
||||
popularity = 0;
|
||||
subscribed = false;
|
||||
}
|
||||
|
||||
void addMessageMeta(const RsGxsGroupId& grp,const RsMsgMetaData& meta)
|
||||
{
|
||||
messages_metas[meta.mMsgId] = meta ;
|
||||
last_publish_TS = std::max(last_publish_TS,meta.mPublishTs) ;
|
||||
mGrpId = grp ;
|
||||
}
|
||||
|
||||
bool subscribed ;
|
||||
int popularity ;
|
||||
|
||||
rstime_t last_publish_TS;
|
||||
|
||||
std::map<RsGxsMessageId,RsMsgMetaData> messages_metas ;
|
||||
};
|
||||
|
||||
|
||||
/// RetroShare GxsTrans asyncronous redundant small mail trasport on top of GXS
|
||||
///
|
||||
class RsGxsTrans: public RsGxsIfaceHelper
|
||||
{
|
||||
public:
|
||||
|
|
@ -120,10 +145,8 @@ public:
|
|||
|
||||
virtual ~RsGxsTrans() {}
|
||||
|
||||
virtual bool getStatistics(GxsTransStatistics& stats)=0;
|
||||
|
||||
// virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsTransGroup> &groups) = 0;
|
||||
// virtual bool getPostData(const uint32_t &token, std::vector<RsGxsTransMsg> &posts) = 0;
|
||||
virtual bool getDataStatistics(GxsTransStatistics& stats)=0;
|
||||
virtual bool getGroupStatistics(std::map<RsGxsGroupId,RsGxsTransGroupStatistics>& stats) =0;
|
||||
};
|
||||
|
||||
extern RsGxsTrans *rsGxsTrans ;
|
||||
|
|
|
|||
|
|
@ -167,6 +167,8 @@ public:
|
|||
|
||||
virtual bool getBoardStatistics(const RsGxsGroupId& boardId,GxsGroupStatistic& stat) =0;
|
||||
|
||||
virtual bool getBoardsServiceStatistics(GxsServiceStatistic& stat) =0;
|
||||
|
||||
enum RS_DEPRECATED RankType {TopRankType, HotRankType, NewRankType };
|
||||
|
||||
RS_DEPRECATED_FOR(getBoardsInfo)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue