added private groups option to forums

fix for grp edit in p3distrib

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4579 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2011-08-29 21:20:48 +00:00
parent 35a059c44c
commit 3ff69a1be5
12 changed files with 578 additions and 268 deletions

View file

@ -148,6 +148,14 @@ virtual bool ForumMessageSend(ForumMsgInfo &info) = 0;
virtual bool forumRestoreKeys(const std::string& fId) = 0;
virtual bool forumSubscribe(const std::string &fId, bool subscribe) = 0;
/*!
* shares keys with peers
*@param fId the forum for which private publish keys will be shared
*@param peers list of peers to be sent keys
*
*/
virtual bool forumShareKeys(std::string fId, std::list<std::string>& peers) = 0;
virtual bool getMessageCount(const std::string &fId, unsigned int &newCount, unsigned int &unreadCount) = 0;
/****************************************/

View file

@ -2134,7 +2134,6 @@ void p3GroupDistrib::publishDistribGroups()
store->SendItem(grp); /* no delete */
grp->PeerId(tempPeerId);
grp->grpFlags &= (~RS_DISTRIB_UPDATE); // if this is an update, ensure flag is removed after publication
}
/* if they have public keys, publish these too */
@ -2521,6 +2520,7 @@ bool p3GroupDistrib::attemptPublishKeysRecvd()
mRecvdPubKeys.erase(*sit);
if(!toDelete.empty()) IndicateConfigChanged();
return true;
@ -3703,8 +3703,7 @@ bool p3GroupDistrib::locked_checkGroupInfo(GroupInfo &info, RsDistribGrp *newGr
return false;
}
if ((info.distribGroup) &&
((info.distribGroup->timestamp <= newGrp->timestamp) && !(newGrp->grpFlags & RS_DISTRIB_UPDATE)))
if ((info.distribGroup) && (newGrp->timestamp <= info.distribGroup->timestamp))
{
#ifdef DISTRIB_DEBUG
std::cerr << "p3GroupDistrib::locked_checkGroupInfo() Group Data Old/Same";
@ -3846,9 +3845,6 @@ bool p3GroupDistrib::locked_editGroup(std::string grpId, GroupInfo& gi){
gi_curr->grpChanged = true;
mGroupsRepublish = true;
// this is removed afterwards
gi_curr->distribGroup->grpFlags |= RS_DISTRIB_UPDATE;
delete[] data;
delete serialType;
EVP_MD_CTX_destroy(mdctx);

View file

@ -639,6 +639,16 @@ bool p3Forums::locked_eventDuplicateMsg(GroupInfo */*grp*/, RsDistribMsg */*msg*
return true;
}
bool p3Forums::forumShareKeys(std::string fId, std::list<std::string>& peers)
{
#ifdef FORUM_DEBUG
std::cerr << "p3Forums::forumShareKeys() " << fId << std::endl;
#endif
return sharePubKey(fId, peers);
}
bool p3Forums::locked_eventNewMsg(GroupInfo */*grp*/, RsDistribMsg *msg, const std::string& /*id*/, bool historical)
{
std::string grpId = msg->grpId;

View file

@ -59,7 +59,7 @@ virtual bool ForumMessageSend(ForumMsgInfo &info);
virtual bool setMessageStatus(const std::string& fId, const std::string& mId, const uint32_t status, const uint32_t statusMask);
virtual bool getMessageStatus(const std::string& fId, const std::string& mId, uint32_t& status);
virtual bool forumRestoreKeys(const std::string& fId);
virtual bool forumShareKeys(std::string fId, std::list<std::string>& peers);
virtual bool forumSubscribe(const std::string &fId, bool subscribe);
virtual bool getMessageCount(const std::string &fId, unsigned int &newCount, unsigned int &unreadCount);