diff --git a/libretroshare/src/retroshare/rsgxsforums.h b/libretroshare/src/retroshare/rsgxsforums.h index 4967d46c5..ba13bd16e 100644 --- a/libretroshare/src/retroshare/rsgxsforums.h +++ b/libretroshare/src/retroshare/rsgxsforums.h @@ -450,6 +450,17 @@ public: const std::string& matchString, std::vector& searchResults ) = 0; + /** + * @brief Request Synchronization with available peers + * Usually syncronization already happen automatically so be carefull + * to call this method only if necessary. + * It has been thinked for use cases like mobile phone where internet + * connection is intermittent and calling this may be useful when a system + * event about connection being available or about to go offline is received + * @jsonapi{development} + * @return Success or error details + */ + virtual std::error_condition requestSynchronization() = 0; //////////////////////////////////////////////////////////////////////////// /* Following functions are deprecated and should not be considered a stable diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index c930046a9..81f03b6ec 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -1159,6 +1159,12 @@ std::error_condition p3GxsForums::setPostKeepForever( } } +std::error_condition p3GxsForums::requestSynchronization() +{ + RsGenExchange::netService()->pullFromPeers(); + return RsGenExchange::netService()->requestPull(); +} + /* so we need the same tick idea as wiki for generating dummy forums */ diff --git a/libretroshare/src/services/p3gxsforums.h b/libretroshare/src/services/p3gxsforums.h index b499e7b0d..9400de652 100644 --- a/libretroshare/src/services/p3gxsforums.h +++ b/libretroshare/src/services/p3gxsforums.h @@ -175,6 +175,8 @@ public: rs_owner_ptr& resultData, uint32_t& resultSize ) override; #endif + std::error_condition requestSynchronization() override; + /// implementation of rsGxsGorums /// bool getGroupData(const uint32_t &token, std::vector &groups) override;