mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fixed service_type => 16bits in gxscomments.
Removed OLD RelatedMessage() data checks - which we killing comment tree. Added debug indicating comment / vote counts. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6191 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0f78719d7f
commit
d39460bec0
@ -198,27 +198,6 @@ bool p3GxsChannels::getRelatedPosts(const uint32_t &token, std::vector<RsGxsChan
|
||||
|
||||
if(item)
|
||||
{
|
||||
/* HACK UNTIL CHRIS FIXES RELATED MSGS in GXS */
|
||||
if (item->meta.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);
|
||||
|
@ -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<RsGxsComment> &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::vector<R
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::cerr << "p3GxsCommentService::getGxsCommentData() Found " << comments.size() << " Comments";
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "p3GxsCommentService::getGxsCommentData() Found " << voteMap.size() << " Votes";
|
||||
std::cerr << std::endl;
|
||||
|
||||
/* delete the votes */
|
||||
for (it = voteMap.begin(); it != voteMap.end(); it++)
|
||||
{
|
||||
delete it->second;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return ok;
|
||||
@ -140,6 +152,9 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vector<R
|
||||
|
||||
bool p3GxsCommentService::getGxsRelatedComments(const uint32_t &token, std::vector<RsGxsComment> &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++)
|
||||
{
|
||||
|
@ -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<RsGxsComment> &msgs);
|
||||
bool getGxsRelatedComments(const uint32_t &token, std::vector<RsGxsComment> &msgs);
|
||||
@ -52,7 +52,7 @@ class p3GxsCommentService
|
||||
private:
|
||||
|
||||
RsGenExchange *mExchange;
|
||||
uint32_t mServiceType;
|
||||
uint16_t mServiceType;
|
||||
};
|
||||
|
||||
|
||||
|
@ -175,27 +175,6 @@ bool p3GxsForums::getRelatedMessages(const uint32_t &token, std::vector<RsGxsFor
|
||||
|
||||
if(item)
|
||||
{
|
||||
/* HACK UNTIL CHRIS FIXES RELATED MSGS in GXS */
|
||||
if (item->meta.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);
|
||||
|
Loading…
Reference in New Issue
Block a user