mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-27 00:15:51 -04:00
fixed bug causing bad cache update
This commit is contained in:
parent
a6010beab3
commit
ef21db0a0a
3 changed files with 5 additions and 9 deletions
|
@ -838,6 +838,7 @@ int RsDataService::storeMessage(const std::list<RsNxsMsg*>& msg)
|
||||||
|
|
||||||
// This is needed so that mLastPost is correctly updated in the group meta when it is re-loaded.
|
// This is needed so that mLastPost is correctly updated in the group meta when it is re-loaded.
|
||||||
|
|
||||||
|
if(mUseCache)
|
||||||
mMsgMetaDataCache[msgMetaPtr->mGroupId].updateMeta(msgMetaPtr->mMsgId,*msgMetaPtr);
|
mMsgMetaDataCache[msgMetaPtr->mGroupId].updateMeta(msgMetaPtr->mMsgId,*msgMetaPtr);
|
||||||
|
|
||||||
delete *mit;
|
delete *mit;
|
||||||
|
|
|
@ -81,12 +81,7 @@ public:
|
||||||
|
|
||||||
void updateMeta(const ID& id,const MetaDataClass& meta)
|
void updateMeta(const ID& id,const MetaDataClass& meta)
|
||||||
{
|
{
|
||||||
auto it = mMetas.find(id) ;
|
mMetas[id] = std::make_shared<MetaDataClass>(meta); // create a new shared_ptr to possibly replace the previous one
|
||||||
|
|
||||||
if(it != mMetas.end())
|
|
||||||
*(it->second) = meta ;
|
|
||||||
else
|
|
||||||
mMetas[id] = std::make_shared<MetaDataClass>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear(const ID& id)
|
void clear(const ID& id)
|
||||||
|
|
|
@ -216,8 +216,8 @@ void GxsForumMsgItem::loadGroup()
|
||||||
|
|
||||||
void GxsForumMsgItem::loadMessage()
|
void GxsForumMsgItem::loadMessage()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_ITEM
|
#ifndef DEBUG_ITEM
|
||||||
std::cerr << "GxsForumMsgItem::loadMessage()";
|
std::cerr << "GxsForumMsgItem::loadMessage(): messageId=" << messageId() << " groupId=" << groupId() ;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue