fixed according to comments on PR 1334

This commit is contained in:
csoler 2018-09-10 20:03:47 +02:00
parent 59a76a9418
commit 2b80c23f6a
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
3 changed files with 11 additions and 11 deletions

View File

@ -153,6 +153,6 @@ void RsDiscContactItem::serial_process(RsGenericSerializer::SerializeJob j,RsGen
void RsDiscIdentityListItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx)
{
RsTypeSerializer::serial_process(j,ctx,ownIdentityList,"identityList");
RS_SERIAL_PROCESS(ownIdentityList);
}

View File

@ -152,7 +152,7 @@ public:
virtual ~RsDiscIdentityListItem() {}
virtual void clear() { ownIdentityList.clear() ; }
virtual void serial_process(RsGenericSerializer::SerializeJob /* j */,RsGenericSerializer::SerializeContext& /* ctx */);
virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx);
std::list<RsGxsId> ownIdentityList ;
};

View File

@ -264,12 +264,12 @@ int p3discovery2::handleIncoming()
int nhandled = 0;
// While messages read
while(NULL != (item = recvItem()))
while(nullptr != (item = recvItem()))
{
RsDiscPgpListItem *pgplist = NULL;
RsDiscPgpCertItem *pgpcert = NULL;
RsDiscContactItem *contact = NULL;
RsDiscIdentityListItem *gxsidlst = NULL;
RsDiscPgpListItem *pgplist = nullptr;
RsDiscPgpCertItem *pgpcert = nullptr;
RsDiscContactItem *contact = nullptr;
RsDiscIdentityListItem *gxsidlst = nullptr;
nhandled++;
#ifdef P3DISC_DEBUG
@ -278,21 +278,21 @@ int p3discovery2::handleIncoming()
std::cerr << std::endl;
#endif
if (NULL != (contact = dynamic_cast<RsDiscContactItem *> (item)))
if (nullptr != (contact = dynamic_cast<RsDiscContactItem *> (item)))
{
if (item->PeerId() == contact->sslId) /* self describing */
recvOwnContactInfo(item->PeerId(), contact);
else
processContactInfo(item->PeerId(), contact);
}
else if (NULL != (gxsidlst = dynamic_cast<RsDiscIdentityListItem *> (item)))
else if (nullptr != (gxsidlst = dynamic_cast<RsDiscIdentityListItem *> (item)))
{
recvIdentityList(item->PeerId(),gxsidlst->ownIdentityList) ;
delete item;
}
else if (NULL != (pgpcert = dynamic_cast<RsDiscPgpCertItem *> (item)))
else if (nullptr != (pgpcert = dynamic_cast<RsDiscPgpCertItem *> (item)))
recvPGPCertificate(item->PeerId(), pgpcert);
else if (NULL != (pgplist = dynamic_cast<RsDiscPgpListItem *> (item)))
else if (nullptr != (pgplist = dynamic_cast<RsDiscPgpListItem *> (item)))
{
/* two types */
if (pgplist->mode == DISC_PGP_LIST_MODE_FRIENDS)