diff options
Diffstat (limited to 'indra/llinventory')
-rw-r--r-- | indra/llinventory/lluserrelations.cpp | 5 | ||||
-rw-r--r-- | indra/llinventory/lluserrelations.h | 15 |
2 files changed, 18 insertions, 2 deletions
diff --git a/indra/llinventory/lluserrelations.cpp b/indra/llinventory/lluserrelations.cpp index 0f1b48ecd1..e96cb1e1c1 100644 --- a/indra/llinventory/lluserrelations.cpp +++ b/indra/llinventory/lluserrelations.cpp @@ -41,6 +41,7 @@ const LLRelationship LLRelationship::DEFAULT_RELATIONSHIP = LLRelationship(GRANT LLRelationship::LLRelationship() : mGrantToAgent(0), mGrantFromAgent(0), + mChangeSerialNum(0), mIsOnline(false) { } @@ -48,6 +49,7 @@ LLRelationship::LLRelationship() : LLRelationship::LLRelationship(S32 grant_to, S32 grant_from, bool is_online) : mGrantToAgent(grant_to), mGrantFromAgent(grant_from), + mChangeSerialNum(0), mIsOnline(is_online) { } @@ -60,6 +62,7 @@ bool LLRelationship::isOnline() const void LLRelationship::online(bool is_online) { mIsOnline = is_online; + mChangeSerialNum++; } bool LLRelationship::isRightGrantedTo(S32 rights) const @@ -86,12 +89,14 @@ void LLRelationship::grantRights(S32 to_agent, S32 from_agent) { mGrantToAgent |= to_agent; mGrantFromAgent |= from_agent; + mChangeSerialNum++; } void LLRelationship::revokeRights(S32 to_agent, S32 from_agent) { mGrantToAgent &= ~to_agent; mGrantFromAgent &= ~from_agent; + mChangeSerialNum++; } diff --git a/indra/llinventory/lluserrelations.h b/indra/llinventory/lluserrelations.h index 448301383e..36472215f6 100644 --- a/indra/llinventory/lluserrelations.h +++ b/indra/llinventory/lluserrelations.h @@ -142,8 +142,18 @@ public: */ S32 getRightsGrantedFrom() const; - void setRightsTo(S32 to_agent) { mGrantToAgent = to_agent; } - void setRightsFrom(S32 from_agent) { mGrantFromAgent = from_agent; } + void setRightsTo(S32 to_agent) { mGrantToAgent = to_agent; mChangeSerialNum++; } + void setRightsFrom(S32 from_agent) { mGrantFromAgent = from_agent; mChangeSerialNum++;} + + /** + * @brief Get the change count for this agent + * + * Every change to rights will increment the serial number + * allowing listeners to determine when a relationship value is actually new + * + * @return change serial number for relationship + */ + S32 getChangeSerialNum() const { return mChangeSerialNum; } /** * @brief Grant a set of rights. @@ -171,6 +181,7 @@ public: protected: S32 mGrantToAgent; S32 mGrantFromAgent; + S32 mChangeSerialNum; bool mIsOnline; }; |