mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-28 16:27:01 -05:00
gxs back end now compilable, need to test
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5346 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d5520a1cd8
commit
17da89938f
@ -8,6 +8,7 @@
|
|||||||
#include "gxscoreserver.h"
|
#include "gxscoreserver.h"
|
||||||
|
|
||||||
GxsCoreServer::GxsCoreServer()
|
GxsCoreServer::GxsCoreServer()
|
||||||
|
: mGxsMutex("GxsCoreServer")
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "serialiser/rsgxsitems.h"
|
#include "serialiser/rsgxsitems.h"
|
||||||
#include "serialiser/rsnxsitems.h"
|
#include "serialiser/rsnxsitems.h"
|
||||||
#include "gxs/rsgxsdata.h"
|
#include "gxs/rsgxsdata.h"
|
||||||
|
#include "rsgxs.h"
|
||||||
|
|
||||||
|
|
||||||
class RsGxsSearchModule {
|
class RsGxsSearchModule {
|
||||||
@ -62,9 +63,9 @@ class GrpLocMetaData {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgReq; // <grpId, msgIds>
|
//typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgReq; // <grpId, msgIds>
|
||||||
typedef std::map<RsGxsGroupId, std::vector<RsNxsMsg*> > GxsMsgResult; // <grpId, msgs>
|
|
||||||
typedef std::map<RsGxsGroupId, std::vector<RsGxsMsgMetaData*> > GxsMsgMetaResult; // <grpId, msg metadatas>
|
//typedef std::map<RsGxsGroupId, std::vector<RsGxsMsgMetaData*> > GxsMsgMetaResult; // <grpId, msg metadatas>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* The main role of GDS is the preparation and handing out of messages requested from
|
* The main role of GDS is the preparation and handing out of messages requested from
|
||||||
|
@ -52,14 +52,16 @@ bool RsGenExchange::getGroupMeta(const uint32_t &token, std::list<RsGroupMetaDat
|
|||||||
bool ok = mDataAccess->getGroupSummary(token, metaL);
|
bool ok = mDataAccess->getGroupSummary(token, metaL);
|
||||||
|
|
||||||
std::list<RsGxsGrpMetaData*>::iterator lit = metaL.begin();
|
std::list<RsGxsGrpMetaData*>::iterator lit = metaL.begin();
|
||||||
|
RsGroupMetaData m;
|
||||||
for(; lit != metaL.end(); lit++)
|
for(; lit != metaL.end(); lit++)
|
||||||
{
|
{
|
||||||
RsGroupMetaData m = *(*lit);
|
RsGxsGrpMetaData& gMeta = *(*lit);
|
||||||
|
m = gMeta;
|
||||||
groupInfo.push_back(m);
|
groupInfo.push_back(m);
|
||||||
|
delete (*lit);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<RsGxsGrpMetaData*>::iterator cit = metaL;
|
std::list<RsGxsGrpMetaData*>::iterator cit = metaL.begin();
|
||||||
for(; cit != metaL.end(); cit++)
|
for(; cit != metaL.end(); cit++)
|
||||||
delete *cit;
|
delete *cit;
|
||||||
|
|
||||||
@ -79,7 +81,7 @@ bool RsGenExchange::getMsgMeta(const uint32_t &token,
|
|||||||
for(; mit != result.end(); mit++)
|
for(; mit != result.end(); mit++)
|
||||||
{
|
{
|
||||||
std::vector<RsGxsMsgMetaData*>& metaV = mit->second;
|
std::vector<RsGxsMsgMetaData*>& metaV = mit->second;
|
||||||
msgInfo[mit->first] = metaV;
|
//msgInfo[mit->first] = metaV;
|
||||||
|
|
||||||
std::vector<RsGxsMsgMetaData*>::iterator vit = metaV.begin();
|
std::vector<RsGxsMsgMetaData*>::iterator vit = metaV.begin();
|
||||||
|
|
||||||
@ -147,7 +149,7 @@ bool RsGenExchange::getMsgData(const uint32_t &token,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RsTokenService* RsGenExchange::getTokenService()
|
RsTokenServiceV2* RsGenExchange::getTokenService()
|
||||||
{
|
{
|
||||||
return mDataAccess;
|
return mDataAccess;
|
||||||
}
|
}
|
||||||
@ -256,7 +258,7 @@ void RsGenExchange::publishGrps()
|
|||||||
{
|
{
|
||||||
grp->metaData = new RsGxsGrpMetaData();
|
grp->metaData = new RsGxsGrpMetaData();
|
||||||
ok = mDataAccess->addGroupData(grp);
|
ok = mDataAccess->addGroupData(grp);
|
||||||
RsGxsGroupChange* gc = RsGxsGroupChange();
|
RsGxsGroupChange* gc = new RsGxsGroupChange();
|
||||||
mNotifications.push_back(gc);
|
mNotifications.push_back(gc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public:
|
|||||||
* @return handle to token service handle for making
|
* @return handle to token service handle for making
|
||||||
* request to this gxs service
|
* request to this gxs service
|
||||||
*/
|
*/
|
||||||
RsTokenService* getTokenService();
|
RsTokenServiceV2* getTokenService();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::vector<RsGxsChange*> mChanges;
|
std::vector<RsGxsNotify*> mChanges;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RSGENEXCHANGE_H
|
#endif // RSGENEXCHANGE_H
|
||||||
|
@ -40,7 +40,11 @@
|
|||||||
|
|
||||||
#include "rsnxsobserver.h"
|
#include "rsnxsobserver.h"
|
||||||
|
|
||||||
|
typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgReq;
|
||||||
|
typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgIdResult;
|
||||||
|
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 RsNxsObserver
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#include "rsgxsdataaccess.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* libretroshare/src/retroshare: rsgxsdataaccess.cc
|
* libretroshare/src/retroshare: rsgxsdataaccess.cc
|
||||||
*
|
*
|
||||||
@ -25,6 +23,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "rsgxsdataaccess.h"
|
||||||
|
|
||||||
// This bit will be filled out over time.
|
// 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_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_ORIGMSG 0x0002 // MSGLIST: All Unique OrigMsgIds in a Group.
|
||||||
@ -51,15 +51,15 @@
|
|||||||
#define RS_TOKREQ_ANSTYPE_SUMMARY 0x0002
|
#define RS_TOKREQ_ANSTYPE_SUMMARY 0x0002
|
||||||
#define RS_TOKREQ_ANSTYPE_DATA 0x0003
|
#define RS_TOKREQ_ANSTYPE_DATA 0x0003
|
||||||
|
|
||||||
const uint8_t RsGxsDataAccess::GXS_REQUEST_STATUS_FAILED = 0;
|
const uint8_t RsTokenServiceV2::GXS_REQUEST_STATUS_FAILED = 0;
|
||||||
const uint8_t RsGxsDataAccess::GXS_REQUEST_STATUS_PENDING = 1;
|
const uint8_t RsTokenServiceV2::GXS_REQUEST_STATUS_PENDING = 1;
|
||||||
const uint8_t RsGxsDataAccess::GXS_REQUEST_STATUS_PARTIAL = 2;
|
const uint8_t RsTokenServiceV2::GXS_REQUEST_STATUS_PARTIAL = 2;
|
||||||
const uint8_t RsGxsDataAccess::GXS_REQUEST_STATUS_FINISHED_INCOMPLETE = 3;
|
const uint8_t RsTokenServiceV2::GXS_REQUEST_STATUS_FINISHED_INCOMPLETE = 3;
|
||||||
const uint8_t RsGxsDataAccess::GXS_REQUEST_STATUS_COMPLETE = 4;
|
const uint8_t RsTokenServiceV2::GXS_REQUEST_STATUS_COMPLETE = 4;
|
||||||
const uint8_t RsGxsDataAccess::GXS_REQUEST_STATUS_DONE = 5; // ONCE ALL DATA RETRIEVED.
|
const uint8_t RsTokenServiceV2::GXS_REQUEST_STATUS_DONE = 5; // ONCE ALL DATA RETRIEVED.
|
||||||
|
|
||||||
RsGxsDataAccess::RsGxsDataAccess(RsGeneralDataService* ds)
|
RsGxsDataAccess::RsGxsDataAccess(RsGeneralDataService* ds)
|
||||||
: mDataStore(ds)
|
: mDataStore(ds), mDataMutex("RsGxsDataAccess")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ bool RsGxsDataAccess::getGroupData(const uint32_t& token, std::list<RsNxsGrp*>&
|
|||||||
return false;
|
return false;
|
||||||
}else if(req->token == GXS_REQUEST_STATUS_COMPLETE){
|
}else if(req->token == GXS_REQUEST_STATUS_COMPLETE){
|
||||||
|
|
||||||
GroupDataReq* gmreq = dynamic_cast<GroupMetaReq*>(req);
|
GroupDataReq* gmreq = dynamic_cast<GroupDataReq*>(req);
|
||||||
|
|
||||||
if(gmreq)
|
if(gmreq)
|
||||||
{
|
{
|
||||||
@ -330,7 +330,7 @@ bool RsGxsDataAccess::getMsgData(const uint32_t& token, NxsMsgDataResult& msgDat
|
|||||||
return false;
|
return false;
|
||||||
}else if(req->token == GXS_REQUEST_STATUS_COMPLETE){
|
}else if(req->token == GXS_REQUEST_STATUS_COMPLETE){
|
||||||
|
|
||||||
MsgDataReq* mdreq = dynamic_cast<GroupMetaReq*>(req);
|
MsgDataReq* mdreq = dynamic_cast<MsgDataReq*>(req);
|
||||||
|
|
||||||
if(mdreq)
|
if(mdreq)
|
||||||
{
|
{
|
||||||
@ -358,7 +358,7 @@ bool RsGxsDataAccess::getMsgSummary(const uint32_t& token, GxsMsgMetaResult& msg
|
|||||||
return false;
|
return false;
|
||||||
}else if(req->token == GXS_REQUEST_STATUS_COMPLETE){
|
}else if(req->token == GXS_REQUEST_STATUS_COMPLETE){
|
||||||
|
|
||||||
MsgMetaReq* mmreq = dynamic_cast<GroupMetaReq*>(req);
|
MsgMetaReq* mmreq = dynamic_cast<MsgMetaReq*>(req);
|
||||||
|
|
||||||
if(mmreq)
|
if(mmreq)
|
||||||
{
|
{
|
||||||
@ -387,7 +387,7 @@ bool RsGxsDataAccess::getMsgList(const uint32_t& token, GxsMsgIdResult& msgIds)
|
|||||||
return false;
|
return false;
|
||||||
}else if(req->token == GXS_REQUEST_STATUS_COMPLETE){
|
}else if(req->token == GXS_REQUEST_STATUS_COMPLETE){
|
||||||
|
|
||||||
MsgIdReq* mireq = dynamic_cast<GroupMetaReq*>(req);
|
MsgIdReq* mireq = dynamic_cast<MsgIdReq*>(req);
|
||||||
|
|
||||||
if(mireq)
|
if(mireq)
|
||||||
{
|
{
|
||||||
@ -417,7 +417,7 @@ bool RsGxsDataAccess::getGroupList(const uint32_t& token, std::list<RsGxsGroupId
|
|||||||
return false;
|
return false;
|
||||||
}else if(req->token == GXS_REQUEST_STATUS_COMPLETE){
|
}else if(req->token == GXS_REQUEST_STATUS_COMPLETE){
|
||||||
|
|
||||||
GroupIdReq* gireq = dynamic_cast<GroupMetaReq*>(req);
|
GroupIdReq* gireq = dynamic_cast<GroupIdReq*>(req);
|
||||||
|
|
||||||
if(gireq)
|
if(gireq)
|
||||||
{
|
{
|
||||||
@ -444,7 +444,7 @@ GxsRequest* RsGxsDataAccess::retrieveRequest(const uint32_t& token)
|
|||||||
|
|
||||||
if(mRequests.find(token) == mRequests.end()) return NULL;
|
if(mRequests.find(token) == mRequests.end()) return NULL;
|
||||||
|
|
||||||
GxsRequest* req = mRequests;
|
GxsRequest* req = mRequests[token];
|
||||||
|
|
||||||
return req;
|
return req;
|
||||||
}
|
}
|
||||||
@ -692,19 +692,19 @@ bool RsGxsDataAccess::getMsgList(MsgIdReq* req)
|
|||||||
|
|
||||||
metaFilter[grpId] = std::map<RsGxsMessageId, RsGxsMsgMetaData*>();
|
metaFilter[grpId] = std::map<RsGxsMessageId, RsGxsMsgMetaData*>();
|
||||||
|
|
||||||
const std::vector<RsMsgMetaData*>& metaV = meta_it->second;
|
const std::vector<RsGxsMsgMetaData*>& metaV = meta_it->second;
|
||||||
if (onlyLatestMsgs) // THIS ONE IS HARD -> LOTS OF COMP.
|
if (onlyLatestMsgs) // THIS ONE IS HARD -> LOTS OF COMP.
|
||||||
{
|
{
|
||||||
std::vector<RsMsgMetaData*>::const_iterator vit = metaV.begin();
|
std::vector<RsGxsMsgMetaData*>::const_iterator vit = metaV.begin();
|
||||||
|
|
||||||
|
|
||||||
// RUN THROUGH ALL MSGS... in map origId -> TS.
|
// RUN THROUGH ALL MSGS... in map origId -> TS.
|
||||||
std::map<std::string, std::pair<std::string, time_t> > origMsgTs;
|
std::map<RsGxsGroupId, std::pair<RsGxsMessageId, time_t> > origMsgTs;
|
||||||
std::map<std::string, std::pair<std::string, time_t> >::iterator oit;
|
std::map<RsGxsGroupId, std::pair<RsGxsMessageId, time_t> >::iterator oit;
|
||||||
|
|
||||||
for(; vit != metaV.end(); vit++)
|
for(; vit != metaV.end(); vit++)
|
||||||
{
|
{
|
||||||
RsMsgMetaData* msgMeta = *vit;
|
RsGxsMsgMetaData* msgMeta = *vit;
|
||||||
|
|
||||||
/* if we are grabbing thread Head... then parentId == empty. */
|
/* if we are grabbing thread Head... then parentId == empty. */
|
||||||
if (onlyThreadHeadMsgs)
|
if (onlyThreadHeadMsgs)
|
||||||
@ -750,18 +750,18 @@ bool RsGxsDataAccess::getMsgList(MsgIdReq* req)
|
|||||||
// Add the discovered Latest Msgs.
|
// Add the discovered Latest Msgs.
|
||||||
for(oit = origMsgTs.begin(); oit != origMsgTs.end(); oit++)
|
for(oit = origMsgTs.begin(); oit != origMsgTs.end(); oit++)
|
||||||
{
|
{
|
||||||
req->mMsgIds.insert(std::make_pair(grpId, oit->second.first));
|
req->mMsgIds[grpId].push_back(oit->second.first);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else // ALL OTHER CASES.
|
else // ALL OTHER CASES.
|
||||||
{
|
{
|
||||||
std::vector<RsMsgMetaData*>::const_iterator vit = metaV.begin();
|
std::vector<RsGxsMsgMetaData*>::const_iterator vit = metaV.begin();
|
||||||
|
|
||||||
for(; vit != metaV.end(); vit++)
|
for(; vit != metaV.end(); vit++)
|
||||||
{
|
{
|
||||||
RsMsgMetaData* msgMeta = *vit;
|
RsGxsMsgMetaData* msgMeta = *vit;
|
||||||
bool add = false;
|
bool add = false;
|
||||||
|
|
||||||
/* if we are grabbing thread Head... then parentId == empty. */
|
/* if we are grabbing thread Head... then parentId == empty. */
|
||||||
@ -788,7 +788,7 @@ bool RsGxsDataAccess::getMsgList(MsgIdReq* req)
|
|||||||
|
|
||||||
if (add)
|
if (add)
|
||||||
{
|
{
|
||||||
req->mMsgIdResult.insert(grpId,msgMeta->mMsgId);
|
req->mMsgIdResult[grpId].push_back(msgMeta->mMsgId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -815,7 +815,7 @@ void RsGxsDataAccess::filterMsgList(GxsMsgIdResult& msgIds, const RsTokReqOption
|
|||||||
std::vector<RsGxsMessageId>& msgs = mit->second;
|
std::vector<RsGxsMessageId>& msgs = mit->second;
|
||||||
std::vector<RsGxsMessageId>::iterator vit = msgs.begin();
|
std::vector<RsGxsMessageId>::iterator vit = msgs.begin();
|
||||||
const std::map<RsGxsMessageId, RsGxsMsgMetaData*>& meta = cit->second;
|
const std::map<RsGxsMessageId, RsGxsMsgMetaData*>& meta = cit->second;
|
||||||
const std::map<RsGxsMessageId, RsGxsMsgMetaData*>::const_iterator cit2;
|
std::map<RsGxsMessageId, RsGxsMsgMetaData*>::const_iterator cit2;
|
||||||
|
|
||||||
for(; vit != msgs.end();)
|
for(; vit != msgs.end();)
|
||||||
{
|
{
|
||||||
|
@ -31,9 +31,9 @@
|
|||||||
#include "rsgds.h"
|
#include "rsgds.h"
|
||||||
|
|
||||||
|
|
||||||
typedef std::map< RsGxsGroupId, std::map<RsGxsMessageId, RsGxsMsgMetaData> > MsgMetaFilter;
|
typedef std::map< RsGxsGroupId, std::map<RsGxsMessageId, RsGxsMsgMetaData*> > MsgMetaFilter;
|
||||||
|
|
||||||
class RsGxsDataAccess : public RsTokenService
|
class RsGxsDataAccess : public RsTokenServiceV2
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RsGxsDataAccess(RsGeneralDataService* ds);
|
RsGxsDataAccess(RsGeneralDataService* ds);
|
||||||
|
@ -13,6 +13,9 @@ class GxsRequest
|
|||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
virtual ~GxsRequest() { return; }
|
||||||
uint32_t token;
|
uint32_t token;
|
||||||
uint32_t reqTime;
|
uint32_t reqTime;
|
||||||
|
|
||||||
@ -69,7 +72,6 @@ class MsgDataReq : public GxsRequest
|
|||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
GxsMsgReq mMsgIds;
|
GxsMsgReq mMsgIds;
|
||||||
NxsMsgDataResult mMsgData;
|
NxsMsgDataResult mMsgData;
|
||||||
};
|
};
|
||||||
|
@ -31,11 +31,7 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#include "serialiser/rsgxsitems.h"
|
#include "serialiser/rsgxsitems.h"
|
||||||
|
#include "gxs/rsgxs.h"
|
||||||
typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgReq;
|
|
||||||
typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgIdResult;
|
|
||||||
typedef std::map<RsGxsGroupId, std::vector<RsGxsMsgMetaData*> > GxsMsgMetaResult;
|
|
||||||
typedef std::map<RsGxsGroupId, std::vector<RsNxsMsg*> > NxsMsgDataResult;
|
|
||||||
|
|
||||||
#define GXS_REQUEST_TYPE_GROUP_DATA 0x00010000
|
#define GXS_REQUEST_TYPE_GROUP_DATA 0x00010000
|
||||||
#define GXS_REQUEST_TYPE_GROUP_META 0x00020000
|
#define GXS_REQUEST_TYPE_GROUP_META 0x00020000
|
||||||
@ -79,7 +75,7 @@ time_t mAfter;
|
|||||||
* A proxy class for requesting generic service data for GXS
|
* A proxy class for requesting generic service data for GXS
|
||||||
* This seperates the request mechanism from the actual retrieval of data
|
* This seperates the request mechanism from the actual retrieval of data
|
||||||
*/
|
*/
|
||||||
class RsTokenService
|
class RsTokenServiceV2
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -93,8 +89,8 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
RsTokenService() { return; }
|
RsTokenServiceV2() { return; }
|
||||||
virtual ~RsTokenService() { return; }
|
virtual ~RsTokenServiceV2() { return; }
|
||||||
|
|
||||||
/* Data Requests */
|
/* Data Requests */
|
||||||
|
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
* enumerating all possible changes
|
* enumerating all possible changes
|
||||||
* at the interface
|
* at the interface
|
||||||
*/
|
*/
|
||||||
class RsGxsChange
|
class RsGxsNotify
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RsGxsChange(){ return; }
|
RsGxsNotify(){ return; }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ public:
|
|||||||
* Relevant to group changes
|
* Relevant to group changes
|
||||||
* TODO: extent to indicate whether a meta change or actual data
|
* TODO: extent to indicate whether a meta change or actual data
|
||||||
*/
|
*/
|
||||||
class RsGxsGroupChange : RsGxsChange
|
class RsGxsGroupChange : public RsGxsNotify
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::list<RsGxsGroupId> grpIdList;
|
std::list<RsGxsGroupId> grpIdList;
|
||||||
@ -34,7 +34,7 @@ public:
|
|||||||
* Relevant to message changes
|
* Relevant to message changes
|
||||||
* TODO: extent to indicate whether a meta change or actual data
|
* TODO: extent to indicate whether a meta change or actual data
|
||||||
*/
|
*/
|
||||||
class RsGxsMsgChange : RsGxsChange
|
class RsGxsMsgChange : public RsGxsNotify
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > msgChangeMap;
|
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > msgChangeMap;
|
||||||
|
@ -182,7 +182,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @param grpIds
|
* @param grpIds
|
||||||
*/
|
*/
|
||||||
virtual void groupsChanged(std::list<RsGroupId>& grpIds) = 0;
|
virtual void groupsChanged(std::list<RsGxsGroupId>& grpIds) = 0;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
*
|
*
|
||||||
@ -195,7 +195,7 @@ public:
|
|||||||
* needed to make requests to the service
|
* needed to make requests to the service
|
||||||
* @return handle to token service for this gxs service
|
* @return handle to token service for this gxs service
|
||||||
*/
|
*/
|
||||||
virtual RsTokenService* getTokenService() = 0;
|
virtual RsTokenServiceV2* getTokenService() = 0;
|
||||||
|
|
||||||
/* Generic Lists */
|
/* Generic Lists */
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ public:
|
|||||||
* @return false if request token is invalid, check token status for error report
|
* @return false if request token is invalid, check token status for error report
|
||||||
*/
|
*/
|
||||||
virtual bool getGroupList(const uint32_t &token,
|
virtual bool getGroupList(const uint32_t &token,
|
||||||
std::list<RsGroupId> &groupIds) = 0;
|
std::list<RsGxsGroupId> &groupIds) = 0;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @param token token to be redeemed for this request
|
* @param token token to be redeemed for this request
|
||||||
|
@ -53,18 +53,6 @@ class RsGroupMetaData
|
|||||||
}
|
}
|
||||||
|
|
||||||
void operator =(const RsGxsGrpMetaData& rGxsMeta);
|
void operator =(const RsGxsGrpMetaData& rGxsMeta);
|
||||||
// {
|
|
||||||
// this->mAuthorId = rGxsMeta.mAuthorId;
|
|
||||||
// this->mGroupFlags = rGxsMeta.mGroupFlags;
|
|
||||||
// this->mGroupId = rGxsMeta.mGroupId;
|
|
||||||
// this->mGroupStatus = rGxsMeta.mGroupStatus;
|
|
||||||
// this->mLastPost = rGxsMeta.mLastPost;
|
|
||||||
// this->mMsgCount = rGxsMeta.mMsgCount;
|
|
||||||
// this->mPop = rGxsMeta.mPop;
|
|
||||||
// this->mPublishTs = rGxsMeta.mPublishTs;
|
|
||||||
// this->mSubscribeFlags = rGxsMeta.mSubscribeFlags;
|
|
||||||
// this->mGroupName = rGxsMeta.mGroupName;
|
|
||||||
// }
|
|
||||||
|
|
||||||
std::string mGroupId;
|
std::string mGroupId;
|
||||||
std::string mGroupName;
|
std::string mGroupName;
|
||||||
|
@ -55,6 +55,8 @@ public:
|
|||||||
|
|
||||||
class RsGxsPhotoSerialiser : public RsSerialType
|
class RsGxsPhotoSerialiser : public RsSerialType
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
RsGxsPhotoSerialiser()
|
RsGxsPhotoSerialiser()
|
||||||
:RsSerialType(RS_PKT_VERSION_SERVICE, RS_SERVICE_TYPE_PHOTO)
|
:RsSerialType(RS_PKT_VERSION_SERVICE, RS_SERVICE_TYPE_PHOTO)
|
||||||
{ return; }
|
{ return; }
|
||||||
|
@ -24,7 +24,7 @@ void p3PhotoServiceV2::msgsChanged(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RsTokenService* p3PhotoServiceV2::getTokenService() {
|
RsTokenServiceV2* p3PhotoServiceV2::getTokenService() {
|
||||||
|
|
||||||
return RsGenExchange::getTokenService();
|
return RsGenExchange::getTokenService();
|
||||||
}
|
}
|
||||||
@ -70,8 +70,9 @@ bool p3PhotoServiceV2::getAlbum(const uint32_t& token, std::vector<RsPhotoAlbum>
|
|||||||
|
|
||||||
for(; vit != grpData.end(); vit++)
|
for(; vit != grpData.end(); vit++)
|
||||||
{
|
{
|
||||||
RsGxsGrpItem* item = *vit;
|
RsGxsPhotoAlbumItem* item = dynamic_cast<RsGxsPhotoAlbumItem*>(*vit);
|
||||||
RsPhotoAlbum album = *item;
|
RsPhotoAlbum album = item->album;
|
||||||
|
delete item;
|
||||||
albums.push_back(album);
|
albums.push_back(album);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,7 +81,7 @@ bool p3PhotoServiceV2::getAlbum(const uint32_t& token, std::vector<RsPhotoAlbum>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool p3PhotoServiceV2::getPhoto(const uint32_t& token, PhotoResult& photo)
|
bool p3PhotoServiceV2::getPhoto(const uint32_t& token, PhotoResult& photos)
|
||||||
{
|
{
|
||||||
GxsMsgDataMap msgData;
|
GxsMsgDataMap msgData;
|
||||||
bool ok = RsGenExchange::getMsgData(token, msgData);
|
bool ok = RsGenExchange::getMsgData(token, msgData);
|
||||||
@ -101,8 +102,8 @@ bool p3PhotoServiceV2::getPhoto(const uint32_t& token, PhotoResult& photo)
|
|||||||
|
|
||||||
if(item)
|
if(item)
|
||||||
{
|
{
|
||||||
RsPhotoPhoto photo = *item;
|
RsPhotoPhoto photo = item->photo;
|
||||||
photo[grpId] = photo;
|
photos[grpId].push_back(photo);
|
||||||
delete item;
|
delete item;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
@ -121,20 +122,8 @@ bool p3PhotoServiceV2::submitAlbumDetails(RsPhotoAlbum& album)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void p3PhotoServiceV2::operator =(RsPhoto& lPhotos,
|
|
||||||
const RsGxsPhotoPhotoItem& rPhoto)
|
|
||||||
{
|
|
||||||
lPhotos = rPhoto.photo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void p3PhotoServiceV2::operator =(RsPhotoAlbum& lAlbum,
|
|
||||||
const RsGxsPhotoAlbumItem& rAlbum)
|
|
||||||
{
|
|
||||||
lAlbum = rAlbum.album;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool p3PhotoServiceV2::submitPhoto(RsPhotoPhoto& photo)
|
bool p3PhotoServiceV2::submitPhoto(RsPhotoPhoto& photo)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -53,7 +53,7 @@ public:
|
|||||||
void msgsChanged(std::map<std::string,
|
void msgsChanged(std::map<std::string,
|
||||||
std::vector<std::string> >& msgs);
|
std::vector<std::string> >& msgs);
|
||||||
|
|
||||||
RsTokenService* getTokenService();
|
RsTokenServiceV2* getTokenService();
|
||||||
|
|
||||||
bool getGroupList(const uint32_t &token,
|
bool getGroupList(const uint32_t &token,
|
||||||
std::list<std::string> &groupIds);
|
std::list<std::string> &groupIds);
|
||||||
@ -71,11 +71,6 @@ public:
|
|||||||
bool getAlbum(const uint32_t &token, std::vector<RsPhotoAlbum> &albums);
|
bool getAlbum(const uint32_t &token, std::vector<RsPhotoAlbum> &albums);
|
||||||
bool getPhoto(const uint32_t &token, PhotoResult &photos);
|
bool getPhoto(const uint32_t &token, PhotoResult &photos);
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
void operator=(RsPhoto& lPhotos, const RsGxsPhotoPhotoItem& rPhoto);
|
|
||||||
void operator=(RsPhotoAlbum& lAlbum, const RsGxsPhotoAlbumItem& rAlbum);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/** Modifications **/
|
/** Modifications **/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user