Merge pull request #2228 from PhenomRetroShare/Fix_RsPostedPostsModelHandleEvent

Fix RsPostedPostsModel::handleEvent_main_thread
This commit is contained in:
csoler 2021-01-15 22:02:31 +01:00 committed by GitHub
commit d6f02e28a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,8 +81,10 @@ void RsPostedPostsModel::handleEvent_main_thread(std::shared_ptr<const RsEvent>
//
// We need to update the data!
if(e->mPostedGroupId == mPostedGroup.mMeta.mGroupId)
RsThread::async([this, e]()
RsGxsPostedEvent E(*e);
if(E.mPostedGroupId == mPostedGroup.mMeta.mGroupId)
RsThread::async([this, E]()
{
// 1 - get message data from p3GxsChannels
@ -90,9 +92,9 @@ void RsPostedPostsModel::handleEvent_main_thread(std::shared_ptr<const RsEvent>
std::vector<RsGxsComment> comments;
std::vector<RsGxsVote> votes;
if(!rsPosted->getBoardContent(mPostedGroup.mMeta.mGroupId,std::set<RsGxsMessageId>{ e->mPostedMsgId }, posts,comments,votes))
if(!rsPosted->getBoardContent(mPostedGroup.mMeta.mGroupId,std::set<RsGxsMessageId>{ E.mPostedMsgId }, posts,comments,votes))
{
std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve channel message data for channel/msg " << e->mPostedGroupId << "/" << e->mPostedMsgId << std::endl;
RS_ERR(" failed to retrieve channel message data for channel/msg ", E.mPostedGroupId, "/", E.mPostedMsgId);
return;
}
@ -118,10 +120,10 @@ void RsPostedPostsModel::handleEvent_main_thread(std::shared_ptr<const RsEvent>
},this);
});
}
default:
break;
}
}
}
void RsPostedPostsModel::initEmptyHierarchy()