#include <lluserrelations.h>
enum | { GRANT_NONE = 0x0, GRANT_ONLINE_STATUS = 0x1, GRANT_MAP_LOCATION = 0x2, GRANT_MODIFY_OBJECTS = 0x4 } |
Anonymous enumeration for specifying rights. More... | |
static const U8 | GRANTED_VISIBLE_MASK = LLRelationship::GRANT_MODIFY_OBJECTS | LLRelationship::GRANT_MAP_LOCATION |
bool | isRightGrantedTo (S32 rights) const |
Check for a set of rights granted to agent. | |
bool | isRightGrantedFrom (S32 rights) const |
Check for a set of rights granted from an agent. | |
S32 | getRightsGrantedTo () const |
Get the rights granted to the other agent. | |
S32 | getRightsGrantedFrom () const |
Get the rights granted from the other agent. | |
void | setRightsTo (S32 to_agent) |
void | setRightsFrom (S32 from_agent) |
S32 | getChangeSerialNum () const |
Get the change count for this agent. | |
void | grantRights (S32 to_agent, S32 from_agent) |
Grant a set of rights. | |
void | revokeRights (S32 to_agent, S32 from_agent) |
Revoke a set of rights. | |
Public Member Functions | |
LLRelationship () | |
Constructors. | |
LLRelationship (S32 grant_to, S32 grant_from, bool is_online) | |
Status functionality | |
I thought it would be keen to have a generic status interface, but the only thing we currently cache is online status. As this assumption changes, this API may evolve. | |
bool | isOnline () const |
Does this instance believe the related agent is currently online or available. | |
void | online (bool is_online) |
Set the online status. | |
Static Public Attributes | |
static const LLRelationship | DEFAULT_RELATIONSHIP = LLRelationship(GRANT_ONLINE_STATUS, GRANT_ONLINE_STATUS, false) |
Protected Attributes | |
S32 | mGrantToAgent |
S32 | mGrantFromAgent |
S32 | mChangeSerialNum |
bool | mIsOnline |
You are expected to use this in a map or similar structure, eg: typedef std::map<LLUUID, LLRelationship> agent_relationship_map;
Definition at line 52 of file lluserrelations.h.
anonymous enum |
LLRelationship::LLRelationship | ( | ) |
Definition at line 49 of file lluserrelations.cpp.
bool LLRelationship::isOnline | ( | ) | const |
Does this instance believe the related agent is currently online or available.
NOTE: This API may be deprecated if there is any transient status other than online status, for example, away/busy/etc.
This call does not check any kind of central store or make any deep information calls - it simply checks a cache of online status.
Definition at line 57 of file lluserrelations.cpp.
References mIsOnline.
Referenced by LLAvatarTracker::addBuddyList(), LLPanelFriends::addFriend(), deliver_message(), LLAvatarTracker::isBuddyOnline(), LLIMMgr::noteOfflineUsers(), LLCollectAllBuddies::operator()(), LLCollectOnlineBuddies::operator()(), LLCollectMappableBuddies::operator()(), LLPanelFriends::refreshRightsChangeList(), LLTracker::render3D(), and LLPanelFriends::updateFriendItem().
void LLRelationship::online | ( | bool | is_online | ) |
Set the online status.
NOTE: This API may be deprecated if there is any transient status other than online status.
is_online | Se the online status |
Definition at line 62 of file lluserrelations.cpp.
References mChangeSerialNum, and mIsOnline.
Referenced by LLAvatarTracker::setBuddyOnline().
bool LLRelationship::isRightGrantedTo | ( | S32 | rights | ) | const |
Check for a set of rights granted to agent.
rights | A bitfield to check for rights. |
Definition at line 68 of file lluserrelations.cpp.
References mGrantToAgent.
Referenced by LLPanelFriends::addFriend(), LLPanelFriends::applyRightsToFriends(), LLPanelFriends::handleRemove(), LLAvatarTracker::isBuddyEmpowered(), and LLPanelFriends::updateFriendItem().
bool LLRelationship::isRightGrantedFrom | ( | S32 | rights | ) | const |
Check for a set of rights granted from an agent.
rights | A bitfield to check for rights. |
Definition at line 73 of file lluserrelations.cpp.
References mGrantFromAgent.
Referenced by LLPanelFriends::addFriend(), LLFloaterWorldMap::friendsChanged(), LLCollectMappableBuddies::operator()(), and LLCollectProxyBuddies::operator()().
S32 LLRelationship::getRightsGrantedTo | ( | ) | const |
Get the rights granted to the other agent.
Definition at line 78 of file lluserrelations.cpp.
References mGrantToAgent.
Referenced by LLAvatarTracker::addBuddyList(), and LLPanelFriends::applyRightsToFriends().
S32 LLRelationship::getRightsGrantedFrom | ( | ) | const |
Get the rights granted from the other agent.
Definition at line 83 of file lluserrelations.cpp.
References mGrantFromAgent.
void LLRelationship::setRightsTo | ( | S32 | to_agent | ) | [inline] |
void LLRelationship::setRightsFrom | ( | S32 | from_agent | ) | [inline] |
S32 LLRelationship::getChangeSerialNum | ( | ) | const [inline] |
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
Definition at line 156 of file lluserrelations.h.
References mChangeSerialNum.
Referenced by LLPanelFriends::addFriend(), and LLPanelFriends::updateFriendItem().
Grant a set of rights.
Any bit which is set will grant that right if it is set in the instance. You can pass in LLGrantedRights::NONE to not change that field.
to_agent | The rights to grant to agent_id. | |
from_agent | The rights granted from agent_id. |
Definition at line 88 of file lluserrelations.cpp.
References mChangeSerialNum, mGrantFromAgent, and mGrantToAgent.
Referenced by LLAvatarTracker::setBuddyEmpowered().
Revoke a set of rights.
Any bit which is set will revoke that right if it is set in the instance. You can pass in LLGrantedRights::NONE to not change that field.
to_agent | The rights to grant to agent_id. | |
from_agent | The rights granted from agent_id. |
Definition at line 95 of file lluserrelations.cpp.
References mChangeSerialNum, mGrantFromAgent, and mGrantToAgent.
const LLRelationship LLRelationship::DEFAULT_RELATIONSHIP = LLRelationship(GRANT_ONLINE_STATUS, GRANT_ONLINE_STATUS, false) [static] |
Definition at line 61 of file lluserrelations.h.
const U8 LLRelationship::GRANTED_VISIBLE_MASK = LLRelationship::GRANT_MODIFY_OBJECTS | LLRelationship::GRANT_MAP_LOCATION [static] |
???
Definition at line 113 of file lluserrelations.h.
S32 LLRelationship::mGrantToAgent [protected] |
Definition at line 182 of file lluserrelations.h.
Referenced by getRightsGrantedTo(), grantRights(), isRightGrantedTo(), revokeRights(), and setRightsTo().
S32 LLRelationship::mGrantFromAgent [protected] |
Definition at line 183 of file lluserrelations.h.
Referenced by getRightsGrantedFrom(), grantRights(), isRightGrantedFrom(), revokeRights(), and setRightsFrom().
S32 LLRelationship::mChangeSerialNum [protected] |
Definition at line 184 of file lluserrelations.h.
Referenced by getChangeSerialNum(), grantRights(), online(), revokeRights(), setRightsFrom(), and setRightsTo().
bool LLRelationship::mIsOnline [protected] |