added on-the-fly fix of group privacy flags, so that edited groups with old un-set flags will be set automatically. Also fixes the bug preventing to grant membership on old circles

This commit is contained in:
csoler 2017-05-06 16:51:38 +02:00
parent 868c0467f2
commit 59ac5a5bfa

View File

@ -1366,6 +1366,18 @@ bool RsGenExchange::getGroupData(const uint32_t &token, std::vector<RsGxsGrpItem
gItem->meta.mPop = 0;
gItem->meta.mVisibleMsgCount = 0;
}
// Also check the group privacy flags. A while ago, it as possible to publish a group without privacy flags. Now it is not possible anymore.
// As a consequence, it's important to supply a correct value in this flag before the data can be edited/updated.
if((gItem->meta.mGroupFlags & GXS_SERV::FLAG_PRIVACY_MASK) == 0)
{
#ifdef GEN_EXCH_DEBUG
std::cerr << "(WW) getGroupData(): mGroupFlags for group " << gItem->meta.mGroupId << " has incorrect value " << std::hex << gItem->meta.mGroupFlags << std::dec << ". Setting value to GXS_SERV::FLAG_PRIVACY_PUBLIC." << std::endl;
#endif
gItem->meta.mGroupFlags |= GXS_SERV::FLAG_PRIVACY_PUBLIC;
}
grpItem.push_back(gItem);
}
else