mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed bug causing bad cache update
This commit is contained in:
parent
a6010beab3
commit
ef21db0a0a
@ -838,7 +838,8 @@ 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.
|
||||
|
||||
mMsgMetaDataCache[msgMetaPtr->mGroupId].updateMeta(msgMetaPtr->mMsgId,*msgMetaPtr);
|
||||
if(mUseCache)
|
||||
mMsgMetaDataCache[msgMetaPtr->mGroupId].updateMeta(msgMetaPtr->mMsgId,*msgMetaPtr);
|
||||
|
||||
delete *mit;
|
||||
}
|
||||
|
@ -81,12 +81,7 @@ public:
|
||||
|
||||
void updateMeta(const ID& id,const MetaDataClass& meta)
|
||||
{
|
||||
auto it = mMetas.find(id) ;
|
||||
|
||||
if(it != mMetas.end())
|
||||
*(it->second) = meta ;
|
||||
else
|
||||
mMetas[id] = std::make_shared<MetaDataClass>();
|
||||
mMetas[id] = std::make_shared<MetaDataClass>(meta); // create a new shared_ptr to possibly replace the previous one
|
||||
}
|
||||
|
||||
void clear(const ID& id)
|
||||
|
@ -216,8 +216,8 @@ void GxsForumMsgItem::loadGroup()
|
||||
|
||||
void GxsForumMsgItem::loadMessage()
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "GxsForumMsgItem::loadMessage()";
|
||||
#ifndef DEBUG_ITEM
|
||||
std::cerr << "GxsForumMsgItem::loadMessage(): messageId=" << messageId() << " groupId=" << groupId() ;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user