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

@ -219,8 +219,14 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
std::list<RsGxsGroupId> &grpList = grpChange->mGrpIdList; std::list<RsGxsGroupId> &grpList = grpChange->mGrpIdList;
std::list<RsGxsGroupId>::iterator git; std::list<RsGxsGroupId>::iterator git;
for (git = grpList.begin(); git != grpList.end(); ++git) for (git = grpList.begin(); git != grpList.end(); ++git)
{
if(mKnownChannels.find(*git) == mKnownChannels.end())
{ {
notify->AddFeedItem(RS_FEED_ITEM_CHANNEL_NEW, git->toStdString()); 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; break;
} }

View File

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

View File

@ -142,9 +142,16 @@ void p3GxsForums::notifyChanges(std::vector<RsGxsNotify *> &changes)
/* group received */ /* group received */
std::list<RsGxsGroupId> &grpList = grpChange->mGrpIdList; std::list<RsGxsGroupId> &grpList = grpChange->mGrpIdList;
std::list<RsGxsGroupId>::iterator git; std::list<RsGxsGroupId>::iterator git;
for (git = grpList.begin(); git != grpList.end(); ++git) for (git = grpList.begin(); git != grpList.end(); ++git)
{
if(mKnownForums.find(*git) == mKnownForums.end())
{ {
notify->AddFeedItem(RS_FEED_ITEM_FORUM_NEW, git->toStdString()); 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; break;
} }

View File

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