added updateGroup functions to gxs services.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7101 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2014-02-09 10:33:16 +00:00
parent 0fd46e4f2b
commit d9e483c48a
10 changed files with 61 additions and 0 deletions

View File

@ -109,6 +109,8 @@ virtual bool subscribeToGroup(uint32_t &token, const RsGxsGroupId &groupId, bool
virtual bool createGroup(uint32_t &token, RsGxsChannelGroup &group) = 0; virtual bool createGroup(uint32_t &token, RsGxsChannelGroup &group) = 0;
virtual bool createPost(uint32_t &token, RsGxsChannelPost &post) = 0; virtual bool createPost(uint32_t &token, RsGxsChannelPost &post) = 0;
virtual bool updateGroup(uint32_t &token, RsGxsGroupUpdateMeta& meta, RsGxsChannelGroup &group) = 0;
// File Interface // File Interface
virtual bool ExtraFileHash(const std::string &path, std::string filename) = 0; virtual bool ExtraFileHash(const std::string &path, std::string filename) = 0;
virtual bool ExtraFileRemove(const std::string &hash) = 0; virtual bool ExtraFileRemove(const std::string &hash) = 0;

View File

@ -64,6 +64,8 @@ public:
// for circles // for circles
std::string mCircleId; std::string mCircleId;
uint32_t mCircleType; uint32_t mCircleType;
// other stuff.
uint32_t mAuthenFlags; uint32_t mAuthenFlags;
std::string mParentGrpId; std::string mParentGrpId;

View File

@ -98,6 +98,7 @@ virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgI
virtual bool createGroup(uint32_t &token, RsPostedGroup &group) = 0; virtual bool createGroup(uint32_t &token, RsPostedGroup &group) = 0;
virtual bool createPost(uint32_t &token, RsPostedPost &post) = 0; virtual bool createPost(uint32_t &token, RsPostedPost &post) = 0;
virtual bool updateGroup(uint32_t &token, RsGxsGroupUpdateMeta& meta, RsPostedGroup &group) = 0;
}; };

View File

@ -131,6 +131,8 @@ virtual bool submitCollection(uint32_t &token, RsWikiCollection &collection) = 0
virtual bool submitSnapshot(uint32_t &token, RsWikiSnapshot &snapshot) = 0; virtual bool submitSnapshot(uint32_t &token, RsWikiSnapshot &snapshot) = 0;
virtual bool submitComment(uint32_t &token, RsWikiComment &comment) = 0; virtual bool submitComment(uint32_t &token, RsWikiComment &comment) = 0;
virtual bool updateCollection(uint32_t &token, RsGxsGroupUpdateMeta& meta, RsWikiCollection &collection) = 0;
}; };
#endif #endif

View File

@ -805,6 +805,23 @@ bool p3GxsChannels::createGroup(uint32_t &token, RsGxsChannelGroup &group)
} }
bool p3GxsChannels::updateGroup(uint32_t &token, RsGxsGroupUpdateMeta& meta, RsGxsChannelGroup &group)
{
std::cerr << "p3GxsChannels::updateGroup()" << std::endl;
if(meta.getGroupId().empty())
return false;
RsGxsChannelGroupItem* grpItem = new RsGxsChannelGroupItem();
grpItem->fromChannelGroup(group, true);
grpItem->meta.mGroupId = meta.getGroupId();
RsGenExchange::updateGroup(token, meta, grpItem);
return true;
}
bool p3GxsChannels::createPost(uint32_t &token, RsGxsChannelPost &msg) bool p3GxsChannels::createPost(uint32_t &token, RsGxsChannelPost &msg)
{ {
std::cerr << "p3GxsChannels::createChannelPost() GroupId: " << msg.mMeta.mGroupId; std::cerr << "p3GxsChannels::createChannelPost() GroupId: " << msg.mMeta.mGroupId;

View File

@ -92,6 +92,8 @@ virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsGxsChannelPost
virtual bool createGroup(uint32_t &token, RsGxsChannelGroup &group); virtual bool createGroup(uint32_t &token, RsGxsChannelGroup &group);
virtual bool createPost(uint32_t &token, RsGxsChannelPost &post); virtual bool createPost(uint32_t &token, RsGxsChannelPost &post);
virtual bool updateGroup(uint32_t &token, RsGxsGroupUpdateMeta& meta, RsGxsChannelGroup &group);
// no tokens... should be cached. // no tokens... should be cached.
virtual bool setChannelAutoDownload(const RsGxsGroupId &groupId, bool enabled); virtual bool setChannelAutoDownload(const RsGxsGroupId &groupId, bool enabled);
virtual bool getChannelAutoDownload(const RsGxsGroupId &groupid); virtual bool getChannelAutoDownload(const RsGxsGroupId &groupid);

View File

@ -219,6 +219,23 @@ bool p3Posted::createGroup(uint32_t &token, RsPostedGroup &group)
} }
bool p3Posted::updateGroup(uint32_t &token, RsGxsGroupUpdateMeta& meta, RsPostedGroup &group)
{
std::cerr << "p3Posted::updateGroup()" << std::endl;
if(meta.getGroupId().empty())
return false;
RsGxsPostedGroupItem* grpItem = new RsGxsPostedGroupItem();
grpItem->mGroup = group;
grpItem->meta = group.mMeta;
grpItem->meta.mGroupId = meta.getGroupId();
RsGenExchange::updateGroup(token, meta, grpItem);
return true;
}
bool p3Posted::createPost(uint32_t &token, RsPostedPost &msg) bool p3Posted::createPost(uint32_t &token, RsPostedPost &msg)
{ {
std::cerr << "p3Posted::createPost() GroupId: " << msg.mMeta.mGroupId; std::cerr << "p3Posted::createPost() GroupId: " << msg.mMeta.mGroupId;

View File

@ -68,6 +68,8 @@ virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsPostedPost> &p
virtual bool createGroup(uint32_t &token, RsPostedGroup &group); virtual bool createGroup(uint32_t &token, RsPostedGroup &group);
virtual bool createPost(uint32_t &token, RsPostedPost &post); virtual bool createPost(uint32_t &token, RsPostedPost &post);
virtual bool updateGroup(uint32_t &token, RsGxsGroupUpdateMeta& meta, RsPostedGroup &group);
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// WRAPPERS due to the separate Interface. // WRAPPERS due to the separate Interface.

View File

@ -299,6 +299,21 @@ bool p3Wiki::submitComment(uint32_t &token, RsWikiComment &comment)
return true; return true;
} }
bool p3Wiki::updateCollection(uint32_t &token, RsGxsGroupUpdateMeta& meta, RsWikiCollection &group)
{
std::cerr << "p3Wiki::updateCollection()" << std::endl;
if(meta.getGroupId().empty())
return false;
RsGxsWikiCollectionItem* grpItem = new RsGxsWikiCollectionItem();
grpItem->collection = group;
grpItem->meta = group.mMeta;
grpItem->meta.mGroupId = meta.getGroupId();
RsGenExchange::updateGroup(token, meta, grpItem);
return true;
}
std::ostream &operator<<(std::ostream &out, const RsWikiCollection &group) std::ostream &operator<<(std::ostream &out, const RsWikiCollection &group)

View File

@ -69,6 +69,7 @@ virtual bool submitCollection(uint32_t &token, RsWikiCollection &collection);
virtual bool submitSnapshot(uint32_t &token, RsWikiSnapshot &snapshot); virtual bool submitSnapshot(uint32_t &token, RsWikiSnapshot &snapshot);
virtual bool submitComment(uint32_t &token, RsWikiComment &comment); virtual bool submitComment(uint32_t &token, RsWikiComment &comment);
virtual bool updateCollection(uint32_t &token, RsGxsGroupUpdateMeta& meta, RsWikiCollection &collection);
private: private: