From 54f8ef1ffec568ca545e978419984ae98caec4a4 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 12 Apr 2020 23:07:42 +0200 Subject: [PATCH] fixed small bug causing read/unread and new msgs to not update immediately --- libretroshare/src/gxs/rsgxsdataaccess.h | 2 +- retroshare-gui/src/gui/Posted/PostedDialog.cpp | 2 +- retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h | 1 - retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp | 6 +++--- retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp | 4 ++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsdataaccess.h b/libretroshare/src/gxs/rsgxsdataaccess.h index aab1eb03a..21cb89b24 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.h +++ b/libretroshare/src/gxs/rsgxsdataaccess.h @@ -123,7 +123,7 @@ public: void requestGroupStatistic(uint32_t& token, const RsGxsGroupId& grpId, const RsTokReqOptions &opts) override; /* Poll */ - GxsRequestStatus requestStatus(const uint32_t token); + GxsRequestStatus requestStatus(uint32_t token); /* Cancel Request */ bool cancelRequest(const uint32_t &token); diff --git a/retroshare-gui/src/gui/Posted/PostedDialog.cpp b/retroshare-gui/src/gui/Posted/PostedDialog.cpp index 1be39110f..a6fdda0bd 100644 --- a/retroshare-gui/src/gui/Posted/PostedDialog.cpp +++ b/retroshare-gui/src/gui/Posted/PostedDialog.cpp @@ -62,7 +62,7 @@ void PostedDialog::handleEvent_main_thread(std::shared_ptr event) case RsPostedEventCode::NEW_MESSAGE: case RsPostedEventCode::UPDATED_MESSAGE: // [[fallthrough]]; case RsPostedEventCode::READ_STATUS_CHANGED: // [[fallthrough]]; - updateMessageSummaryList(e->mPostedGroupId); + updateGroupStatisticsReal(e->mPostedGroupId); // update the list immediately break; case RsPostedEventCode::NEW_POSTED_GROUP: // [[fallthrough]]; diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index 669324324..902e49087 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -105,7 +105,6 @@ protected: virtual bool getGroupData(std::list& groupInfo) =0; virtual bool getGroupStatistics(const RsGxsGroupId& groupId,GxsGroupStatistic& stat) =0; -private: void updateGroupStatisticsReal(const RsGxsGroupId &groupId); void updateMessageSummaryListReal(RsGxsGroupId groupId); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp index 961c55709..70f3de04a 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp @@ -65,9 +65,9 @@ void GxsChannelDialog::handleEvent_main_thread(std::shared_ptr ev switch(e->mChannelEventCode) { case RsChannelEventCode::NEW_MESSAGE: // [[fallthrough]]; - case RsChannelEventCode::UPDATED_MESSAGE: - case RsChannelEventCode::READ_STATUS_CHANGED: - updateMessageSummaryList(e->mChannelGroupId); + case RsChannelEventCode::UPDATED_MESSAGE: // [[fallthrough]]; + case RsChannelEventCode::READ_STATUS_CHANGED: // [[fallthrough]]; + updateGroupStatisticsReal(e->mChannelGroupId); // update the list immediately break; case RsChannelEventCode::RECEIVED_DISTANT_SEARCH_RESULT: diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp index 20f0a99ae..1b0a36c6f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp @@ -62,7 +62,7 @@ void GxsForumsDialog::handleEvent_main_thread(std::shared_ptr eve case RsForumEventCode::NEW_MESSAGE: case RsForumEventCode::UPDATED_MESSAGE: // [[fallthrough]]; case RsForumEventCode::READ_STATUS_CHANGED: - updateMessageSummaryList(e->mForumGroupId); + updateGroupStatisticsReal(e->mForumGroupId); // update the list immediately break; case RsForumEventCode::NEW_FORUM: // [[fallthrough]]; @@ -71,7 +71,7 @@ void GxsForumsDialog::handleEvent_main_thread(std::shared_ptr eve break; case RsForumEventCode::STATISTICS_CHANGED: - updateGroupStatistics(e->mForumGroupId); + updateGroupStatistics(e->mForumGroupId); // update the list when redraw less often than once every 2 mins break; default: