group modifications now propagate

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3067 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2010-06-05 11:19:04 +00:00
parent 2d087cea4c
commit 0470477bcc
2 changed files with 9 additions and 3 deletions

View File

@ -30,6 +30,7 @@
#define RS_DISTRIB_PRIVACY_MASK 0x000f /* who can publish & view */
#define RS_DISTRIB_AUTHEN_MASK 0x00f0 /* how to publish */
#define RS_DISTRIB_LISTEN_MASK 0x0f00 /* distribution flags */
#define RS_DISTRIB_UPDATE_MASK 0xf000 /* if sending a group info update */
#define RS_DISTRIB_PUBLIC 0x0001 /* anyone can publish */
#define RS_DISTRIB_PRIVATE 0x0002 /* anyone with key can publish */
@ -42,5 +43,7 @@
#define RS_DISTRIB_PUBLISH 0x0200
#define RS_DISTRIB_SUBSCRIBED 0x0400
#define RS_DISTRIB_UPDATE 0x1000
#endif

View File

@ -894,6 +894,8 @@ void p3GroupDistrib::publishDistribGroups()
{
/* store in Cache File */
store->SendItem(grp); /* no delete */
grp->grpFlags &= (~RS_DISTRIB_UPDATE); // if this is an update, ensure flag is removed after publication
}
/* if they have public keys, publish these too */
@ -2223,7 +2225,7 @@ bool p3GroupDistrib::locked_checkGroupInfo(GroupInfo &info, RsDistribGrp *newGr
/* groupInfo */
/* If adminKey is the same and
* timestamp is <= timestamp,
* timestamp is <= timestamp, or not an update (info edit)
* then just discard it.
*/
@ -2237,7 +2239,7 @@ bool p3GroupDistrib::locked_checkGroupInfo(GroupInfo &info, RsDistribGrp *newGr
}
if ((info.distribGroup) &&
(info.distribGroup->timestamp <= newGrp->timestamp))
((info.distribGroup->timestamp <= newGrp->timestamp) && !(newGrp->grpFlags & RS_DISTRIB_UPDATE)))
{
#ifdef DISTRIB_DEBUG
std::cerr << "p3GroupDistrib::locked_checkGroupInfo() Group Data Old/Same";
@ -2247,7 +2249,6 @@ bool p3GroupDistrib::locked_checkGroupInfo(GroupInfo &info, RsDistribGrp *newGr
return false;
}
/* otherwise validate it */
return validateDistribGrp(newGrp);
}
@ -2351,6 +2352,8 @@ bool p3GroupDistrib::locked_editGroup(std::string grpId, GroupInfo& gi){
}
gi_curr->distribGroup->grpFlags |= RS_DISTRIB_UPDATE;
// create new signature for group
EVP_PKEY *key_admin = gi_curr->adminKey.key;