diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index 43c48c361..3c66ed085 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -198,27 +198,6 @@ bool p3GxsChannels::getRelatedPosts(const uint32_t &token, std::vectormeta.mMsgId == (mit->first).second) - { - std::cerr << "p3GxsChannels::getRelatedPosts()"; - std::cerr << " ERROR Found Original - discarding"; - std::cerr << " Id: " << item->meta.mMsgId; - std::cerr << std::endl; - delete item; - continue; - } - - if (item->meta.mParentId != (mit->first).second) - { - std::cerr << "p3GxsChannels::getRelatedPosts()"; - std::cerr << " ERROR Found !CHILD - discarding"; - std::cerr << " Id: " << item->meta.mMsgId; - std::cerr << std::endl; - delete item; - continue; - } - RsGxsChannelPost msg = item->mMsg; msg.mMeta = item->meta; msgs.push_back(msg); diff --git a/libretroshare/src/services/p3gxscommon.cc b/libretroshare/src/services/p3gxscommon.cc index fba4cf6dd..d6c9b4ff3 100644 --- a/libretroshare/src/services/p3gxscommon.cc +++ b/libretroshare/src/services/p3gxscommon.cc @@ -59,7 +59,7 @@ RsGxsVote::RsGxsVote() /******************* Startup / Tick ******************************************/ /********************************************************************************/ -p3GxsCommentService::p3GxsCommentService(RsGenExchange *exchange, uint32_t service_type) +p3GxsCommentService::p3GxsCommentService(RsGenExchange *exchange, uint16_t service_type) : mExchange(exchange), mServiceType(service_type) { return; @@ -67,6 +67,9 @@ p3GxsCommentService::p3GxsCommentService(RsGenExchange *exchange, uint32_t servi bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vector &comments) { + std::cerr << "p3GxsCommentService::getGxsCommentData()"; + std::cerr << std::endl; + GxsMsgDataMap msgData; bool ok = mExchange->getMsgData(token, msgData); @@ -127,11 +130,20 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vectorsecond; } + + + } return ok; @@ -140,6 +152,9 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vector &comments) { + std::cerr << "p3GxsCommentService::getGxsRelatedComments()"; + std::cerr << std::endl; + GxsMsgRelatedDataMap msgData; bool ok = mExchange->getMsgRelatedData(token, msgData); @@ -159,27 +174,6 @@ bool p3GxsCommentService::getGxsRelatedComments(const uint32_t &token, std::vect if(item) { - /* HACK UNTIL CHRIS FIXES RELATED MSGS in GXS */ - if (item->meta.mMsgId == (mit->first).second) - { - std::cerr << "p3GxsChannels::getRelatedComments()"; - std::cerr << " ERROR Found Original - discarding"; - std::cerr << " Id: " << item->meta.mMsgId; - std::cerr << std::endl; - delete item; - continue; - } - - if (item->meta.mParentId != (mit->first).second) - { - std::cerr << "p3GxsChannels::getRelatedComments()"; - std::cerr << " ERROR Found !CHILD - discarding"; - std::cerr << " Id: " << item->meta.mMsgId; - std::cerr << std::endl; - delete item; - continue; - } - RsGxsComment comment = item->mMsg; comment.mMeta = item->meta; comments.push_back(comment); @@ -218,6 +212,12 @@ bool p3GxsCommentService::getGxsRelatedComments(const uint32_t &token, std::vect } } } + + std::cerr << "p3GxsCommentService::getGxsRelatedComments() Found " << comments.size() << " Comments"; + std::cerr << std::endl; + std::cerr << "p3GxsCommentService::getGxsRelatedComments() Found " << voteMap.size() << " Votes"; + std::cerr << std::endl; + /* delete the votes */ for (it = voteMap.begin(); it != voteMap.end(); it++) { diff --git a/libretroshare/src/services/p3gxscommon.h b/libretroshare/src/services/p3gxscommon.h index 6130d6cc8..6832927aa 100644 --- a/libretroshare/src/services/p3gxscommon.h +++ b/libretroshare/src/services/p3gxscommon.h @@ -37,7 +37,7 @@ class p3GxsCommentService { public: - p3GxsCommentService(RsGenExchange *exchange, uint32_t service_type); + p3GxsCommentService(RsGenExchange *exchange, uint16_t service_type); bool getGxsCommentData(const uint32_t &token, std::vector &msgs); bool getGxsRelatedComments(const uint32_t &token, std::vector &msgs); @@ -52,7 +52,7 @@ class p3GxsCommentService private: RsGenExchange *mExchange; - uint32_t mServiceType; + uint16_t mServiceType; }; diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index 507b93f1a..beefc1640 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -175,27 +175,6 @@ bool p3GxsForums::getRelatedMessages(const uint32_t &token, std::vectormeta.mMsgId == (mit->first).second) - { - std::cerr << "p3GxsForums::getRelatedMessages()"; - std::cerr << " ERROR Found Original - discarding"; - std::cerr << " Id: " << item->meta.mMsgId; - std::cerr << std::endl; - delete item; - continue; - } - - if (item->meta.mParentId != (mit->first).second) - { - std::cerr << "p3GxsForums::getRelatedMessages()"; - std::cerr << " ERROR Found !CHILD - discarding"; - std::cerr << " Id: " << item->meta.mMsgId; - std::cerr << std::endl; - delete item; - continue; - } - RsGxsForumMsg msg = item->mMsg; msg.mMeta = item->meta; msgs.push_back(msg);