added consistency check in meta data in publishGroup() and updateGroup() in order to avoid bad data supplied from GXS services

This commit is contained in:
csoler 2017-01-19 11:12:37 +01:00
parent d2dc632176
commit 06265f2b54
6 changed files with 106 additions and 21 deletions

View file

@ -52,6 +52,7 @@ typedef RsPgpId RsPgpId;
// The meaning of the different circle types is:
//
//
static const uint32_t GXS_CIRCLE_TYPE_UNKNOWN = 0x0000 ; // not known. Is treated as public.
static const uint32_t GXS_CIRCLE_TYPE_PUBLIC = 0x0001 ; // not restricted to a circle
static const uint32_t GXS_CIRCLE_TYPE_EXTERNAL = 0x0002 ; // restricted to an external circle, made of RsGxsId
static const uint32_t GXS_CIRCLE_TYPE_YOUR_FRIENDS_ONLY = 0x0003 ; // restricted to a subset of friend nodes of a given RS node given by a RsPgpId list

View file

@ -33,11 +33,13 @@ typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > MsgMetaResult;
class RsGxsGrpMetaData;
class RsGxsMsgMetaData;
struct RsGroupMetaData
{
// (csoler) The correct default value to be used in mCircleType is GXS_CIRCLE_TYPE_PUBLIC, which is defined in rsgxscircles.h,
// but because of a loop in the includes, I cannot include it here. So I replaced with its current value 0x0001.
RsGroupMetaData() : mGroupFlags(0), mSignFlags(0), mPublishTs(0),
mCircleType(0), mAuthenFlags(0), mSubscribeFlags(0), mPop(0),
mCircleType(0x0001), mAuthenFlags(0), mSubscribeFlags(0), mPop(0),
mVisibleMsgCount(0), mLastPost(0), mGroupStatus(0) {}
void operator =(const RsGxsGrpMetaData& rGxsMeta);