mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-07 16:45:11 -04:00
fresh recompile needed!
TokenQueueV2 added, first change to photoshare to deal with gxs backend needed to redirect meta types to mine in order to get compilation working and definition fixes to rsgenexchange. Next step is to get GxsRunner going git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5377 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
09b5d7a8c6
commit
d220e14c4a
21 changed files with 490 additions and 156 deletions
|
@ -32,6 +32,7 @@
|
|||
#include "rsgds.h"
|
||||
#include "rsnxs.h"
|
||||
#include "rsgxsdataaccess.h"
|
||||
#include "rsnxsobserver.h"
|
||||
#include "retroshare/rsgxsservice.h"
|
||||
#include "serialiser/rsnxsitems.h"
|
||||
|
||||
|
@ -58,7 +59,7 @@ typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > GxsMsgMetaMap;
|
|||
* Also notifications are made here on receipt of new data from
|
||||
* connected peers
|
||||
*/
|
||||
class RsGenExchange : public RsGxsService
|
||||
class RsGenExchange : public RsGxsService, public RsNxsObserver
|
||||
{
|
||||
public:
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "serialiser/rsnxsitems.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <string>
|
||||
|
@ -38,7 +39,6 @@
|
|||
#include <set>
|
||||
#include <map>
|
||||
|
||||
#include "rsnxsobserver.h"
|
||||
|
||||
typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgReq;
|
||||
typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgIdResult;
|
||||
|
@ -46,13 +46,13 @@ typedef std::map<RsGxsGroupId, std::vector<RsGxsMsgMetaData*> > GxsMsgMetaResult
|
|||
typedef std::map<RsGxsGroupId, std::vector<RsNxsMsg*> > NxsMsgDataResult;
|
||||
typedef std::map<RsGxsGroupId, std::vector<RsNxsMsg*> > GxsMsgResult; // <grpId, msgs>
|
||||
|
||||
class RsGxsService : public RsNxsObserver
|
||||
class RsGxsService
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
RsGxsService();
|
||||
virtual ~RsGxsService();
|
||||
RsGxsService(){}
|
||||
virtual ~RsGxsService(){}
|
||||
|
||||
virtual void tick() = 0;
|
||||
|
||||
|
|
|
@ -891,6 +891,21 @@ void RsGxsDataAccess::tokenList(std::list<uint32_t>& tokens) {
|
|||
}
|
||||
}
|
||||
|
||||
bool RsGxsDataAccess::updateRequestStatus(const uint32_t& token,
|
||||
const uint32_t& status) {
|
||||
|
||||
RsStackMutex stack(mDataMutex);
|
||||
|
||||
GxsRequest* req = retrieveRequest(token);
|
||||
|
||||
if(req)
|
||||
req->status = status;
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RsGxsDataAccess::checkMsgFilter(const RsTokReqOptions& opts, const RsGxsMsgMetaData* meta) const
|
||||
{
|
||||
bool statusMatch = false;
|
||||
|
|
|
@ -40,6 +40,28 @@
|
|||
#define GXS_REQUEST_TYPE_MSG_META 0x00100000
|
||||
#define GXS_REQUEST_TYPE_MSG_IDS 0x00200000
|
||||
|
||||
|
||||
|
||||
// This bit will be filled out over time.
|
||||
#define RS_TOKREQOPT_MSG_VERSIONS 0x0001 // MSGRELATED: Returns All MsgIds with OrigMsgId = MsgId.
|
||||
#define RS_TOKREQOPT_MSG_ORIGMSG 0x0002 // MSGLIST: All Unique OrigMsgIds in a Group.
|
||||
#define RS_TOKREQOPT_MSG_LATEST 0x0004 // MSGLIST: All Latest MsgIds in Group. MSGRELATED: Latest MsgIds for Input Msgs.
|
||||
|
||||
#define RS_TOKREQOPT_MSG_THREAD 0x0010 // MSGRELATED: All Msgs in Thread. MSGLIST: All Unique Thread Ids in Group.
|
||||
#define RS_TOKREQOPT_MSG_PARENT 0x0020 // MSGRELATED: All Children Msgs.
|
||||
|
||||
#define RS_TOKREQOPT_MSG_AUTHOR 0x0040 // MSGLIST: Messages from this AuthorId
|
||||
|
||||
// Read Status.
|
||||
#define RS_TOKREQOPT_READ 0x0001
|
||||
#define RS_TOKREQOPT_UNREAD 0x0002
|
||||
|
||||
#define RS_TOKREQ_ANSTYPE_LIST 0x0001
|
||||
#define RS_TOKREQ_ANSTYPE_SUMMARY 0x0002
|
||||
#define RS_TOKREQ_ANSTYPE_DATA 0x0003
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* This class provides useful generic support for GXS style services.
|
||||
* I expect much of this will be incorporated into the base GXS.
|
||||
|
|
|
@ -673,6 +673,7 @@ HEADERS += serialiser/rsnxsitems.h \
|
|||
gxs/rsgxsdataaccess.h \
|
||||
retroshare/rsgxsservice.h \
|
||||
serialiser/rsgxsitems.h \
|
||||
serialiser/rsphotov2items.h \
|
||||
util/retrodb.h
|
||||
|
||||
SOURCES += serialiser/rsnxsitems.cc \
|
||||
|
@ -680,8 +681,10 @@ SOURCES += serialiser/rsnxsitems.cc \
|
|||
gxs/rsgenexchange.cc \
|
||||
gxs/rsgxsnetservice.cc \
|
||||
gxs/rsgxsdata.cc \
|
||||
serialiser/rsgxsitems.cc \
|
||||
services/p3photoserviceV2.cc \
|
||||
gxs/rsgxsdataaccess.cc \
|
||||
serialiser/rsphotov2items.cc \
|
||||
util/retrodb.cc
|
||||
}
|
||||
|
||||
|
|
|
@ -215,83 +215,84 @@ class RsTokReqOptions
|
|||
|
||||
#define RSGXS_MAX_SERVICE_STRING 200 // Sensible limit for dbase usage.
|
||||
|
||||
#include "serialiser/rsgxsitems.h"
|
||||
|
||||
class RsGroupMetaData
|
||||
{
|
||||
public:
|
||||
|
||||
RsGroupMetaData()
|
||||
{
|
||||
mGroupFlags = 0;
|
||||
mSignFlags = 0;
|
||||
mSubscribeFlags = 0;
|
||||
|
||||
mPop = 0;
|
||||
mMsgCount = 0;
|
||||
mLastPost = 0;
|
||||
mGroupStatus = 0;
|
||||
|
||||
//mPublishTs = 0;
|
||||
}
|
||||
|
||||
std::string mGroupId;
|
||||
std::string mGroupName;
|
||||
uint32_t mGroupFlags; // Service Specific Options ????
|
||||
uint32_t mSignFlags; // Combination of RSGXS_GROUP_SIGN_PUBLISH_MASK & RSGXS_GROUP_SIGN_AUTHOR_MASK.
|
||||
|
||||
time_t mPublishTs; // Mandatory.
|
||||
std::string mAuthorId; // Optional.
|
||||
|
||||
// BELOW HERE IS LOCAL DATA, THAT IS NOT FROM MSG.
|
||||
|
||||
uint32_t mSubscribeFlags;
|
||||
|
||||
uint32_t mPop; // HOW DO WE DO THIS NOW.
|
||||
uint32_t mMsgCount; // ???
|
||||
time_t mLastPost; // ???
|
||||
|
||||
uint32_t mGroupStatus;
|
||||
|
||||
std::string mServiceString; // Service Specific Free-Form extra storage.
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class RsMsgMetaData
|
||||
{
|
||||
public:
|
||||
|
||||
RsMsgMetaData()
|
||||
{
|
||||
mPublishTs = 0;
|
||||
mMsgFlags = 0;
|
||||
mMsgStatus = 0;
|
||||
mChildTs = 0;
|
||||
}
|
||||
|
||||
std::string mGroupId;
|
||||
std::string mMsgId;
|
||||
|
||||
std::string mThreadId;
|
||||
std::string mParentId;
|
||||
std::string mOrigMsgId;
|
||||
|
||||
std::string mAuthorId;
|
||||
|
||||
std::string mMsgName;
|
||||
time_t mPublishTs;
|
||||
|
||||
uint32_t mMsgFlags; // Whats this for? (Optional Service Specific - e.g. flag MsgType)
|
||||
|
||||
// BELOW HERE IS LOCAL DATA, THAT IS NOT FROM MSG.
|
||||
// normally READ / UNREAD flags. LOCAL Data.
|
||||
uint32_t mMsgStatus;
|
||||
time_t mChildTs;
|
||||
|
||||
std::string mServiceString; // Service Specific Free-Form extra storage.
|
||||
|
||||
};
|
||||
//class RsGroupMetaData
|
||||
//{
|
||||
// public:
|
||||
//
|
||||
// RsGroupMetaData()
|
||||
// {
|
||||
// mGroupFlags = 0;
|
||||
// mSignFlags = 0;
|
||||
// mSubscribeFlags = 0;
|
||||
//
|
||||
// mPop = 0;
|
||||
// mMsgCount = 0;
|
||||
// mLastPost = 0;
|
||||
// mGroupStatus = 0;
|
||||
//
|
||||
// //mPublishTs = 0;
|
||||
// }
|
||||
//
|
||||
// std::string mGroupId;
|
||||
// std::string mGroupName;
|
||||
// uint32_t mGroupFlags; // Service Specific Options ????
|
||||
// uint32_t mSignFlags; // Combination of RSGXS_GROUP_SIGN_PUBLISH_MASK & RSGXS_GROUP_SIGN_AUTHOR_MASK.
|
||||
//
|
||||
// time_t mPublishTs; // Mandatory.
|
||||
// std::string mAuthorId; // Optional.
|
||||
//
|
||||
// // BELOW HERE IS LOCAL DATA, THAT IS NOT FROM MSG.
|
||||
//
|
||||
// uint32_t mSubscribeFlags;
|
||||
//
|
||||
// uint32_t mPop; // HOW DO WE DO THIS NOW.
|
||||
// uint32_t mMsgCount; // ???
|
||||
// time_t mLastPost; // ???
|
||||
//
|
||||
// uint32_t mGroupStatus;
|
||||
//
|
||||
// std::string mServiceString; // Service Specific Free-Form extra storage.
|
||||
//};
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//class RsMsgMetaData
|
||||
//{
|
||||
// public:
|
||||
//
|
||||
// RsMsgMetaData()
|
||||
// {
|
||||
// mPublishTs = 0;
|
||||
// mMsgFlags = 0;
|
||||
// mMsgStatus = 0;
|
||||
// mChildTs = 0;
|
||||
// }
|
||||
//
|
||||
// std::string mGroupId;
|
||||
// std::string mMsgId;
|
||||
//
|
||||
// std::string mThreadId;
|
||||
// std::string mParentId;
|
||||
// std::string mOrigMsgId;
|
||||
//
|
||||
// std::string mAuthorId;
|
||||
//
|
||||
// std::string mMsgName;
|
||||
// time_t mPublishTs;
|
||||
//
|
||||
// uint32_t mMsgFlags; // Whats this for? (Optional Service Specific - e.g. flag MsgType)
|
||||
//
|
||||
// // BELOW HERE IS LOCAL DATA, THAT IS NOT FROM MSG.
|
||||
// // normally READ / UNREAD flags. LOCAL Data.
|
||||
// uint32_t mMsgStatus;
|
||||
// time_t mChildTs;
|
||||
//
|
||||
// std::string mServiceString; // Service Specific Free-Form extra storage.
|
||||
//
|
||||
//};
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const RsGroupMetaData &meta);
|
||||
std::ostream &operator<<(std::ostream &out, const RsMsgMetaData &meta);
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
#include "rsgxsservice.h"
|
||||
|
||||
/* The Main Interface Class - for information about your Peers */
|
||||
class RsPhoto;
|
||||
extern RsPhoto *rsPhoto;
|
||||
class RsPhotoV2;
|
||||
extern RsPhotoV2 *rsPhotoV2;
|
||||
|
||||
/******************* NEW STUFF FOR NEW CACHE SYSTEM *********/
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ class RsGroupMetaData
|
|||
std::string mGroupId;
|
||||
std::string mGroupName;
|
||||
uint32_t mGroupFlags;
|
||||
uint32_t mSignFlags; // Combination of RSGXS_GROUP_SIGN_PUBLISH_MASK & RSGXS_GROUP_SIGN_AUTHOR_MASK.
|
||||
|
||||
time_t mPublishTs; // Mandatory.
|
||||
std::string mAuthorId; // Optional.
|
||||
|
@ -70,6 +71,7 @@ class RsGroupMetaData
|
|||
time_t mLastPost; // ???
|
||||
|
||||
uint32_t mGroupStatus;
|
||||
std::string mServiceString; // Service Specific Free-Form extra storage.
|
||||
|
||||
};
|
||||
|
||||
|
@ -109,6 +111,7 @@ class RsMsgMetaData
|
|||
// normally READ / UNREAD flags. LOCAL Data.
|
||||
uint32_t mMsgStatus;
|
||||
time_t mChildTs;
|
||||
std::string mServiceString; // Service Specific Free-Form extra storage.
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "p3photoserviceV2.h"
|
||||
#include "serialiser/rsphotov2items.h"
|
||||
|
||||
RsPhotoV2 *rsPhotoV2 = NULL;
|
||||
|
||||
p3PhotoServiceV2::p3PhotoServiceV2(RsGeneralDataService* gds, RsNetworkExchangeService* nes)
|
||||
: RsGenExchange(gds, nes, new RsGxsPhotoSerialiser(), RS_SERVICE_TYPE_PHOTO)
|
||||
{
|
||||
|
@ -10,31 +12,31 @@ p3PhotoServiceV2::p3PhotoServiceV2(RsGeneralDataService* gds, RsNetworkExchangeS
|
|||
bool p3PhotoServiceV2::updated()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void p3PhotoServiceV2::groupsChanged(std::list<std::string>& grpIds) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void p3PhotoServiceV2::msgsChanged(
|
||||
std::map<std::string, std::vector<std::string> >& msgs)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RsTokenServiceV2* p3PhotoServiceV2::getTokenService() {
|
||||
|
||||
return RsGenExchange::getTokenService();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool p3PhotoServiceV2::getGroupList(const uint32_t& token,
|
||||
std::list<std::string>& groupIds)
|
||||
{
|
||||
return RsGenExchange::getGroupList(token, groupIds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool p3PhotoServiceV2::getMsgList(const uint32_t& token,
|
||||
|
@ -42,21 +44,21 @@ bool p3PhotoServiceV2::getMsgList(const uint32_t& token,
|
|||
{
|
||||
|
||||
return RsGenExchange::getMsgList(token, msgIds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool p3PhotoServiceV2::getGroupSummary(const uint32_t& token,
|
||||
std::list<RsGroupMetaData>& groupInfo)
|
||||
{
|
||||
return RsGenExchange::getGroupMeta(token, groupInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool p3PhotoServiceV2::getMsgSummary(const uint32_t& token,
|
||||
MsgMetaResult& msgInfo)
|
||||
{
|
||||
return RsGenExchange::getMsgMeta(token, msgInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool p3PhotoServiceV2::getAlbum(const uint32_t& token, std::vector<RsPhotoAlbum>& albums)
|
||||
|
@ -78,7 +80,7 @@ bool p3PhotoServiceV2::getAlbum(const uint32_t& token, std::vector<RsPhotoAlbum>
|
|||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool p3PhotoServiceV2::getPhoto(const uint32_t& token, PhotoResult& photos)
|
||||
|
@ -114,19 +116,19 @@ bool p3PhotoServiceV2::getPhoto(const uint32_t& token, PhotoResult& photos)
|
|||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool p3PhotoServiceV2::submitAlbumDetails(RsPhotoAlbum& album)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool p3PhotoServiceV2::submitPhoto(RsPhotoPhoto& photo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue