2012-02-14 10:33:58 -05:00
|
|
|
|
|
|
|
/* Generalised Service Base Class.
|
|
|
|
* The base class interfaces with gixp, disk, net services.
|
|
|
|
*/
|
|
|
|
|
2012-02-24 16:15:08 -05:00
|
|
|
class RsGxpLink
|
2012-02-14 10:33:58 -05:00
|
|
|
{
|
|
|
|
uint32_t type;
|
|
|
|
std::string msgId;
|
2012-02-24 16:15:08 -05:00
|
|
|
}
|
2012-02-14 10:33:58 -05:00
|
|
|
|
2012-02-24 16:15:08 -05:00
|
|
|
class RsGxpItem
|
2012-02-14 10:33:58 -05:00
|
|
|
{
|
2012-02-24 16:15:08 -05:00
|
|
|
std::string msgId;
|
|
|
|
std::string origMsgId;
|
|
|
|
std::string groupId;
|
|
|
|
gxpTime time;
|
2012-02-14 10:33:58 -05:00
|
|
|
std::list<std::string> hashtags;
|
2012-02-24 16:15:08 -05:00
|
|
|
std::list<RsGxpLink> linked;
|
2012-02-14 10:33:58 -05:00
|
|
|
|
2012-02-24 16:15:08 -05:00
|
|
|
RsGxpSignature mSignature;
|
2012-02-14 10:33:58 -05:00
|
|
|
};
|
|
|
|
|
2012-02-24 16:15:08 -05:00
|
|
|
class RsGxpGroup
|
2012-02-14 10:33:58 -05:00
|
|
|
{
|
|
|
|
|
2012-02-16 17:15:21 -05:00
|
|
|
|
|
|
|
|
2012-02-24 16:15:08 -05:00
|
|
|
};
|
2012-02-14 10:33:58 -05:00
|
|
|
|
2012-02-24 16:15:08 -05:00
|
|
|
class gxp_service
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
requestItem(msgId);
|
|
|
|
|
|
|
|
recv(RsGxpItem *item);
|
|
|
|
send(RsGxpItem *item);
|
|
|
|
|
|
|
|
/****************************************************************************************************/
|
|
|
|
// Event Callback for the service.
|
|
|
|
/****************************************************************************************************/
|
|
|
|
|
|
|
|
notify_groupChanged(); // Mainly for GUI display.
|
|
|
|
notify_newMessage(); // used for newsFeeds.
|
|
|
|
notify_duplicateMessage(); // Channels needs this for Downloading stuff, can probably be moved above.
|
|
|
|
locked_checkDistribMsg(); // required overload?
|
|
|
|
/****************************************************************************************************/
|
|
|
|
// Must worry about sharing keys.
|
|
|
|
// Can gixp handle it?
|
|
|
|
// What interfaces do we need here?
|
|
|
|
/****************************************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************************************/
|
|
|
|
// Interface for Message Read Status
|
|
|
|
// At the moment this is overloaded to handle autodownload flags too.
|
|
|
|
// This is a configuration thing.
|
|
|
|
/****************************************************************************************************/
|
|
|
|
|
|
|
|
int flagItemRead(std::string id);
|
|
|
|
int flagItemUnread(std::string id);
|
|
|
|
int flagGroupRead(std::string id);
|
|
|
|
int flagGroupUnread(std::string id);
|
|
|
|
|
|
|
|
/****************************************************************************************************/
|
|
|
|
// External Interface for Data.
|
|
|
|
/****************************************************************************************************/
|
|
|
|
|
|
|
|
// Mesage Creation.
|
|
|
|
int createGroup(RsGxpGroup *grp);
|
|
|
|
int createItem(RsGxpItem *item);
|
|
|
|
|
|
|
|
// Group Lists & Message Lists.
|
|
|
|
int getGroupsChanged(std::list<std::string> &groupIds);
|
|
|
|
int getGroups(std::list<std::string> &groupIds);
|
|
|
|
int getGroupList(std::string grpId, std::list<std::string> &groupIds);
|
|
|
|
int getTimeRange(GxpTime from, GxpTime to, std::list<std::string> &msgIds);
|
|
|
|
int getGroupTimeRange(std::string grpId, GxpTime from, GxpTime to, std::list<std::string> &msgIds);
|
|
|
|
int getReplacementMsgs(std::string origId, std::list<std::string> replaceIds);
|
|
|
|
|
|
|
|
// Getting the Actual Data.
|
|
|
|
int haveItem(std::string msgId);
|
|
|
|
int requestItem(std::string msgId);
|
|
|
|
RsGxpItem *getMsg_locked(std::string msgId);
|
|
|
|
RsGxpGroup *getGroup_locked(std::string msgId);
|
|
|
|
|
|
|
|
// Interface with GIXP Stuff... everything else should be behind the scenes.
|
|
|
|
RsGixpProfile *getProfile_locked(std::string id);
|
|
|
|
|
|
|
|
// Immediate Search...
|
|
|
|
int searchReferringLinks(RsGxpLink link, std::list<std::string> &msgIds);
|
|
|
|
int searchHashTags(std::list<std::string>, std::list<std::string> &msgIds);
|
|
|
|
|
|
|
|
// Remote Search...
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
// Reversed Index: for hash searching.
|
|
|
|
std::map<std::string, std::list<ids> > mSearchMap;
|
2012-02-14 10:33:58 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|