mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 00:49:28 -05:00
Safer rsGxsChannel API
Protect data members with mutexes Print messages when errors happens
This commit is contained in:
parent
5e6e9e03e5
commit
8fd22c8fd1
@ -36,20 +36,17 @@ bool GxsTokenQueue::queueRequest(uint32_t token, uint32_t req_type)
|
|||||||
void GxsTokenQueue::checkRequests()
|
void GxsTokenQueue::checkRequests()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
RsStackMutex stack(mQueueMtx); /********** STACK LOCKED MTX ******/
|
RS_STACK_MUTEX(mQueueMtx);
|
||||||
if (mQueue.empty())
|
if (mQueue.empty()) return;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Must check all, and move to a different list - for reentrant / good mutex behaviour.
|
// Must check all, and move to a different list - for reentrant / good mutex behaviour.
|
||||||
std::list<GxsTokenQueueItem> toload;
|
std::list<GxsTokenQueueItem> toload;
|
||||||
std::list<GxsTokenQueueItem>::iterator it;
|
std::list<GxsTokenQueueItem>::iterator it;
|
||||||
|
|
||||||
bool stuffToLoad = false;
|
bool stuffToLoad = false;
|
||||||
|
|
||||||
{
|
{
|
||||||
RsStackMutex stack(mQueueMtx); /********** STACK LOCKED MTX ******/
|
RS_STACK_MUTEX(mQueueMtx);
|
||||||
for(it = mQueue.begin(); it != mQueue.end();)
|
for(it = mQueue.begin(); it != mQueue.end();)
|
||||||
{
|
{
|
||||||
uint32_t token = it->mToken;
|
uint32_t token = it->mToken;
|
||||||
@ -62,29 +59,29 @@ void GxsTokenQueue::checkRequests()
|
|||||||
stuffToLoad = true;
|
stuffToLoad = true;
|
||||||
|
|
||||||
#ifdef GXS_DEBUG
|
#ifdef GXS_DEBUG
|
||||||
std::cerr << "GxsTokenQueue::checkRequests() token: " << token << " Complete";
|
std::cerr << "GxsTokenQueue::checkRequests() token: " << token
|
||||||
std::cerr << std::endl;
|
<< " Complete" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
else if (status == RsTokenService::FAILED)
|
else if (status == RsTokenService::FAILED)
|
||||||
{
|
{
|
||||||
// maybe we should do alternative callback?
|
// maybe we should do alternative callback?
|
||||||
std::cerr << "GxsTokenQueue::checkRequests() ERROR Request Failed: " << token;
|
std::cerr << __PRETTY_FUNCTION__ << " ERROR Request Failed! "
|
||||||
std::cerr << std::endl;
|
<< " token: " << token << std::endl;
|
||||||
|
|
||||||
it = mQueue.erase(it);
|
it = mQueue.erase(it);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef GXS_DEBUG
|
#ifdef GXS_DEBUG
|
||||||
std::cerr << "GxsTokenQueue::checkRequests() token: " << token << " is unfinished, status: " << status;
|
std::cerr << "GxsTokenQueue::checkRequests() token: " << token
|
||||||
std::cerr << std::endl;
|
<< " is unfinished, status: " << status << std::endl;
|
||||||
#endif
|
#endif
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // RS_STACK_MUTEX(mQueueMtx) END
|
||||||
|
|
||||||
if (stuffToLoad)
|
if (stuffToLoad)
|
||||||
{
|
{
|
||||||
@ -95,11 +92,3 @@ void GxsTokenQueue::checkRequests()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This must be overloaded to complete the functionality.
|
|
||||||
void GxsTokenQueue::handleResponse(uint32_t token, uint32_t req_type)
|
|
||||||
{
|
|
||||||
std::cerr << "GxsTokenQueue::handleResponse(" << token << "," << req_type << ") ERROR: NOT HANDLED";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
/// This must be overloaded to complete the functionality.
|
/// This must be overloaded to complete the functionality.
|
||||||
virtual void handleResponse(uint32_t token, uint32_t req_type);
|
virtual void handleResponse(uint32_t token, uint32_t req_type) = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RsGenExchange *mGenExchange;
|
RsGenExchange *mGenExchange;
|
||||||
|
@ -1925,7 +1925,7 @@ void RsGenExchange::setGroupStatusFlags(uint32_t& token, const RsGxsGroupId& grp
|
|||||||
|
|
||||||
void RsGenExchange::setGroupServiceString(uint32_t& token, const RsGxsGroupId& grpId, const std::string& servString)
|
void RsGenExchange::setGroupServiceString(uint32_t& token, const RsGxsGroupId& grpId, const std::string& servString)
|
||||||
{
|
{
|
||||||
RS_STACK_MUTEX(mGenMtx) ;
|
RS_STACK_MUTEX(mGenMtx);
|
||||||
token = mDataAccess->generatePublicToken();
|
token = mDataAccess->generatePublicToken();
|
||||||
|
|
||||||
GrpLocMetaData g;
|
GrpLocMetaData g;
|
||||||
|
@ -39,14 +39,16 @@ RsGxsDataAccess::~RsGxsDataAccess()
|
|||||||
for(std::map<uint32_t, GxsRequest*>::const_iterator it(mRequests.begin());it!=mRequests.end();++it)
|
for(std::map<uint32_t, GxsRequest*>::const_iterator it(mRequests.begin());it!=mRequests.end();++it)
|
||||||
delete it->second ;
|
delete it->second ;
|
||||||
}
|
}
|
||||||
bool RsGxsDataAccess::requestGroupInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts,
|
bool RsGxsDataAccess::requestGroupInfo(
|
||||||
const std::list<RsGxsGroupId> &groupIds)
|
uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts,
|
||||||
|
const std::list<RsGxsGroupId> &groupIds )
|
||||||
{
|
{
|
||||||
if(groupIds.empty())
|
if(groupIds.empty())
|
||||||
{
|
{
|
||||||
std::cerr << "(WW) Group Id list is empty" << std::endl;
|
std::cerr << __PRETTY_FUNCTION__ << " (WW) Group Id list is empty!"
|
||||||
return false;
|
<< std::endl;
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
GxsRequest* req = NULL;
|
GxsRequest* req = NULL;
|
||||||
uint32_t reqType = opts.mReqType;
|
uint32_t reqType = opts.mReqType;
|
||||||
@ -76,19 +78,19 @@ bool RsGxsDataAccess::requestGroupInfo(uint32_t &token, uint32_t ansType, const
|
|||||||
req = gir;
|
req = gir;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(req == NULL)
|
if(!req)
|
||||||
{
|
{
|
||||||
std::cerr << "RsGxsDataAccess::requestGroupInfo() request type not recognised, type "
|
std::cerr << __PRETTY_FUNCTION__ << " request type not recognised, "
|
||||||
<< reqType << std::endl;
|
<< "reqType: " << reqType << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}else
|
}
|
||||||
{
|
|
||||||
generateToken(token);
|
generateToken(token);
|
||||||
|
|
||||||
#ifdef DATA_DEBUG
|
#ifdef DATA_DEBUG
|
||||||
std::cerr << "RsGxsDataAccess::requestGroupInfo() gets Token: " << token << std::endl;
|
std::cerr << "RsGxsDataAccess::requestGroupInfo() gets token: " << token
|
||||||
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
setReq(req, token, ansType, opts);
|
setReq(req, token, ansType, opts);
|
||||||
storeRequest(req);
|
storeRequest(req);
|
||||||
@ -130,11 +132,8 @@ bool RsGxsDataAccess::requestGroupInfo(uint32_t &token, uint32_t ansType, const
|
|||||||
|
|
||||||
void RsGxsDataAccess::generateToken(uint32_t &token)
|
void RsGxsDataAccess::generateToken(uint32_t &token)
|
||||||
{
|
{
|
||||||
RsStackMutex stack(mDataMutex); /****** LOCKED *****/
|
RS_STACK_MUTEX(mDataMutex);
|
||||||
|
|
||||||
token = mNextToken++;
|
token = mNextToken++;
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -153,6 +153,16 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual bool createPost(RsGxsChannelPost& post) = 0;
|
virtual bool createPost(RsGxsChannelPost& post) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Subscrbe to a channel. Blocking API
|
||||||
|
* @jsonapi{development}
|
||||||
|
* @param[in] channelId Channel id
|
||||||
|
* @param[in] subscribe true to subscribe, false to unsubscribe
|
||||||
|
* @return false on error, true otherwise
|
||||||
|
*/
|
||||||
|
virtual bool subscribeToChannel( const RsGxsGroupId &channelId,
|
||||||
|
bool subscribe ) = 0;
|
||||||
|
|
||||||
|
|
||||||
/* Specific Service Data
|
/* Specific Service Data
|
||||||
* TODO: change the orrible const uint32_t &token to uint32_t token
|
* TODO: change the orrible const uint32_t &token to uint32_t token
|
||||||
@ -174,24 +184,24 @@ public:
|
|||||||
uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0;
|
uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable or disable auto-download for given channel
|
* @brief Enable or disable auto-download for given channel. Blocking API
|
||||||
* @jsonapi{development}
|
* @jsonapi{development}
|
||||||
* @param[in] groupId channel id
|
* @param[in] channelId channel id
|
||||||
* @param[in] enable true to enable, false to disable
|
* @param[in] enable true to enable, false to disable
|
||||||
* @return false if something failed, true otherwhise
|
* @return false if something failed, true otherwhise
|
||||||
*/
|
*/
|
||||||
virtual bool setChannelAutoDownload(
|
virtual bool setChannelAutoDownload(
|
||||||
const RsGxsGroupId &groupId, bool enable) = 0;
|
const RsGxsGroupId& channelId, bool enable) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get auto-download option value for given channel
|
* @brief Get auto-download option value for given channel
|
||||||
* @jsonapi{development}
|
* @jsonapi{development}
|
||||||
* @param[in] groupId channel id
|
* @param[in] channelId channel id
|
||||||
* @param[in] enabled storage for the auto-download option value
|
* @param[out] enabled storage for the auto-download option value
|
||||||
* @return false if something failed, true otherwhise
|
* @return false if something failed, true otherwhise
|
||||||
*/
|
*/
|
||||||
virtual bool getChannelAutoDownload(
|
virtual bool getChannelAutoDownload(
|
||||||
const RsGxsGroupId &groupId, bool& enabled) = 0;
|
const RsGxsGroupId& channelId, bool& enabled) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set download directory for the given channel
|
* @brief Set download directory for the given channel
|
||||||
@ -228,7 +238,6 @@ public:
|
|||||||
* @brief Request subscription to a group.
|
* @brief Request subscription to a group.
|
||||||
* The action is performed asyncronously, so it could fail in a subsequent
|
* The action is performed asyncronously, so it could fail in a subsequent
|
||||||
* phase even after returning true.
|
* phase even after returning true.
|
||||||
* @jsonapi{development}
|
|
||||||
* @param[out] token Storage for RsTokenService token to track request
|
* @param[out] token Storage for RsTokenService token to track request
|
||||||
* status.
|
* status.
|
||||||
* @param[in] groupId Channel id
|
* @param[in] groupId Channel id
|
||||||
|
@ -76,6 +76,8 @@ p3GxsChannels::p3GxsChannels(
|
|||||||
RsGenExchange( gds, nes, new RsGxsChannelSerialiser(),
|
RsGenExchange( gds, nes, new RsGxsChannelSerialiser(),
|
||||||
RS_SERVICE_GXS_TYPE_CHANNELS, gixs, channelsAuthenPolicy() ),
|
RS_SERVICE_GXS_TYPE_CHANNELS, gixs, channelsAuthenPolicy() ),
|
||||||
RsGxsChannels(static_cast<RsGxsIface&>(*this)), GxsTokenQueue(this),
|
RsGxsChannels(static_cast<RsGxsIface&>(*this)), GxsTokenQueue(this),
|
||||||
|
mSubscribedGroupsMutex("GXS channels subscribed groups cache"),
|
||||||
|
mKnownChannelsMutex("GXS channels known channels timestamp cache"),
|
||||||
mSearchCallbacksMapMutex("GXS channels search")
|
mSearchCallbacksMapMutex("GXS channels search")
|
||||||
{
|
{
|
||||||
// For Dummy Msgs.
|
// For Dummy Msgs.
|
||||||
@ -174,7 +176,10 @@ bool p3GxsChannels::saveList(bool &cleanup, std::list<RsItem *>&saveList)
|
|||||||
|
|
||||||
RsGxsForumNotifyRecordsItem *item = new RsGxsForumNotifyRecordsItem ;
|
RsGxsForumNotifyRecordsItem *item = new RsGxsForumNotifyRecordsItem ;
|
||||||
|
|
||||||
item->records = mKnownChannels ;
|
{
|
||||||
|
RS_STACK_MUTEX(mKnownChannelsMutex);
|
||||||
|
item->records = mKnownChannels;
|
||||||
|
}
|
||||||
|
|
||||||
saveList.push_back(item) ;
|
saveList.push_back(item) ;
|
||||||
return true;
|
return true;
|
||||||
@ -191,8 +196,9 @@ bool p3GxsChannels::loadList(std::list<RsItem *>& loadList)
|
|||||||
|
|
||||||
RsGxsForumNotifyRecordsItem *fnr = dynamic_cast<RsGxsForumNotifyRecordsItem*>(item) ;
|
RsGxsForumNotifyRecordsItem *fnr = dynamic_cast<RsGxsForumNotifyRecordsItem*>(item) ;
|
||||||
|
|
||||||
if(fnr != NULL)
|
if(fnr)
|
||||||
{
|
{
|
||||||
|
RS_STACK_MUTEX(mKnownChannelsMutex);
|
||||||
mKnownChannels.clear();
|
mKnownChannels.clear();
|
||||||
|
|
||||||
for(auto it(fnr->records.begin());it!=fnr->records.end();++it)
|
for(auto it(fnr->records.begin());it!=fnr->records.end();++it)
|
||||||
@ -228,7 +234,7 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||||||
std::cerr << "p3GxsChannels::notifyChanges() : " << changes.size() << "changes to notify" << std::endl;
|
std::cerr << "p3GxsChannels::notifyChanges() : " << changes.size() << "changes to notify" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
p3Notify *notify = NULL;
|
p3Notify* notify = nullptr;
|
||||||
if (!changes.empty())
|
if (!changes.empty())
|
||||||
{
|
{
|
||||||
notify = RsServer::notify();
|
notify = RsServer::notify();
|
||||||
@ -271,9 +277,8 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||||||
std::cerr << "p3GxsChannels::notifyChanges() Msgs for Group: " << mit->first;
|
std::cerr << "p3GxsChannels::notifyChanges() Msgs for Group: " << mit->first;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
bool enabled = false ;
|
bool enabled = false;
|
||||||
|
if (autoDownloadEnabled(mit->first, enabled) && enabled)
|
||||||
if (autoDownloadEnabled(mit->first, enabled) && enabled)
|
|
||||||
{
|
{
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
#ifdef GXSCHANNELS_DEBUG
|
||||||
std::cerr << "p3GxsChannels::notifyChanges() AutoDownload for Group: " << mit->first;
|
std::cerr << "p3GxsChannels::notifyChanges() AutoDownload for Group: " << mit->first;
|
||||||
@ -306,6 +311,7 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||||||
/* group received */
|
/* group received */
|
||||||
std::list<RsGxsGroupId> &grpList = grpChange->mGrpIdList;
|
std::list<RsGxsGroupId> &grpList = grpChange->mGrpIdList;
|
||||||
std::list<RsGxsGroupId>::iterator git;
|
std::list<RsGxsGroupId>::iterator git;
|
||||||
|
RS_STACK_MUTEX(mKnownChannelsMutex);
|
||||||
for (git = grpList.begin(); git != grpList.end(); ++git)
|
for (git = grpList.begin(); git != grpList.end(); ++git)
|
||||||
{
|
{
|
||||||
if(mKnownChannels.find(*git) == mKnownChannels.end())
|
if(mKnownChannels.find(*git) == mKnownChannels.end())
|
||||||
@ -338,15 +344,15 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||||||
/* shouldn't need to worry about groups - as they need to be subscribed to */
|
/* shouldn't need to worry about groups - as they need to be subscribed to */
|
||||||
}
|
}
|
||||||
|
|
||||||
request_SpecificSubscribedGroups(unprocessedGroups);
|
if(!unprocessedGroups.empty())
|
||||||
|
request_SpecificSubscribedGroups(unprocessedGroups);
|
||||||
|
|
||||||
RsGxsIfaceHelper::receiveChanges(changes);
|
RsGxsIfaceHelper::receiveChanges(changes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void p3GxsChannels::service_tick()
|
void p3GxsChannels::service_tick()
|
||||||
{
|
{
|
||||||
|
static rstime_t last_dummy_tick = 0;
|
||||||
static rstime_t last_dummy_tick = 0;
|
|
||||||
|
|
||||||
if (time(NULL) > last_dummy_tick + 5)
|
if (time(NULL) > last_dummy_tick + 5)
|
||||||
{
|
{
|
||||||
@ -414,75 +420,84 @@ bool p3GxsChannels::groupShareKeys(
|
|||||||
* at the moment - fix it up later
|
* at the moment - fix it up later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool p3GxsChannels::getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &msgs, std::vector<RsGxsComment> &cmts)
|
bool p3GxsChannels::getPostData(
|
||||||
|
const uint32_t &token, std::vector<RsGxsChannelPost> &msgs,
|
||||||
|
std::vector<RsGxsComment> &cmts )
|
||||||
{
|
{
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
#ifdef GXSCHANNELS_DEBUG
|
||||||
std::cerr << "p3GxsChannels::getPostData()";
|
std::cerr << __PRETTY_FUNCTION__ << std::cerr << std::endl;
|
||||||
std::cerr << std::endl;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GxsMsgDataMap msgData;
|
GxsMsgDataMap msgData;
|
||||||
bool ok = RsGenExchange::getMsgData(token, msgData);
|
if(!RsGenExchange::getMsgData(token, msgData))
|
||||||
|
|
||||||
if(ok)
|
|
||||||
{
|
{
|
||||||
GxsMsgDataMap::iterator mit = msgData.begin();
|
std::cerr << __PRETTY_FUNCTION__ <<" ERROR in request" << std::endl;
|
||||||
|
return false;
|
||||||
for(; mit != msgData.end(); ++mit)
|
}
|
||||||
|
|
||||||
|
GxsMsgDataMap::iterator mit = msgData.begin();
|
||||||
|
|
||||||
|
for(; mit != msgData.end(); ++mit)
|
||||||
|
{
|
||||||
|
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||||
|
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||||
|
|
||||||
|
for(; vit != msgItems.end(); ++vit)
|
||||||
{
|
{
|
||||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
RsGxsChannelPostItem* postItem =
|
||||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
dynamic_cast<RsGxsChannelPostItem*>(*vit);
|
||||||
|
|
||||||
for(; vit != msgItems.end(); ++vit)
|
if(postItem)
|
||||||
{
|
{
|
||||||
RsGxsChannelPostItem* postItem = dynamic_cast<RsGxsChannelPostItem*>(*vit);
|
RsGxsChannelPost msg;
|
||||||
|
postItem->toChannelPost(msg, true);
|
||||||
if(postItem)
|
msgs.push_back(msg);
|
||||||
|
delete postItem;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RsGxsCommentItem* cmtItem =
|
||||||
|
dynamic_cast<RsGxsCommentItem*>(*vit);
|
||||||
|
if(cmtItem)
|
||||||
{
|
{
|
||||||
RsGxsChannelPost msg;
|
RsGxsComment cmt;
|
||||||
postItem->toChannelPost(msg, true);
|
RsGxsMsgItem *mi = (*vit);
|
||||||
msgs.push_back(msg);
|
cmt = cmtItem->mMsg;
|
||||||
delete postItem;
|
cmt.mMeta = mi->meta;
|
||||||
|
#ifdef GXSCOMMENT_DEBUG
|
||||||
|
std::cerr << "p3GxsChannels::getPostData Found Comment:" << std::endl;
|
||||||
|
cmt.print(std::cerr," ", "cmt");
|
||||||
|
#endif
|
||||||
|
cmts.push_back(cmt);
|
||||||
|
delete cmtItem;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RsGxsCommentItem* cmtItem = dynamic_cast<RsGxsCommentItem*>(*vit);
|
RsGxsMsgItem* msg = (*vit);
|
||||||
if(cmtItem)
|
//const uint16_t RS_SERVICE_GXS_TYPE_CHANNELS = 0x0217;
|
||||||
{
|
//const uint8_t RS_PKT_SUBTYPE_GXSCHANNEL_POST_ITEM = 0x03;
|
||||||
RsGxsComment cmt;
|
//const uint8_t RS_PKT_SUBTYPE_GXSCOMMENT_COMMENT_ITEM = 0xf1;
|
||||||
RsGxsMsgItem *mi = (*vit);
|
std::cerr << __PRETTY_FUNCTION__
|
||||||
cmt = cmtItem->mMsg;
|
<< " Not a GxsChannelPostItem neither a "
|
||||||
cmt.mMeta = mi->meta;
|
<< "RsGxsCommentItem PacketService=" << std::hex
|
||||||
#ifdef GXSCOMMENT_DEBUG
|
<< (int)msg->PacketService() << std::dec
|
||||||
std::cerr << "p3GxsChannels::getPostData Found Comment:" << std::endl;
|
<< " PacketSubType=" << std::hex
|
||||||
cmt.print(std::cerr," ", "cmt");
|
<< (int)msg->PacketSubType() << std::dec
|
||||||
#endif
|
<< " , deleting!" << std::endl;
|
||||||
cmts.push_back(cmt);
|
delete *vit;
|
||||||
delete cmtItem;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
RsGxsMsgItem* msg = (*vit);
|
|
||||||
//const uint16_t RS_SERVICE_GXS_TYPE_CHANNELS = 0x0217;
|
|
||||||
//const uint8_t RS_PKT_SUBTYPE_GXSCHANNEL_POST_ITEM = 0x03;
|
|
||||||
//const uint8_t RS_PKT_SUBTYPE_GXSCOMMENT_COMMENT_ITEM = 0xf1;
|
|
||||||
std::cerr << "Not a GxsChannelPostItem neither a RsGxsCommentItem"
|
|
||||||
<< " PacketService=" << std::hex << (int)msg->PacketService() << std::dec
|
|
||||||
<< " PacketSubType=" << std::hex << (int)msg->PacketSubType() << std::dec
|
|
||||||
<< " , deleting!" << std::endl;
|
|
||||||
delete *vit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
std::cerr << "p3GxsChannels::getPostData() ERROR in request";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ok;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool p3GxsChannels::getPostData(
|
||||||
|
const uint32_t& token, std::vector<RsGxsChannelPost>& posts )
|
||||||
|
{
|
||||||
|
std::vector<RsGxsComment> cmts;
|
||||||
|
return getPostData(token, posts, cmts);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Not currently used
|
//Not currently used
|
||||||
@ -548,21 +563,6 @@ bool p3GxsChannels::getPostData(const uint32_t &token, std::vector<RsGxsChannelP
|
|||||||
/********************************************************************************************/
|
/********************************************************************************************/
|
||||||
/********************************************************************************************/
|
/********************************************************************************************/
|
||||||
|
|
||||||
#if 0
|
|
||||||
bool p3GxsChannels::setChannelAutoDownload(uint32_t &token, const RsGxsGroupId &groupId, bool autoDownload)
|
|
||||||
{
|
|
||||||
std::cerr << "p3GxsChannels::setChannelAutoDownload()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
// we don't actually use the token at this point....
|
|
||||||
//bool p3GxsChannels::setAutoDownload(const RsGxsGroupId &groupId, bool enabled)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool p3GxsChannels::setChannelAutoDownload(const RsGxsGroupId &groupId, bool enabled)
|
bool p3GxsChannels::setChannelAutoDownload(const RsGxsGroupId &groupId, bool enabled)
|
||||||
{
|
{
|
||||||
return setAutoDownload(groupId, enabled);
|
return setAutoDownload(groupId, enabled);
|
||||||
@ -580,8 +580,9 @@ bool p3GxsChannels::setChannelDownloadDirectory(const RsGxsGroupId &groupId, con
|
|||||||
std::cerr << "p3GxsChannels::setDownloadDirectory() id: " << groupId << " to: " << directory << std::endl;
|
std::cerr << "p3GxsChannels::setDownloadDirectory() id: " << groupId << " to: " << directory << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::map<RsGxsGroupId, RsGroupMetaData>::iterator it;
|
RS_STACK_MUTEX(mSubscribedGroupsMutex);
|
||||||
|
|
||||||
|
std::map<RsGxsGroupId, RsGroupMetaData>::iterator it;
|
||||||
it = mSubscribedGroups.find(groupId);
|
it = mSubscribedGroups.find(groupId);
|
||||||
if (it == mSubscribedGroups.end())
|
if (it == mSubscribedGroups.end())
|
||||||
{
|
{
|
||||||
@ -626,6 +627,8 @@ bool p3GxsChannels::getChannelDownloadDirectory(const RsGxsGroupId & groupId,std
|
|||||||
std::cerr << "p3GxsChannels::getChannelDownloadDirectory(" << id << ")" << std::endl;
|
std::cerr << "p3GxsChannels::getChannelDownloadDirectory(" << id << ")" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
RS_STACK_MUTEX(mSubscribedGroupsMutex);
|
||||||
|
|
||||||
std::map<RsGxsGroupId, RsGroupMetaData>::iterator it;
|
std::map<RsGxsGroupId, RsGroupMetaData>::iterator it;
|
||||||
|
|
||||||
it = mSubscribedGroups.find(groupId);
|
it = mSubscribedGroups.find(groupId);
|
||||||
@ -668,7 +671,8 @@ void p3GxsChannels::request_AllSubscribedGroups()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void p3GxsChannels::request_SpecificSubscribedGroups(const std::list<RsGxsGroupId> &groups)
|
void p3GxsChannels::request_SpecificSubscribedGroups(
|
||||||
|
const std::list<RsGxsGroupId> &groups )
|
||||||
{
|
{
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
#ifdef GXSCHANNELS_DEBUG
|
||||||
std::cerr << "p3GxsChannels::request_SpecificSubscribedGroups()";
|
std::cerr << "p3GxsChannels::request_SpecificSubscribedGroups()";
|
||||||
@ -681,8 +685,19 @@ void p3GxsChannels::request_SpecificSubscribedGroups(const std::list<RsGxsGroupI
|
|||||||
|
|
||||||
uint32_t token = 0;
|
uint32_t token = 0;
|
||||||
|
|
||||||
RsGenExchange::getTokenService()->requestGroupInfo(token, ansType, opts, groups);
|
if(!RsGenExchange::getTokenService()->
|
||||||
GxsTokenQueue::queueRequest(token, GXSCHANNELS_SUBSCRIBED_META);
|
requestGroupInfo(token, ansType, opts, groups))
|
||||||
|
{
|
||||||
|
std::cerr << __PRETTY_FUNCTION__ << " Failed requesting groups info!"
|
||||||
|
<< std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!GxsTokenQueue::queueRequest(token, GXSCHANNELS_SUBSCRIBED_META))
|
||||||
|
{
|
||||||
|
std::cerr << __PRETTY_FUNCTION__ << " Failed queuing request!"
|
||||||
|
<< std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -746,6 +761,7 @@ void p3GxsChannels::updateSubscribedGroup(const RsGroupMetaData &group)
|
|||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
RS_STACK_MUTEX(mSubscribedGroupsMutex);
|
||||||
mSubscribedGroups[group.mGroupId] = group;
|
mSubscribedGroups[group.mGroupId] = group;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -757,9 +773,8 @@ void p3GxsChannels::clearUnsubscribedGroup(const RsGxsGroupId &id)
|
|||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//std::map<RsGxsGroupId, RsGrpMetaData> mSubscribedGroups;
|
RS_STACK_MUTEX(mSubscribedGroupsMutex);
|
||||||
std::map<RsGxsGroupId, RsGroupMetaData>::iterator it;
|
std::map<RsGxsGroupId, RsGroupMetaData>::iterator it;
|
||||||
|
|
||||||
it = mSubscribedGroups.find(id);
|
it = mSubscribedGroups.find(id);
|
||||||
if (it != mSubscribedGroups.end())
|
if (it != mSubscribedGroups.end())
|
||||||
{
|
{
|
||||||
@ -838,24 +853,20 @@ void p3GxsChannels::request_GroupUnprocessedPosts(const std::list<RsGxsGroupId>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void p3GxsChannels::load_SpecificUnprocessedPosts(const uint32_t &token)
|
void p3GxsChannels::load_SpecificUnprocessedPosts(uint32_t token)
|
||||||
{
|
{
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
#ifdef GXSCHANNELS_DEBUG
|
||||||
std::cerr << "p3GxsChannels::load_SpecificUnprocessedPosts";
|
std::cerr << "p3GxsChannels::load_SpecificUnprocessedPosts" << std::endl;
|
||||||
std::cerr << std::endl;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::vector<RsGxsChannelPost> posts;
|
std::vector<RsGxsChannelPost> posts;
|
||||||
if (!getPostData(token, posts))
|
if (!getPostData(token, posts))
|
||||||
{
|
{
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
std::cerr << __PRETTY_FUNCTION__ << " ERROR getting post data!"
|
||||||
std::cerr << "p3GxsChannels::load_SpecificUnprocessedPosts ERROR";
|
<< std::endl;
|
||||||
std::cerr << std::endl;
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::vector<RsGxsChannelPost>::iterator it;
|
std::vector<RsGxsChannelPost>::iterator it;
|
||||||
for(it = posts.begin(); it != posts.end(); ++it)
|
for(it = posts.begin(); it != posts.end(); ++it)
|
||||||
{
|
{
|
||||||
@ -893,29 +904,24 @@ void p3GxsChannels::load_GroupUnprocessedPosts(const uint32_t &token)
|
|||||||
void p3GxsChannels::handleUnprocessedPost(const RsGxsChannelPost &msg)
|
void p3GxsChannels::handleUnprocessedPost(const RsGxsChannelPost &msg)
|
||||||
{
|
{
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
#ifdef GXSCHANNELS_DEBUG
|
||||||
std::cerr << "p3GxsChannels::handleUnprocessedPost() GroupId: " << msg.mMeta.mGroupId << " MsgId: " << msg.mMeta.mMsgId;
|
std::cerr << __PRETTY_FUNCTION__ << " GroupId: " << msg.mMeta.mGroupId
|
||||||
std::cerr << std::endl;
|
<< " MsgId: " << msg.mMeta.mMsgId << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!IS_MSG_UNPROCESSED(msg.mMeta.mMsgStatus))
|
if (!IS_MSG_UNPROCESSED(msg.mMeta.mMsgStatus))
|
||||||
{
|
{
|
||||||
std::cerr << "p3GxsChannels::handleUnprocessedPost() Msg already Processed";
|
std::cerr << __PRETTY_FUNCTION__ << " ERROR Msg already Processed!"
|
||||||
std::cerr << std::endl;
|
<< std::endl;
|
||||||
std::cerr << "p3GxsChannels::handleUnprocessedPost() ERROR - this should not happen";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool enabled = false ;
|
|
||||||
|
|
||||||
/* check that autodownload is set */
|
/* check that autodownload is set */
|
||||||
if (autoDownloadEnabled(msg.mMeta.mGroupId,enabled) && enabled )
|
bool enabled = false;
|
||||||
|
if (autoDownloadEnabled(msg.mMeta.mGroupId, enabled) && enabled)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
#ifdef GXSCHANNELS_DEBUG
|
||||||
std::cerr << "p3GxsChannels::handleUnprocessedPost() AutoDownload Enabled ... handling";
|
std::cerr << __PRETTY_FUNCTION__ << " AutoDownload Enabled... handling"
|
||||||
std::cerr << std::endl;
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* check the date is not too old */
|
/* check the date is not too old */
|
||||||
@ -928,8 +934,7 @@ void p3GxsChannels::handleUnprocessedPost(const RsGxsChannelPost &msg)
|
|||||||
// MORE THOUGHT HAS TO GO INTO THAT STUFF.
|
// MORE THOUGHT HAS TO GO INTO THAT STUFF.
|
||||||
|
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
#ifdef GXSCHANNELS_DEBUG
|
||||||
std::cerr << "p3GxsChannels::handleUnprocessedPost() START DOWNLOAD";
|
std::cerr << __PRETTY_FUNCTION__ << " START DOWNLOAD" << std::endl;
|
||||||
std::cerr << std::endl;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::list<RsGxsFile>::const_iterator fit;
|
std::list<RsGxsFile>::const_iterator fit;
|
||||||
@ -951,8 +956,11 @@ void p3GxsChannels::handleUnprocessedPost(const RsGxsChannelPost &msg)
|
|||||||
|
|
||||||
rsFiles->FileRequest(fname, hash, size, localpath, flags, srcIds);
|
rsFiles->FileRequest(fname, hash, size, localpath, flags, srcIds);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
std::cerr << "WARNING: Channel file is not auto-downloaded because its size exceeds the threshold of " << CHANNEL_MAX_AUTO_DL << " bytes." << std::endl;
|
std::cerr << __PRETTY_FUNCTION__ << "Channel file is not auto-"
|
||||||
|
<< "downloaded because its size exceeds the threshold"
|
||||||
|
<< " of " << CHANNEL_MAX_AUTO_DL << " bytes."
|
||||||
|
<< std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1079,6 +1087,15 @@ bool p3GxsChannels::createPost(RsGxsChannelPost& post)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool p3GxsChannels::subscribeToChannel(
|
||||||
|
const RsGxsGroupId& groupId, bool subscribe )
|
||||||
|
{
|
||||||
|
uint32_t token;
|
||||||
|
if( !subscribeToGroup(token, groupId, subscribe)
|
||||||
|
|| waitToken(token) != RsTokenService::COMPLETE ) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// Blocking API implementation end
|
/// Blocking API implementation end
|
||||||
@ -1096,16 +1113,13 @@ bool p3GxsChannels::autoDownloadEnabled(const RsGxsGroupId &groupId,bool& enable
|
|||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
RS_STACK_MUTEX(mSubscribedGroupsMutex);
|
||||||
std::map<RsGxsGroupId, RsGroupMetaData>::iterator it;
|
std::map<RsGxsGroupId, RsGroupMetaData>::iterator it;
|
||||||
|
|
||||||
it = mSubscribedGroups.find(groupId);
|
it = mSubscribedGroups.find(groupId);
|
||||||
if (it == mSubscribedGroups.end())
|
if (it == mSubscribedGroups.end())
|
||||||
{
|
{
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
std::cerr << __PRETTY_FUNCTION__ << " ERROR requested channel is not "
|
||||||
std::cerr << "p3GxsChannels::autoDownloadEnabled() No Entry";
|
<< "subscribed" << std::endl;
|
||||||
std::cerr << std::endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1190,23 +1204,20 @@ std::string SSGxsChannelGroup::save() const
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool p3GxsChannels::setAutoDownload(const RsGxsGroupId &groupId, bool enabled)
|
bool p3GxsChannels::setAutoDownload(const RsGxsGroupId& groupId, bool enabled)
|
||||||
{
|
{
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
#ifdef GXSCHANNELS_DEBUG
|
||||||
std::cerr << "p3GxsChannels::setAutoDownload() id: " << groupId << " enabled: " << enabled;
|
std::cerr << __PRETTY_FUNCTION__ << " id: " << groupId
|
||||||
std::cerr << std::endl;
|
<< " enabled: " << enabled << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
RS_STACK_MUTEX(mSubscribedGroupsMutex);
|
||||||
std::map<RsGxsGroupId, RsGroupMetaData>::iterator it;
|
std::map<RsGxsGroupId, RsGroupMetaData>::iterator it;
|
||||||
|
|
||||||
it = mSubscribedGroups.find(groupId);
|
it = mSubscribedGroups.find(groupId);
|
||||||
if (it == mSubscribedGroups.end())
|
if (it == mSubscribedGroups.end())
|
||||||
{
|
{
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
std::cerr << __PRETTY_FUNCTION__ << " ERROR requested channel: "
|
||||||
std::cerr << "p3GxsChannels::setAutoDownload() Missing Group";
|
<< groupId.toStdString() << " is not subscribed!" << std::endl;
|
||||||
std::cerr << std::endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1215,27 +1226,21 @@ bool p3GxsChannels::setAutoDownload(const RsGxsGroupId &groupId, bool enabled)
|
|||||||
ss.load(it->second.mServiceString);
|
ss.load(it->second.mServiceString);
|
||||||
if (enabled == ss.mAutoDownload)
|
if (enabled == ss.mAutoDownload)
|
||||||
{
|
{
|
||||||
/* it should be okay! */
|
std::cerr << __PRETTY_FUNCTION__ << " WARNING mAutoDownload was already"
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
<< " properly set to: " << enabled << " for channel:"
|
||||||
std::cerr << "p3GxsChannels::setAutoDownload() WARNING setting looks okay already";
|
<< groupId.toStdString() << std::endl;
|
||||||
std::cerr << std::endl;
|
return false;
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we are just going to set it anyway. */
|
|
||||||
ss.mAutoDownload = enabled;
|
ss.mAutoDownload = enabled;
|
||||||
std::string serviceString = ss.save();
|
std::string serviceString = ss.save();
|
||||||
|
|
||||||
uint32_t token;
|
uint32_t token;
|
||||||
|
RsGenExchange::setGroupServiceString(token, groupId, serviceString);
|
||||||
|
|
||||||
|
if(waitToken(token) != RsTokenService::COMPLETE) return false;
|
||||||
|
|
||||||
it->second.mServiceString = serviceString; // update Local Cache.
|
it->second.mServiceString = serviceString; // update Local Cache.
|
||||||
RsGenExchange::setGroupServiceString(token, groupId, serviceString); // update dbase.
|
|
||||||
|
|
||||||
/* now reload it */
|
|
||||||
std::list<RsGxsGroupId> groups;
|
|
||||||
groups.push_back(groupId);
|
|
||||||
|
|
||||||
request_SpecificSubscribedGroups(groups);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ public:
|
|||||||
|
|
||||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsChannelGroup> &groups);
|
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsChannelGroup> &groups);
|
||||||
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts, std::vector<RsGxsComment> &cmts);
|
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts, std::vector<RsGxsComment> &cmts);
|
||||||
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts) { std::vector<RsGxsComment> cmts; return getPostData( token, posts, cmts);}
|
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts);
|
||||||
//Not currently used
|
//Not currently used
|
||||||
//virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsGxsChannelPost> &posts);
|
//virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsGxsChannelPost> &posts);
|
||||||
|
|
||||||
@ -186,6 +186,10 @@ virtual bool ExtraFileRemove(const RsFileHash &hash);
|
|||||||
/// Implementation of @see RsGxsChannels::createPost
|
/// Implementation of @see RsGxsChannels::createPost
|
||||||
virtual bool createPost(RsGxsChannelPost& post);
|
virtual bool createPost(RsGxsChannelPost& post);
|
||||||
|
|
||||||
|
/// Implementation of @see RsGxsChannels::subscribeToChannel
|
||||||
|
virtual bool subscribeToChannel( const RsGxsGroupId &groupId,
|
||||||
|
bool subscribe );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overloaded from GxsTokenQueue for Request callbacks.
|
// Overloaded from GxsTokenQueue for Request callbacks.
|
||||||
virtual void handleResponse(uint32_t token, uint32_t req_type);
|
virtual void handleResponse(uint32_t token, uint32_t req_type);
|
||||||
@ -201,7 +205,7 @@ static uint32_t channelsAuthenPolicy();
|
|||||||
void load_SubscribedGroups(const uint32_t &token);
|
void load_SubscribedGroups(const uint32_t &token);
|
||||||
|
|
||||||
void request_SpecificUnprocessedPosts(std::list<std::pair<RsGxsGroupId, RsGxsMessageId> > &ids);
|
void request_SpecificUnprocessedPosts(std::list<std::pair<RsGxsGroupId, RsGxsMessageId> > &ids);
|
||||||
void load_SpecificUnprocessedPosts(const uint32_t &token);
|
void load_SpecificUnprocessedPosts(uint32_t token);
|
||||||
|
|
||||||
void request_GroupUnprocessedPosts(const std::list<RsGxsGroupId> &grouplist);
|
void request_GroupUnprocessedPosts(const std::list<RsGxsGroupId> &grouplist);
|
||||||
void load_GroupUnprocessedPosts(const uint32_t &token);
|
void load_GroupUnprocessedPosts(const uint32_t &token);
|
||||||
@ -214,11 +218,6 @@ static uint32_t channelsAuthenPolicy();
|
|||||||
bool setAutoDownload(const RsGxsGroupId &groupId, bool enabled);
|
bool setAutoDownload(const RsGxsGroupId &groupId, bool enabled);
|
||||||
bool autoDownloadEnabled(const RsGxsGroupId &groupId, bool &enabled);
|
bool autoDownloadEnabled(const RsGxsGroupId &groupId, bool &enabled);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::map<RsGxsGroupId, RsGroupMetaData> mSubscribedGroups;
|
|
||||||
|
|
||||||
|
|
||||||
// DUMMY DATA,
|
// DUMMY DATA,
|
||||||
virtual bool generateDummyData();
|
virtual bool generateDummyData();
|
||||||
|
|
||||||
@ -246,14 +245,21 @@ bool generateGroup(uint32_t &token, std::string groupName);
|
|||||||
RsGxsMessageId mMsgId;
|
RsGxsMessageId mMsgId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::map<RsGxsGroupId, RsGroupMetaData> mSubscribedGroups;
|
||||||
|
RsMutex mSubscribedGroupsMutex;
|
||||||
|
|
||||||
|
/** G10h4ck: Is this stuff really used? And for what? BEGIN */
|
||||||
uint32_t mGenToken;
|
uint32_t mGenToken;
|
||||||
bool mGenActive;
|
bool mGenActive;
|
||||||
int mGenCount;
|
int mGenCount;
|
||||||
std::vector<ChannelDummyRef> mGenRefs;
|
std::vector<ChannelDummyRef> mGenRefs;
|
||||||
RsGxsMessageId mGenThreadId;
|
RsGxsMessageId mGenThreadId;
|
||||||
|
/** G10h4ck: Is this stuff really used? And for what? END */
|
||||||
|
|
||||||
p3GxsCommentService *mCommentService;
|
p3GxsCommentService* mCommentService;
|
||||||
std::map<RsGxsGroupId,rstime_t> mKnownChannels;
|
|
||||||
|
std::map<RsGxsGroupId,rstime_t> mKnownChannels;
|
||||||
|
RsMutex mKnownChannelsMutex;
|
||||||
|
|
||||||
/** Store search callbacks with timeout*/
|
/** Store search callbacks with timeout*/
|
||||||
std::map<
|
std::map<
|
||||||
|
Loading…
Reference in New Issue
Block a user