From 6295e91304963a45094ebe9c8443120b86b28b1e Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sun, 14 Mar 2021 17:15:00 +0100 Subject: [PATCH] Request pull from peers when GXS message is created --- libretroshare/src/gxs/rsgenexchange.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 152198da2..fb1b4c295 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -2286,8 +2286,9 @@ bool RsGenExchange::processGrpMask(const RsGxsGroupId& grpId, ContentValue &grpC void RsGenExchange::publishMsgs() { + bool atLeastOneMessageCreatedSuccessfully = false; - RS_STACK_MUTEX(mGenMtx) ; + RS_STACK_MUTEX(mGenMtx); rstime_t now = time(NULL); @@ -2464,6 +2465,8 @@ void RsGenExchange::publishMsgs() // add to published to allow acknowledgement mMsgNotify.insert(std::make_pair(mit->first, std::make_pair(grpId, msgId))); mDataAccess->updatePublicRequestStatus(mit->first, RsTokenService::COMPLETE); + + atLeastOneMessageCreatedSuccessfully = true; } else { @@ -2497,6 +2500,8 @@ void RsGenExchange::publishMsgs() mNotifications.push_back(ch); } + + if(atLeastOneMessageCreatedSuccessfully) mNetService->requestPull(); } RsGenExchange::ServiceCreate_Return RsGenExchange::service_CreateGroup(RsGxsGrpItem* /* grpItem */,