mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
moved my(chris's) version of GXservice to rsgxs.h and reverted db_gxp_service.h back to original
slight modification of rsgdp to not handle encryption requests at its level git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-new_cache_system@4985 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e1d060f3b1
commit
ccda22fe5e
@ -3,252 +3,100 @@
|
|||||||
* The base class interfaces with gixp, disk, net services.
|
* The base class interfaces with gixp, disk, net services.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <inttypes.h>
|
class RsGxpLink
|
||||||
#include <string>
|
|
||||||
#include <list>
|
|
||||||
#include <set>
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
typedef time_t RsGxsTime;
|
|
||||||
|
|
||||||
class RsGxsLink
|
|
||||||
{
|
{
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
std::string msgId;
|
std::string msgId;
|
||||||
};
|
}
|
||||||
|
|
||||||
class RsGxsGroupItem {
|
class RsGxpItem
|
||||||
|
|
||||||
RsGxsId Id;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class RsGxsId {
|
|
||||||
|
|
||||||
std::string msgId;
|
|
||||||
std::string grpId;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
class RsGxsSearchResult {
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
class RsGxsItem
|
|
||||||
{
|
{
|
||||||
RsGxsId mId;
|
std::string msgId;
|
||||||
std::string mMsgId;
|
std::string origMsgId;
|
||||||
std::string mOrigMsgId;
|
std::string groupId;
|
||||||
|
gxpTime time;
|
||||||
RsGxsTime mTime;
|
|
||||||
std::list<std::string> hashtags;
|
std::list<std::string> hashtags;
|
||||||
std::list<RsGxsLink> linked;
|
std::list<RsGxpLink> linked;
|
||||||
|
|
||||||
gxpsignature sign;
|
RsGxpSignature mSignature;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
class RsGxpGroup
|
||||||
* This provides a base class which
|
|
||||||
* can be intepreted by the service
|
|
||||||
* into concrete search terms
|
|
||||||
*/
|
|
||||||
class RsGxsSearchItem {
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The whole idea is to provide a broad enough base class from which
|
|
||||||
* all the services listed in gxs/db_apps.h
|
|
||||||
*
|
|
||||||
* Main functionality: \n
|
|
||||||
*
|
|
||||||
* Compared to previous cache-system, some improvements are: \n
|
|
||||||
*
|
|
||||||
* On-demand: There is granularity both in time and hiearchy on whats \n
|
|
||||||
* locally resident, all this is controlled by service \n
|
|
||||||
* hiearchy - only grps are completely sync'd, have to request msgs \n
|
|
||||||
* time - grps and hence messages to sync if in time range, grp locally resident but outside range are kept \n
|
|
||||||
*
|
|
||||||
* Search: \n
|
|
||||||
* User can provide search terms (RsGxsSearchItem) that each service can use to retrieve \n
|
|
||||||
* information on items and groups available in their exchange network \n
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Actual data exchanging: \n
|
|
||||||
* Currently naming convention is a bit confused between 'items' or 'messages' \n
|
|
||||||
* - consider item and msgs to be the same for now RsGxsId, gives easy means of associate msgs to grps \n
|
|
||||||
* - all data is received via call back \n
|
|
||||||
* - therefore interface to UI should not be based on being alerted to msg availability \n
|
|
||||||
*/
|
|
||||||
class RsGxsService
|
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
};
|
||||||
* For requesting Msgs
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void requestGrp(std::string& grpId);
|
|
||||||
|
|
||||||
|
class gxp_service
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
/*!
|
requestItem(msgId);
|
||||||
* Event call back for GXS runner
|
|
||||||
* this is called alerting the user that messages have been received
|
|
||||||
* @param msgsReceived set of messages received
|
|
||||||
*/
|
|
||||||
void received(std::list<RsGxsId>& itemsReceived);
|
|
||||||
|
|
||||||
/*!
|
recv(RsGxpItem *item);
|
||||||
*
|
send(RsGxpItem *item);
|
||||||
* @param searchToken token to be redeemed
|
|
||||||
* @param result result set
|
|
||||||
*/
|
|
||||||
void receivedSearchResult(int searchToken, std::set<RsGxsSearchResult*> results);
|
|
||||||
|
|
||||||
/*!
|
/****************************************************************************************************/
|
||||||
* Pushes a RsGxsItem for publication
|
// Event Callback for the service.
|
||||||
* @param msg set of messages to push onto service for publication
|
/****************************************************************************************************/
|
||||||
*/
|
|
||||||
void pushMsg(std::set<RsGxsItem*>& msg);
|
|
||||||
|
|
||||||
|
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?
|
||||||
|
/****************************************************************************************************/
|
||||||
|
|
||||||
/*!
|
/****************************************************************************************************/
|
||||||
* Pushes a RsGxsGroupItem
|
// Interface for Message Read Status
|
||||||
* @param msg set of messages to push onto service for publication
|
// At the moment this is overloaded to handle autodownload flags too.
|
||||||
*/
|
// This is a configuration thing.
|
||||||
void pushGrp(std::set<RsGxsGroupItem*>& grp);
|
/****************************************************************************************************/
|
||||||
|
|
||||||
/*!
|
int flagItemRead(std::string id);
|
||||||
* Event call back from GxsRunner
|
int flagItemUnread(std::string id);
|
||||||
* after request msg(s) have been received
|
int flagGroupRead(std::string id);
|
||||||
*/
|
int flagGroupUnread(std::string id);
|
||||||
void receiveItem(std::set<RsGxsItem*>& items);
|
|
||||||
|
|
||||||
/*!
|
/****************************************************************************************************/
|
||||||
* Event call back from Gxs runner
|
// External Interface for Data.
|
||||||
* after requested Grp(s) have been retrieved
|
/****************************************************************************************************/
|
||||||
*/
|
|
||||||
void receiveGrp(std::set<RsGxsGroupItem*>& grps);
|
|
||||||
|
|
||||||
/****************************************************************************************************/
|
// Mesage Creation.
|
||||||
// Event Callback for the service.
|
int createGroup(RsGxpGroup *grp);
|
||||||
/****************************************************************************************************/
|
int createItem(RsGxpItem *item);
|
||||||
|
|
||||||
notify_groupChanged(); // Mainly for GUI display.
|
// Group Lists & Message Lists.
|
||||||
notify_newMessage(); // used for newsFeeds.
|
int getGroupsChanged(std::list<std::string> &groupIds);
|
||||||
notify_duplicateMessage(); // Channels needs this for Downloading stuff, can probably be moved above.
|
int getGroups(std::list<std::string> &groupIds);
|
||||||
locked_checkDistribMsg(); // required overload?
|
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.
|
||||||
// Must worry about sharing keys.
|
RsGixpProfile *getProfile_locked(std::string id);
|
||||||
// Can gixp handle it?
|
|
||||||
// What interfaces do we need here?
|
|
||||||
// RsGDS deals with most things internally (decrypting, verifying), can put identity creation here to ease
|
|
||||||
/****************************************************************************************************/
|
|
||||||
|
|
||||||
/*!
|
// Immediate Search...
|
||||||
* can choose the share created identity immediately or use identity service later to share it
|
int searchReferringLinks(RsGxpLink link, std::list<std::string> &msgIds);
|
||||||
* @param type
|
int searchHashTags(std::list<std::string>, std::list<std::string> &msgIds);
|
||||||
* @param peers peers to share this identity with
|
|
||||||
* @param pseudonym if type is pseudonym then uses this as the name of the pseudonym Identity
|
|
||||||
*/
|
|
||||||
void createIdentity(int type, std::set<std::string> peers, const std::string pseudonymName);
|
|
||||||
|
|
||||||
|
// Remote Search...
|
||||||
|
|
||||||
/****************************************************************************************************/
|
private:
|
||||||
// Interface for Message Read Status
|
|
||||||
// At the moment this is overloaded to handle autodownload flags too.
|
|
||||||
// This is a configuration thing.
|
|
||||||
/****************************************************************************************************/
|
|
||||||
|
|
||||||
int flagItemRead(const RsGxsId& id);
|
|
||||||
int flagItemUnread(const RsGxsId& id);
|
|
||||||
int flagGroupRead(const RsGxsId& id);
|
|
||||||
int flagGroupUnread(const RsGxsId& id);
|
|
||||||
|
|
||||||
/****************************************************************************************************/
|
|
||||||
// External Interface for Data.
|
|
||||||
/****************************************************************************************************/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* completes the creating of a group by associating it to an identity and creating its signature
|
|
||||||
* grp can then be pushed onto exchange
|
|
||||||
* @param grp the created grp
|
|
||||||
* @param IdentityId identity to associate created grp. Associates to an anonymous id which is created on the fly (or default anonymous id?)
|
|
||||||
*/
|
|
||||||
int createGroup(RsGxsGroupItem* grp, std::string& IdentityId);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* completes the creation of a message by associating to an identity and creating its signature
|
|
||||||
* item can then be pushed onto exhange
|
|
||||||
* @param item the created item, ensure the grp id is set
|
|
||||||
* @return 0 if creationg failed
|
|
||||||
*/
|
|
||||||
int createItem(RsGxsItem* item);
|
|
||||||
|
|
||||||
// Group Lists & Message Lists.
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* A group is marked as changed when it receives a new message,
|
|
||||||
* or its description has been modified
|
|
||||||
* @param groupIds set with ids of groups that have changed
|
|
||||||
*/
|
|
||||||
int getGroupsChanged(std::set<std::string> &groupIds);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @param groupIds all groups locally resident on this exchange
|
|
||||||
*/
|
|
||||||
int getGroups(std::set<std::string> &groupIds);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* NB: looks useful, but not sure of usecase?
|
|
||||||
* @param from
|
|
||||||
* @param to
|
|
||||||
* @param grpIds
|
|
||||||
*/
|
|
||||||
int getGrpsForTimeRange(RsGxsTime from, RsGxsTime to, std::set<std::string> grpIds);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Use this to get list of replacement Ids
|
|
||||||
* @param origIds id to check for replacements
|
|
||||||
* @param replaceIds list of ids that replace this id
|
|
||||||
*/
|
|
||||||
int getReplacementMsgs(const RsGxsId& origId, std::set<RsGxsId> replaceIds);
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Sets the oldest group one can pull off the exhange service
|
|
||||||
* and by definition the oldest message
|
|
||||||
* Does not affect locally resident data
|
|
||||||
* @param range sets the oldest allowable groupId to pull from exchange service
|
|
||||||
*/
|
|
||||||
void setGroupTimeRange(uint64_t cutoff);
|
|
||||||
|
|
||||||
// Getting the Actual Data, data returned via 'received' call back
|
|
||||||
void getMsg(const std::set<RsGxsId>& itemIds);
|
|
||||||
void getGroup(const std::set<std::string>& grpIds);
|
|
||||||
void getMsgsOfGroup(const std::string& grpId);
|
|
||||||
|
|
||||||
|
|
||||||
// Interface with GIXP Stuff... everything else should be behind the scenes.
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @param retrieve the profile of a given Identity id
|
|
||||||
* @return identity profile
|
|
||||||
*/
|
|
||||||
RsGixpProfile *getProfile(const RsGixsId&);
|
|
||||||
|
|
||||||
|
|
||||||
// Immediate Search...
|
|
||||||
int localSearch(const RsGxsSearchItem&);
|
|
||||||
|
|
||||||
// Remote Search...(2 hops ?)
|
|
||||||
int remoteSearch(const RsGxsSearchItem&);
|
|
||||||
|
|
||||||
|
// Reversed Index: for hash searching.
|
||||||
|
std::map<std::string, std::list<ids> > mSearchMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,7 +67,14 @@ public:
|
|||||||
* @param msgGrp this contains grp and the message to retrieve
|
* @param msgGrp this contains grp and the message to retrieve
|
||||||
* @return request code to be redeemed later
|
* @return request code to be redeemed later
|
||||||
*/
|
*/
|
||||||
virtual int request(const MsgGrpId& msgGrp, bool decrypted) = 0;
|
virtual int request(const MsgGrpId& msgGrp) = 0;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Retrieves a group item by grpId
|
||||||
|
* @param grpId the ID of the group to retrieve
|
||||||
|
* @return request code to be redeemed later
|
||||||
|
*/
|
||||||
|
virtual int request(const std::string grpId) = 0;
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -31,99 +31,253 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <string>
|
||||||
|
#include <list>
|
||||||
|
#include <set>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "serialiser/rsbaseitems.h"
|
typedef time_t RsGxsTime;
|
||||||
#include "rsgnp.h"
|
|
||||||
#include "rsgdp.h"
|
|
||||||
#include "rsgixs.h"
|
|
||||||
|
|
||||||
|
class RsGxsLink
|
||||||
|
{
|
||||||
|
uint32_t type;
|
||||||
|
std::string msgId;
|
||||||
|
};
|
||||||
|
|
||||||
typedef std::map<uint32_t, std::string> requestMsgMap;
|
class RsGxsGroupItem {
|
||||||
|
|
||||||
/*!
|
RsGxsId Id;
|
||||||
*
|
|
||||||
* Brief explanation of how RsGeneralExchange service would work \n
|
|
||||||
*
|
|
||||||
* Resposibilities : Giving access to its RsGeneralDataService and RsNetworktExchangeService
|
|
||||||
* instances \n
|
|
||||||
*
|
|
||||||
* Features: \n
|
|
||||||
*
|
|
||||||
* Internal Message Flow: \n\n
|
|
||||||
*
|
|
||||||
* - Storage of user generated messages : stores are made to RsGeneralDataService \n
|
|
||||||
* - Outbound Requests are made via RsNetworktExchangeService from here, and delivered to the service \n
|
|
||||||
* A consideration is allow the RsNetworktExchangeService x-ref GDP and GNP \n
|
|
||||||
*
|
|
||||||
* - Inbound request from peers are made by RsNetworktExchangeService to RsGeneralDataService \n
|
|
||||||
* Again x-ref between GNP and GDP (Services don't see implementation so they don't know this) \n
|
|
||||||
*
|
|
||||||
* - RsNetworktExchangeService stores requested message \n
|
|
||||||
*
|
|
||||||
* Permissions: \n\n
|
|
||||||
* - Permission are defined within the service, and mirror RsGroups feature set \n
|
|
||||||
* - These are resolved in RsGeneralDataService \n
|
|
||||||
*
|
|
||||||
* Storage: \n\n
|
|
||||||
*
|
|
||||||
* - Storage mechnaism used by service can be whatever they want with current RsGeneralStorageService
|
|
||||||
* interface \n
|
|
||||||
* - But a partial (non-pure virtual) implementation may be done to enforce use of Retrodb
|
|
||||||
* and efficiency \n
|
|
||||||
*
|
|
||||||
* Security:
|
|
||||||
* - This accessible at all levels but generally the service and storage. \n
|
|
||||||
* - Security feature can be used or not, for RsIdentityExchangeService this is not used obviously\n
|
|
||||||
*
|
|
||||||
*
|
|
||||||
************************************/
|
|
||||||
class RsGeneralExchangeService {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* get the RsGeneralDataService instance serving this \n
|
|
||||||
* @see RsGeneralExchangeService
|
|
||||||
* @return data service
|
|
||||||
*/
|
|
||||||
virtual RsGeneralDataService* getDataService() = 0;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* get the RsNetworktExchangeService instance serving this \n
|
|
||||||
* @see RsGeneralExchangeService
|
|
||||||
* @return network exchange service
|
|
||||||
*/
|
|
||||||
virtual RsNetworktExchangeService* getNetworkService() = 0;
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Requests by this service for messages can be satisfied calling \n
|
|
||||||
* this method with a map containing id to msg map
|
|
||||||
*/
|
|
||||||
virtual void receiveMessages(requestMsgMap&) = 0;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* This allows non blocking requests to be made to this service
|
|
||||||
*/
|
|
||||||
virtual void tick();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class RsGxsId {
|
||||||
|
|
||||||
|
std::string msgId;
|
||||||
|
std::string grpId;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class RsGxsSearchResult {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class RsGxsMsg
|
||||||
|
{
|
||||||
|
RsGxsId mId;
|
||||||
|
std::string mMsgId;
|
||||||
|
std::string mOrigMsgId;
|
||||||
|
|
||||||
|
RsGxsTime mTime;
|
||||||
|
std::list<std::string> mHashtags;
|
||||||
|
std::list<RsGxsLink> mLinked;
|
||||||
|
|
||||||
|
RsGxpSignature mSignature;
|
||||||
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Implementations of general exchange service can be added \n
|
* This provides a base class which
|
||||||
* to this service runner which ticks the service's general data service \n
|
* can be intepreted by the service
|
||||||
* and the service itself
|
* into concrete search terms
|
||||||
*/
|
*/
|
||||||
class RsGxServiceRunner : public RsThread {
|
class RsGxsSearchItem {
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* The whole idea is to provide a broad enough base class from which
|
||||||
|
* all the services listed in gxs/db_apps.h
|
||||||
|
*
|
||||||
|
* Main functionality: \n
|
||||||
|
*
|
||||||
|
* Compared to previous cache-system, some improvements are: \n
|
||||||
|
*
|
||||||
|
* On-demand: There is granularity both in time and hiearchy on whats \n
|
||||||
|
* locally resident, all this is controlled by service \n
|
||||||
|
* hiearchy - only grps are completely sync'd, have to request msgs \n
|
||||||
|
* time - grps and hence messages to sync if in time range, grp locally resident but outside range are kept \n
|
||||||
|
*
|
||||||
|
* Search: \n
|
||||||
|
* User can provide search terms (RsGxsSearchItem) that each service can use to retrieve \n
|
||||||
|
* information on items and groups available in their exchange network \n
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Actual data exchanging: \n
|
||||||
|
* Currently naming convention is a bit confused between 'items' or 'messages' \n
|
||||||
|
* - consider item and msgs to be the same for now RsGxsId, gives easy means of associate msgs to grps \n
|
||||||
|
* - all data is received via call back \n
|
||||||
|
* - therefore interface to UI should not be based on being alerted to msg availability \n
|
||||||
|
*/
|
||||||
|
class RsGxsService
|
||||||
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void addGxService() = 0;
|
|
||||||
|
/*!
|
||||||
|
* For requesting Msgs
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void requestGrp(std::string& grpId);
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Event call back for GXS runner
|
||||||
|
* this is called alerting the user that messages have been received
|
||||||
|
* @param msgsReceived set of messages received
|
||||||
|
*/
|
||||||
|
void received(std::list<RsGxsId>& itemsReceived);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*
|
||||||
|
* @param searchToken token to be redeemed
|
||||||
|
* @param result result set
|
||||||
|
*/
|
||||||
|
void receivedSearchResult(int searchToken, std::set<RsGxsSearchResult*> results);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Pushes a RsGxsItem for publication
|
||||||
|
* @param msg set of messages to push onto service for publication
|
||||||
|
*/
|
||||||
|
void pushMsg(std::set<RsGxsItem*>& msg);
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Pushes a RsGxsGroupItem
|
||||||
|
* @param msg set of messages to push onto service for publication
|
||||||
|
*/
|
||||||
|
void pushGrp(std::set<RsGxsGroupItem*>& grp);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Event call back from GxsRunner
|
||||||
|
* after request msg(s) have been received
|
||||||
|
*/
|
||||||
|
void receiveItem(std::set<RsGxsItem*>& items);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Event call back from Gxs runner
|
||||||
|
* after requested Grp(s) have been retrieved
|
||||||
|
*/
|
||||||
|
void receiveGrp(std::set<RsGxsGroupItem*>& grps);
|
||||||
|
|
||||||
|
/****************************************************************************************************/
|
||||||
|
// 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?
|
||||||
|
// RsGDS deals with most things internally (decrypting, verifying), can put identity creation here to ease
|
||||||
|
/****************************************************************************************************/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* can choose the share created identity immediately or use identity service later to share it
|
||||||
|
* @param type
|
||||||
|
* @param peers peers to share this identity with
|
||||||
|
* @param pseudonym if type is pseudonym then uses this as the name of the pseudonym Identity
|
||||||
|
*/
|
||||||
|
void createIdentity(int type, std::set<std::string> peers, const std::string pseudonymName);
|
||||||
|
|
||||||
|
|
||||||
|
/****************************************************************************************************/
|
||||||
|
// Interface for Message Read Status
|
||||||
|
// At the moment this is overloaded to handle autodownload flags too.
|
||||||
|
// This is a configuration thing.
|
||||||
|
/****************************************************************************************************/
|
||||||
|
|
||||||
|
int flagItemRead(const RsGxsId& id);
|
||||||
|
int flagItemUnread(const RsGxsId& id);
|
||||||
|
int flagGroupRead(const RsGxsId& id);
|
||||||
|
int flagGroupUnread(const RsGxsId& id);
|
||||||
|
|
||||||
|
/****************************************************************************************************/
|
||||||
|
// External Interface for Data.
|
||||||
|
/****************************************************************************************************/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* completes the creating of a group by associating it to an identity and creating its signature
|
||||||
|
* grp can then be pushed onto exchange
|
||||||
|
* @param grp the created grp
|
||||||
|
* @param IdentityId identity to associate created grp. Associates to an anonymous id which is created on the fly (or default anonymous id?)
|
||||||
|
*/
|
||||||
|
int createGroup(RsGxsGroupItem* grp, std::string& IdentityId);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* completes the creation of a message by associating to an identity and creating its signature
|
||||||
|
* item can then be pushed onto exhange
|
||||||
|
* @param item the created item, ensure the grp id is set
|
||||||
|
* @return 0 if creationg failed
|
||||||
|
*/
|
||||||
|
int createItem(RsGxsItem* item);
|
||||||
|
|
||||||
|
// Group Lists & Message Lists.
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* A group is marked as changed when it receives a new message,
|
||||||
|
* or its description has been modified
|
||||||
|
* @param groupIds set with ids of groups that have changed
|
||||||
|
*/
|
||||||
|
int getGroupsChanged(std::set<std::string> &groupIds);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @param groupIds all groups locally resident on this exchange
|
||||||
|
*/
|
||||||
|
int getGroups(std::set<std::string> &groupIds);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* NB: looks useful, but not sure of usecase?
|
||||||
|
* @param from
|
||||||
|
* @param to
|
||||||
|
* @param grpIds
|
||||||
|
*/
|
||||||
|
int getGrpsForTimeRange(RsGxsTime from, RsGxsTime to, std::set<std::string> grpIds);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Use this to get list of replacement Ids
|
||||||
|
* @param origIds id to check for replacements
|
||||||
|
* @param replaceIds list of ids that replace this id
|
||||||
|
*/
|
||||||
|
int getReplacementMsgs(const RsGxsId& origId, std::set<RsGxsId> replaceIds);
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Sets the oldest group one can pull off the exhange service
|
||||||
|
* and by definition the oldest message
|
||||||
|
* Does not affect locally resident data
|
||||||
|
* @param range sets the oldest allowable groupId to pull from exchange service
|
||||||
|
*/
|
||||||
|
void setGroupTimeRange(uint64_t cutoff);
|
||||||
|
|
||||||
|
// Getting the Actual Data, data returned via 'received' call back
|
||||||
|
void getMsg(const std::set<RsGxsId>& itemIds);
|
||||||
|
void getGroup(const std::set<std::string>& grpIds);
|
||||||
|
void getMsgsOfGroup(const std::string& grpId);
|
||||||
|
|
||||||
|
|
||||||
|
// Interface with GIXP Stuff... everything else should be behind the scenes.
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @param retrieve the profile of a given Identity id
|
||||||
|
* @return identity profile
|
||||||
|
*/
|
||||||
|
RsGixpProfile *getProfile(const RsGixsId&);
|
||||||
|
|
||||||
|
|
||||||
|
// Immediate Search...
|
||||||
|
int localSearch(const RsGxsSearchItem&);
|
||||||
|
|
||||||
|
// Remote Search...(2 hops ?)
|
||||||
|
int remoteSearch(const RsGxsSearchItem&);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // RSGXS_H
|
#endif // RSGXS_H
|
||||||
|
Loading…
Reference in New Issue
Block a user