00001
00034 #include "linden_common.h"
00035 #include "lluserrelations.h"
00036
00037
00038 const U8 LLRelationship::GRANTED_VISIBLE_MASK = LLRelationship::GRANT_MODIFY_OBJECTS | LLRelationship::GRANT_MAP_LOCATION;
00039 const LLRelationship LLRelationship::DEFAULT_RELATIONSHIP = LLRelationship(GRANT_ONLINE_STATUS, GRANT_ONLINE_STATUS, false);
00040
00041 LLRelationship::LLRelationship() :
00042 mGrantToAgent(0),
00043 mGrantFromAgent(0),
00044 mIsOnline(false)
00045 {
00046 }
00047
00048 LLRelationship::LLRelationship(S32 grant_to, S32 grant_from, bool is_online) :
00049 mGrantToAgent(grant_to),
00050 mGrantFromAgent(grant_from),
00051 mIsOnline(is_online)
00052 {
00053 }
00054
00055 bool LLRelationship::isOnline() const
00056 {
00057 return mIsOnline;
00058 }
00059
00060 void LLRelationship::online(bool is_online)
00061 {
00062 mIsOnline = is_online;
00063 }
00064
00065 bool LLRelationship::isRightGrantedTo(S32 rights) const
00066 {
00067 return ((mGrantToAgent & rights) == rights);
00068 }
00069
00070 bool LLRelationship::isRightGrantedFrom(S32 rights) const
00071 {
00072 return ((mGrantFromAgent & rights) == rights);
00073 }
00074
00075 S32 LLRelationship::getRightsGrantedTo() const
00076 {
00077 return mGrantToAgent;
00078 }
00079
00080 S32 LLRelationship::getRightsGrantedFrom() const
00081 {
00082 return mGrantFromAgent;
00083 }
00084
00085 void LLRelationship::grantRights(S32 to_agent, S32 from_agent)
00086 {
00087 mGrantToAgent |= to_agent;
00088 mGrantFromAgent |= from_agent;
00089 }
00090
00091 void LLRelationship::revokeRights(S32 to_agent, S32 from_agent)
00092 {
00093 mGrantToAgent &= ~to_agent;
00094 mGrantFromAgent &= ~from_agent;
00095 }
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112