mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-27 07:47:03 -05:00
Added functions to modify the Sorting Algorithm for PostedLinks.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5359 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2ba3f73a74
commit
363374947f
@ -131,6 +131,12 @@ virtual bool getRankedPost(const uint32_t &token, RsPostedPost &post) = 0;
|
|||||||
|
|
||||||
virtual bool extractPostedCache(const std::string &str, uint32_t &votes, uint32_t &comments) = 0;
|
virtual bool extractPostedCache(const std::string &str, uint32_t &votes, uint32_t &comments) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Control Ranking Calculations.
|
||||||
|
virtual bool setViewMode(uint32_t mode) = 0;
|
||||||
|
virtual bool setViewPeriod(uint32_t period) = 0;
|
||||||
|
virtual bool setViewRange(uint32_t first, uint32_t count) = 0;
|
||||||
|
|
||||||
// exposed for testing...
|
// exposed for testing...
|
||||||
virtual float calcPostScore(const RsMsgMetaData &meta) = 0;
|
virtual float calcPostScore(const RsMsgMetaData &meta) = 0;
|
||||||
|
|
||||||
|
@ -73,8 +73,8 @@ p3PostedService::p3PostedService(uint16_t type)
|
|||||||
|
|
||||||
int p3PostedService::tick()
|
int p3PostedService::tick()
|
||||||
{
|
{
|
||||||
//std::cerr << "p3PostedService::tick()";
|
std::cerr << "p3PostedService::tick()";
|
||||||
//std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
fakeprocessrequests();
|
fakeprocessrequests();
|
||||||
|
|
||||||
@ -1267,8 +1267,12 @@ bool p3PostedService::addExtraDummyData()
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool p3PostedService::setViewMode(uint32_t mode)
|
bool p3PostedService::setViewMode(uint32_t mode)
|
||||||
{
|
{
|
||||||
|
std::cerr << "p3PostedService::setViewMode() : " << mode;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
RsStackMutex stack(mPostedMtx); /********** STACK LOCKED MTX ******/
|
RsStackMutex stack(mPostedMtx); /********** STACK LOCKED MTX ******/
|
||||||
|
|
||||||
mViewMode = mode;
|
mViewMode = mode;
|
||||||
@ -1278,6 +1282,9 @@ bool p3PostedService::setViewMode(uint32_t mode)
|
|||||||
|
|
||||||
bool p3PostedService::setViewPeriod(uint32_t period)
|
bool p3PostedService::setViewPeriod(uint32_t period)
|
||||||
{
|
{
|
||||||
|
std::cerr << "p3PostedService::setViewPeriod() : " << period;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
RsStackMutex stack(mPostedMtx); /********** STACK LOCKED MTX ******/
|
RsStackMutex stack(mPostedMtx); /********** STACK LOCKED MTX ******/
|
||||||
|
|
||||||
mViewPeriod = period;
|
mViewPeriod = period;
|
||||||
@ -1287,6 +1294,9 @@ bool p3PostedService::setViewPeriod(uint32_t period)
|
|||||||
|
|
||||||
bool p3PostedService::setViewRange(uint32_t first, uint32_t count)
|
bool p3PostedService::setViewRange(uint32_t first, uint32_t count)
|
||||||
{
|
{
|
||||||
|
std::cerr << "p3PostedService::setViewRange() : " << first << " +" << count;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
RsStackMutex stack(mPostedMtx); /********** STACK LOCKED MTX ******/
|
RsStackMutex stack(mPostedMtx); /********** STACK LOCKED MTX ******/
|
||||||
|
|
||||||
mViewStart = first;
|
mViewStart = first;
|
||||||
@ -1563,6 +1573,7 @@ bool p3PostedService::processPosts()
|
|||||||
{
|
{
|
||||||
std::cerr << "p3PostedService::processPosts() ERROR getting postList";
|
std::cerr << "p3PostedService::processPosts() ERROR getting postList";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
background_cleanup();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user