diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 7c7e66dc5..6abe37982 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -70,7 +70,7 @@ static const uint32_t INTEGRITY_CHECK_PERIOD = 60*31; // 31 minutes #define GEN_EXCH_DEBUG 1 #if defined(GEN_EXCH_DEBUG) -static const uint32_t service_to_print = RS_SERVICE_GXS_TYPE_GXSCIRCLE;// use this to allow to this service id only, or 0 for all services +static const uint32_t service_to_print = RS_SERVICE_GXS_TYPE_FORUMS;// use this to allow to this service id only, or 0 for all services // warning. Numbers should be SERVICE IDS (see serialiser/rsserviceids.h. E.g. 0x0215 for forums) class nullstream: public std::ostream {}; diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index 9b1902b75..910615d0c 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -34,7 +34,7 @@ // Debug system to allow to print only for some services (group, Peer, etc) #if defined(DATA_DEBUG) -static const uint32_t service_to_print = RS_SERVICE_GXS_TYPE_GXSCIRCLE;// use this to allow to this service id only, or 0 for all services +static const uint32_t service_to_print = RS_SERVICE_GXS_TYPE_FORUMS;// use this to allow to this service id only, or 0 for all services // warning. Numbers should be SERVICE IDS (see serialiser/rsserviceids.h. E.g. 0x0215 for forums) class nullstream: public std::ostream {}; diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index 91b576d32..f2145ccee 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -804,8 +804,7 @@ bool p3GxsForums::getForumContent( GxsMsgReq msgIds; msgIds[forumId] = msgs_to_request; - if( !requestMsgInfo(token, opts, msgIds) || - waitToken(token,std::chrono::seconds(5)) != RsTokenService::COMPLETE ) + if( !requestMsgInfo(token, opts, msgIds) || waitToken(token,std::chrono::seconds(5)) != RsTokenService::COMPLETE ) return false; return getMsgData(token, msgs); @@ -836,15 +835,21 @@ bool p3GxsForums::markRead(const RsGxsGrpMsgIdPair& msgId, bool read) uint32_t token; setMessageReadStatus(token, msgId, read); if(waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE ) return false; + + RsGxsGrpMsgIdPair p; + acknowledgeMsg(token,p); + return true; } -bool p3GxsForums::subscribeToForum( - const RsGxsGroupId& groupId, bool subscribe ) +bool p3GxsForums::subscribeToForum(const RsGxsGroupId& groupId, bool subscribe ) { uint32_t token; - if( !RsGenExchange::subscribeToGroup(token, groupId, subscribe) - || waitToken(token) != RsTokenService::COMPLETE ) return false; + if( !RsGenExchange::subscribeToGroup(token, groupId, subscribe) || waitToken(token) != RsTokenService::COMPLETE ) return false; + + RsGxsGroupId grp; + acknowledgeGrp(token,grp); + return true; } diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index aa77ca4a2..b27443173 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -1256,17 +1256,22 @@ void RsGxsForumModel::recursSetMsgReadStatus(ForumModelIndex i,bool read_status, if (bChanged) { //Don't recurs post versions as this should be done before, if no change. - uint32_t token; auto s = getPostVersions(mPosts[i].mMsgId) ; if(!s.empty()) for(auto it(s.begin());it!=s.end();++it) { - rsGxsForums->setMessageReadStatus(token,std::make_pair( mForumGroup.mMeta.mGroupId, it->second ), read_status); - std::cerr << "Setting version " << it->second << " of post " << mPosts[i].mMsgId << " as read." << std::endl; + RsThread::async( [grpId=mForumGroup.mMeta.mGroupId,msgId=it->second,original_msg_id=mPosts[i].mMsgId,read_status]() + { + rsGxsForums->markRead(std::make_pair( grpId, msgId ), read_status); + std::cerr << "Setting version " << msgId << " of post " << original_msg_id << " as read." << std::endl; + }); } else - rsGxsForums->setMessageReadStatus(token,std::make_pair( mForumGroup.mMeta.mGroupId, mPosts[i].mMsgId ), read_status); + RsThread::async( [grpId=mForumGroup.mMeta.mGroupId,original_msg_id=mPosts[i].mMsgId,read_status]() + { + rsGxsForums->markRead(std::make_pair( grpId, original_msg_id), read_status); + }); void *ref ; convertTabEntryToRefPointer(i,ref); // we dont use i+1 here because i is not a row, but an index in the mPosts tab