diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index cff1ffc74..6410bd396 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -220,7 +220,13 @@ void p3GxsChannels::notifyChanges(std::vector &changes) std::list::iterator git; for (git = grpList.begin(); git != grpList.end(); ++git) { - notify->AddFeedItem(RS_FEED_ITEM_CHANNEL_NEW, git->toStdString()); + if(mKnownChannels.find(*git) == mKnownChannels.end()) + { + notify->AddFeedItem(RS_FEED_ITEM_CHANNEL_NEW, git->toStdString()); + mKnownChannels.insert(*git) ; + } + else + std::cerr << "(II) Not notifying already known channel " << *git << std::endl; } break; } diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index ccdca94f5..db73448cd 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -218,6 +218,7 @@ bool generateGroup(uint32_t &token, std::string groupName); RsGxsMessageId mGenThreadId; p3GxsCommentService *mCommentService; + std::set mKnownChannels; }; #endif diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index f27c255dd..29c7ed6c7 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -142,9 +142,16 @@ void p3GxsForums::notifyChanges(std::vector &changes) /* group received */ std::list &grpList = grpChange->mGrpIdList; std::list::iterator git; + for (git = grpList.begin(); git != grpList.end(); ++git) { - notify->AddFeedItem(RS_FEED_ITEM_FORUM_NEW, git->toStdString()); + if(mKnownForums.find(*git) == mKnownForums.end()) + { + notify->AddFeedItem(RS_FEED_ITEM_FORUM_NEW, git->toStdString()); + mKnownForums.insert(*git) ; + } + else + std::cerr << "(II) Not notifying already known forum " << *git << std::endl; } break; } diff --git a/libretroshare/src/services/p3gxsforums.h b/libretroshare/src/services/p3gxsforums.h index 7f659469c..1e2e78d92 100644 --- a/libretroshare/src/services/p3gxsforums.h +++ b/libretroshare/src/services/p3gxsforums.h @@ -117,6 +117,7 @@ bool generateGroup(uint32_t &token, std::string groupName); int mGenCount; std::vector mGenRefs; RsGxsMessageId mGenThreadId; + std::set mKnownForums ; };