qick fix to allow re-advertising for known forums/channels during the same session. Will be reset at restart (probably best)

This commit is contained in:
csoler 2017-03-05 14:14:46 +01:00
parent fbd72ddf73
commit b71f4757fe
4 changed files with 17 additions and 2 deletions

View File

@ -220,7 +220,13 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
std::list<RsGxsGroupId>::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;
}

View File

@ -218,6 +218,7 @@ bool generateGroup(uint32_t &token, std::string groupName);
RsGxsMessageId mGenThreadId;
p3GxsCommentService *mCommentService;
std::set<RsGxsGroupId> mKnownChannels;
};
#endif

View File

@ -142,9 +142,16 @@ void p3GxsForums::notifyChanges(std::vector<RsGxsNotify *> &changes)
/* group received */
std::list<RsGxsGroupId> &grpList = grpChange->mGrpIdList;
std::list<RsGxsGroupId>::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;
}

View File

@ -117,6 +117,7 @@ bool generateGroup(uint32_t &token, std::string groupName);
int mGenCount;
std::vector<ForumDummyRef> mGenRefs;
RsGxsMessageId mGenThreadId;
std::set<RsGxsGroupId> mKnownForums ;
};