From de2499ce6ef1d90c094b06cbac0b31925626839f Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 2 Nov 2020 18:23:50 +0100 Subject: [PATCH] fixed text and condition for post sync warning --- retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp | 6 ++++-- .../src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp index 8f166ea06..845e48783 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp @@ -877,8 +877,10 @@ void PostedListWidgetWithModel::insertBoardDetails(const RsPostedGroup& group) sync_string = tr("Unknown"); } - if(group.mMeta.mLastPost > 0 && group.mMeta.mLastPost + rsPosted->getSyncPeriod(group.mMeta.mGroupId) < time(NULL) && IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags)) - sync_string += " (Warning: will not allow latest posts to sync)"; + auto sync_period = rsPosted->getSyncPeriod(group.mMeta.mGroupId) ; + + if(sync_period > 0 && group.mMeta.mLastPost > 0 && group.mMeta.mLastPost + sync_period < time(NULL) && IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags)) + sync_string += " (Warning: will not allow posts to sync)"; ui->syncPeriodLabel->setText(sync_string); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index e03c41c32..86574203c 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -1093,8 +1093,10 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou sync_string = tr("Unknown"); } - if(group.mMeta.mLastPost > 0 && group.mMeta.mLastPost + rsGxsChannels->getSyncPeriod(group.mMeta.mGroupId) < time(NULL) && IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags)) - sync_string += " (Warning: will not allow latest posts to sync)"; + auto sync_period = rsGxsChannels->getSyncPeriod(group.mMeta.mGroupId) ; + + if(sync_period > 0 && group.mMeta.mLastPost > 0 && group.mMeta.mLastPost + rsGxsChannels->getSyncPeriod(group.mMeta.mGroupId) < time(NULL) && IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags)) + sync_string += " (Warning: will not allow posts to sync)"; ui->infoSyncTimeLabel->setText(sync_string);