Added posted comment creation

contextMnurequested does not seem to be working....may have to use an old fashioned non-derived treewidget.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5894 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2012-11-25 21:50:45 +00:00
parent 744a78b140
commit 8cef4da896
18 changed files with 357 additions and 202 deletions

View file

@ -68,6 +68,7 @@ class RsPostedVote;
typedef std::map<RsGxsGroupId, std::vector<RsPostedPost> > PostedPostResult;
typedef std::map<RsGxsGroupId, std::vector<RsPostedComment> > PostedCommentResult;
typedef std::map<RsGxsGroupId, std::vector<RsPostedVote> > PostedVoteResult;
typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsPostedComment> > PostedRelatedCommentResult;
typedef std::pair<RsGxsGroupId, int32_t> GroupRank;
std::ostream &operator<<(std::ostream &out, const RsPostedGroup &group);
@ -93,6 +94,7 @@ virtual ~RsPosted() { return; }
virtual bool getGroup(const uint32_t &token, std::vector<RsPostedGroup> &group) = 0;
virtual bool getPost(const uint32_t &token, PostedPostResult &post) = 0;
virtual bool getComment(const uint32_t &token, PostedCommentResult &comment) = 0;
virtual bool getRelatedComment(const uint32_t& token, PostedRelatedCommentResult& comments) = 0;
virtual bool getGroupRank(const uint32_t &token, GroupRank& grpRank) = 0;
virtual bool submitGroup(uint32_t &token, RsPostedGroup &group) = 0;
@ -132,6 +134,7 @@ class RsPostedVote
RsMsgMetaData mMeta;
};
class RsGxsPostedCommentItem;
class RsPostedComment
{
@ -142,6 +145,7 @@ class RsPostedComment
return;
}
RsPostedComment(const RsGxsPostedCommentItem& );
std::string mComment;
RsMsgMetaData mMeta;
};

View file

@ -7,6 +7,12 @@ const uint32_t RsPosted::FLAG_MSGTYPE_VOTE = 0x0004;
RsPosted *rsPosted = NULL;
RsPostedComment::RsPostedComment(const RsGxsPostedCommentItem & item)
{
mComment = item.mComment.mComment;
mMeta = item.meta;
}
p3Posted::p3Posted(RsGeneralDataService *gds, RsNetworkExchangeService *nes)
: RsGenExchange(gds, nes, new RsGxsPostedSerialiser(), RS_SERVICE_GXSV1_TYPE_POSTED), RsPosted(this)
{
@ -118,6 +124,11 @@ bool p3Posted::getComment(const uint32_t &token, PostedCommentResult &comments)
return ok;
}
bool p3Posted::getRelatedComment(const uint32_t& token, PostedRelatedCommentResult &comments)
{
return RsGenExchange::getMsgRelatedDataT<RsGxsPostedCommentItem, RsPostedComment>(token, comments);
}
bool p3Posted::getGroupRank(const uint32_t &token, GroupRank &grpRank)
{

View file

@ -29,6 +29,7 @@ public:
bool getGroup(const uint32_t &token, std::vector<RsPostedGroup> &group);
bool getPost(const uint32_t &token, PostedPostResult& posts) ;
bool getComment(const uint32_t &token, PostedCommentResult& comments) ;
bool getRelatedComment(const uint32_t& token, PostedRelatedCommentResult &comments);
bool getGroupRank(const uint32_t& token, GroupRank& grpRank);
bool submitGroup(uint32_t &token, RsPostedGroup &group);