Documentation and code cleanup

Fix a warning in RsGenExchange::messagePublicationTest(...)
Fix documentation for RsGenExchange::{generatePublicToken(), acknowledgeTokenGrp(...)}
Properly initialize RsGroupMetaData, RsMsgMetaData and p3GxsForums members
Cleanup RsGxsNotify
This commit is contained in:
Gioacchino Mazzurco 2017-01-12 22:28:58 +01:00
parent e329815f33
commit cdd39736d4
5 changed files with 30 additions and 62 deletions

View file

@ -238,11 +238,12 @@ void RsGenExchange::tick()
bool RsGenExchange::messagePublicationTest(const RsGxsMsgMetaData& meta)
{
time_t now = time(NULL) ;
time_t st = MESSAGE_STORE_PERIOD;
if(mNetService) st = mNetService->getKeepAge(meta.mGroupId, st);
time_t storageTimeLimit = meta.mPublishTs + st;
uint32_t store_limit = (mNetService == NULL)?MESSAGE_STORE_PERIOD:mNetService->getKeepAge(meta.mGroupId,MESSAGE_STORE_PERIOD) ;
return meta.mMsgStatus & GXS_SERV::GXS_MSG_STATUS_KEEP || store_limit == 0 || meta.mPublishTs + store_limit >= now ;
return meta.mMsgStatus & GXS_SERV::GXS_MSG_STATUS_KEEP ||
storageTimeLimit == 0 || storageTimeLimit >= time(NULL);
}
bool RsGenExchange::acknowledgeTokenMsg(const uint32_t& token,

View file

@ -428,11 +428,10 @@ protected:
public:
/*!
* Assigns a token value to passed integer
* The status of the token can still be queried from request status feature
* @warning the token space is shared with RsGenExchange backend, so do not
* modify tokens except does you have created by calling generatePublicToken()
* @return token
* Generate a new token, the status of the token can be queried from request
* status feature.
* @attention the token space is shared with RsGenExchange backend.
* @return Generated token
*/
uint32_t generatePublicToken();
@ -486,7 +485,7 @@ public:
* This allows the client service to acknowledge that their grps has \n
* been created/modified and retrieve the create/modified grp ids
* @param token the token related to modification/create request
* @param msgIds vector of ids of groups created/modified
* @param grpId ids of created/modified group
* @return true if token exists false otherwise
*/
bool acknowledgeTokenGrp(const uint32_t& token, RsGxsGroupId& grpId);