added proper memory for sources of distant messages

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6654 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-08-30 21:06:23 +00:00
parent abd8c1e32f
commit 731e832734

View File

@ -1942,6 +1942,24 @@ bool p3MsgService::decryptMessage(const std::string& mId)
else else
msgi.msgFlags &= ~RS_MSG_FLAGS_SIGNATURE_CHECKS ; // just in case. msgi.msgFlags &= ~RS_MSG_FLAGS_SIGNATURE_CHECKS ; // just in case.
} }
std::map<uint32_t, RsMsgSrcId*>::iterator it = mSrcIds.find(msgi.msgId) ;
if(it == mSrcIds.end())
{
std::cerr << "Warning: could not find message source for id " << msgi.msgId << ". Weird." << std::endl;
RsMsgSrcId* msi = new RsMsgSrcId();
msi->msgId = msgi.msgId;
msi->srcId = senders_id.toStdString() ;
mSrcIds.insert(std::pair<uint32_t, RsMsgSrcId*>(msi->msgId, msi));
}
else
{
std::cerr << "Substituting source name for message id " << msgi.msgId << ": " << it->second->srcId << " -> " << senders_id.toStdString() << std::endl;
it->second->srcId = senders_id.toStdString() ;
}
} }
delete item ; delete item ;