From 330cc98c23c70300e9b10f1820284fd6bbb391ba Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 17 Dec 2016 18:14:44 +0100 Subject: [PATCH] fixed test of max age when receiving posts --- libretroshare/src/gxs/rsgenexchange.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 46d0fd98a..e0d466a1f 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -240,7 +240,9 @@ bool RsGenExchange::messagePublicationTest(const RsGxsMsgMetaData& meta) { time_t now = time(NULL) ; - return meta.mMsgStatus & GXS_SERV::GXS_MSG_STATUS_KEEP || meta.mPublishTs + MESSAGE_STORE_PERIOD >= now ; + uint32_t store_limit = (mNetService != NULL)?MESSAGE_STORE_PERIOD:mNetService->getKeepAge(grpId,MESSAGE_STORE_PERIOD) ; + + return meta.mMsgStatus & GXS_SERV::GXS_MSG_STATUS_KEEP || store_limit == 0 || meta.mPublishTs + store_limit >= now ; } bool RsGenExchange::acknowledgeTokenMsg(const uint32_t& token,