check that author id is not null before complaining that it does not exist

This commit is contained in:
csoler 2017-01-01 17:49:34 +01:00
parent c71cf7a5ee
commit fcf8a35081

View File

@ -4218,20 +4218,25 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsgReqItem *item,bool item_
{ {
RsGxsMsgMetaData* m = *vit; RsGxsMsgMetaData* m = *vit;
RsIdentityDetails details ; // Check reputation
if(!rsIdentity->getIdDetails(m->mAuthorId,details)) if(!m->mAuthorId.isNull())
{
std::cerr << /* GXSNETDEBUG_PG(item->PeerId(),item->grpId) << */ " not sending grp message ID " << (*vit)->mMsgId << ", because the identity of the author is not accessible (unknown/not cached)" << std::endl;
continue ;
}
if(details.mReputation.mOverallReputationLevel < minReputationForForwardingMessages(grpMeta->mSignFlags, details.mFlags))
{ {
//#ifdef NXS_NET_DEBUG_0 RsIdentityDetails details ;
std::cerr << /* GXSNETDEBUG_PG(item->PeerId(),item->grpId) << */ " not sending item ID " << (*vit)->mMsgId << ", because the author is flags " << std::hex << details.mFlags << std::dec << " and reputation level " << details.mReputation.mOverallReputationLevel << std::endl;
//#endif if(!rsIdentity->getIdDetails(m->mAuthorId,details))
continue ; {
std::cerr << /* GXSNETDEBUG_PG(item->PeerId(),item->grpId) << */ " not sending grp message ID " << (*vit)->mMsgId << ", because the identity of the author (" << m->mAuthorId << ") is not accessible (unknown/not cached)" << std::endl;
continue ;
}
if(details.mReputation.mOverallReputationLevel < minReputationForForwardingMessages(grpMeta->mSignFlags, details.mFlags))
{
//#ifdef NXS_NET_DEBUG_0
std::cerr << /* GXSNETDEBUG_PG(item->PeerId(),item->grpId) << */ " not sending item ID " << (*vit)->mMsgId << ", because the author is flags " << std::hex << details.mFlags << std::dec << " and reputation level " << details.mReputation.mOverallReputationLevel << std::endl;
//#endif
continue ;
}
} }
// Check publish TS // Check publish TS