mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-14 20:12:29 -04:00
* Refinement of new Cache Interface:
- Defined expected parameters for GxsGroups (see comments in rsidentity.h) - Added Various #defines for Groups / Msgs (again in rsidentity.h) - Converted new Group / new Msg into async "token" calls, returing MetaData. - Refined Grp/Msg Status Flags... similarly to how Forums used them... Expect UNREAD & UNPROCESSED flags to be set for a new msg, and UPDATED flag to be set for the corresponding group. There is flexibility for services to add their own flags too. - removed groupsChanged(). This can alternatively be implemented using. getGroupList(opts.Status == UPDATED)... - refined SubscribeFlags in a similar manner. - Added "ServiceString" to Group/Msg MetaData. This is freeform cache storage for service to use... currently p3Posted uses it to count Votes. - Added MsgStatus & SubscribeFlag filtering to Cache Requests. - Implemented these filters in GxsDataProxy (no efficient yet!) * Cleaned up all 6 new Cache Services to conform to new interface. * Removed old interface code that was #ifdef'd out. * Implemented Basic Ranking algorithms for p3posted: - Background process to process new votes/comments. - getRanking(token) interface call. - Intercept StatusRequests, etc to hide internal data requests. - While the basic code is complete, it needs much testing / tweaking. - Should shift work to a seperate thread. - Comment Ranking has still to be done. - Interfacing with GUI not yet attempted. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-new_cache_system@5276 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
081b59ee1a
commit
8387c538f1
20 changed files with 1793 additions and 514 deletions
|
@ -53,29 +53,52 @@ class RsPostedMsg
|
|||
uint32_t postedType;
|
||||
};
|
||||
|
||||
#define RSPOSTED_MSG_POST 1
|
||||
#define RSPOSTED_MSG_VOTE 1
|
||||
#define RSPOSTED_MSG_COMMENT 1
|
||||
#define RSPOSTED_MSGTYPE_POST 0x0001
|
||||
#define RSPOSTED_MSGTYPE_VOTE 0x0002
|
||||
#define RSPOSTED_MSGTYPE_COMMENT 0x0004
|
||||
|
||||
#define RSPOSTED_PERIOD_YEAR 1
|
||||
#define RSPOSTED_PERIOD_MONTH 2
|
||||
#define RSPOSTED_PERIOD_WEEK 3
|
||||
#define RSPOSTED_PERIOD_DAY 4
|
||||
#define RSPOSTED_PERIOD_HOUR 5
|
||||
|
||||
#define RSPOSTED_VIEWMODE_LATEST 1
|
||||
#define RSPOSTED_VIEWMODE_TOP 2
|
||||
#define RSPOSTED_VIEWMODE_HOT 3
|
||||
#define RSPOSTED_VIEWMODE_COMMENTS 4
|
||||
|
||||
|
||||
class RsPostedPost: public RsPostedMsg
|
||||
{
|
||||
public:
|
||||
RsPostedPost(): RsPostedMsg(RSPOSTED_MSG_POST) { return; }
|
||||
RsPostedPost(): RsPostedMsg(RSPOSTED_MSGTYPE_POST)
|
||||
{
|
||||
mMeta.mMsgFlags = RSPOSTED_MSGTYPE_POST;
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class RsPostedVote: public RsPostedMsg
|
||||
{
|
||||
public:
|
||||
RsPostedVote(): RsPostedMsg(RSPOSTED_MSG_VOTE) { return; }
|
||||
RsPostedVote(): RsPostedMsg(RSPOSTED_MSGTYPE_VOTE)
|
||||
{
|
||||
mMeta.mMsgFlags = RSPOSTED_MSGTYPE_VOTE;
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class RsPostedComment: public RsPostedMsg
|
||||
{
|
||||
public:
|
||||
RsPostedComment(): RsPostedMsg(RSPOSTED_MSG_COMMENT) { return; }
|
||||
RsPostedComment(): RsPostedMsg(RSPOSTED_MSGTYPE_COMMENT)
|
||||
{
|
||||
mMeta.mMsgFlags = RSPOSTED_MSGTYPE_COMMENT;
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -92,19 +115,15 @@ class RsPosted: public RsTokenService
|
|||
RsPosted() { return; }
|
||||
virtual ~RsPosted() { return; }
|
||||
|
||||
/* changed? */
|
||||
virtual bool updated() = 0;
|
||||
|
||||
/* Specific Service Data */
|
||||
virtual bool getGroup(const uint32_t &token, RsPostedGroup &group) = 0;
|
||||
virtual bool getPost(const uint32_t &token, RsPostedPost &post) = 0;
|
||||
virtual bool getComment(const uint32_t &token, RsPostedComment &comment) = 0;
|
||||
|
||||
/* details are updated in album - to choose Album ID, and storage path */
|
||||
virtual bool submitGroup(RsPostedGroup &group, bool isNew) = 0;
|
||||
virtual bool submitPost(RsPostedPost &post, bool isNew) = 0;
|
||||
virtual bool submitVote(RsPostedVote &vote, bool isNew) = 0;
|
||||
virtual bool submitComment(RsPostedComment &comment, bool isNew) = 0;
|
||||
virtual bool submitGroup(uint32_t &token, RsPostedGroup &group, bool isNew) = 0;
|
||||
virtual bool submitPost(uint32_t &token, RsPostedPost &post, bool isNew) = 0;
|
||||
virtual bool submitVote(uint32_t &token, RsPostedVote &vote, bool isNew) = 0;
|
||||
virtual bool submitComment(uint32_t &token, RsPostedComment &comment, bool isNew) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue