Group Bans!

Thankies Baker Linden~

Ported Ansariel's mAvatarNameCacheConnection change to mAvatarNameCacheConnections to llpanelgroupbulkimpl.h

Adds setGroupID in places, in case we ever want to add that.. but for now we don't really need/use it
Adds Refresh_Off icon from upstream.

Viewer Interesting changes:
Moves LLGroupChange out of stdenums.h into llgroupmgr.h
Moves roles_constants.h from llcommon into newview

This looks like it's better without space changes...
This commit is contained in:
Inusaito Sayori
2014-06-21 16:44:39 -04:00
parent b36bb8b5bb
commit d87a48ea06
30 changed files with 2143 additions and 154 deletions

View File

@@ -33,7 +33,21 @@
#include <string>
#include <map>
// Forward Declarations
class LLMessageSystem;
class LLGroupRoleData;
class LLGroupMgr;
enum LLGroupChange
{
GC_PROPERTIES,
GC_MEMBER_DATA,
GC_ROLE_DATA,
GC_ROLE_MEMBER_DATA,
GC_TITLES,
GC_BANLIST,
GC_ALL
};
class LLGroupMgrObserver
{
@@ -54,8 +68,6 @@ public:
virtual void changed(const LLUUID& group_id, LLGroupChange gc) = 0;
};
class LLGroupRoleData;
class LLGroupMemberData
{
friend class LLGroupMgrGroupData;
@@ -190,6 +202,17 @@ struct lluuid_pair_less
}
};
struct LLGroupBanData
{
LLGroupBanData() : mBanDate() {}
~LLGroupBanData() {}
LLDate mBanDate;
// TODO: std::string ban_reason;
};
struct LLGroupTitle
{
std::string mTitle;
@@ -197,8 +220,6 @@ struct LLGroupTitle
BOOL mSelected;
};
class LLGroupMgr;
class LLGroupMgrGroupData
{
friend class LLGroupMgr;
@@ -228,26 +249,36 @@ public:
void recalcAllAgentPowers();
void recalcAgentPowers(const LLUUID& agent_id);
BOOL isMemberDataComplete() { return mMemberDataComplete; }
BOOL isRoleDataComplete() { return mRoleDataComplete; }
BOOL isRoleMemberDataComplete() { return mRoleMemberDataComplete; }
BOOL isGroupPropertiesDataComplete() { return mGroupPropertiesDataComplete; }
bool isMemberDataComplete() { return mMemberDataComplete; }
bool isRoleDataComplete() { return mRoleDataComplete; }
bool isRoleMemberDataComplete() { return mRoleMemberDataComplete; }
bool isGroupPropertiesDataComplete() { return mGroupPropertiesDataComplete; }
F32 getAccessTime() const { return mAccessTime; }
void setAccessed();
const LLUUID& getMemberVersion() const { return mMemberVersion; }
void clearBanList() { mBanList.clear(); }
void getBanList(const LLUUID& ban_i, const LLGroupBanData& ban_data = LLGroupBanData());
const LLGroupBanData& getBanEntry(const LLUUID& ban_id) { return mBanList[ban_id]; }
void createBanEntry(const LLUUID& ban_id, const LLGroupBanData& ban_data = LLGroupBanData());
void removeBanEntry(const LLUUID& ban_id);
public:
typedef std::map<LLUUID,LLGroupMemberData*> member_list_t;
typedef std::map<LLUUID,LLGroupRoleData*> role_list_t;
typedef std::map<lluuid_pair,LLRoleMemberChange,lluuid_pair_less> change_map_t;
typedef std::map<LLUUID,LLRoleData> role_data_map_t;
typedef std::map<LLUUID,LLGroupBanData> ban_list_t;
member_list_t mMembers;
role_list_t mRoles;
change_map_t mRoleMemberChanges;
role_data_map_t mRoleChanges;
ban_list_t mBanList;
std::vector<LLGroupTitle> mTitles;
@@ -277,12 +308,12 @@ private:
LLUUID mTitlesRequestID;
U32 mReceivedRoleMemberPairs;
BOOL mMemberDataComplete;
BOOL mRoleDataComplete;
BOOL mRoleMemberDataComplete;
BOOL mGroupPropertiesDataComplete;
bool mMemberDataComplete;
bool mRoleDataComplete;
bool mRoleMemberDataComplete;
bool mGroupPropertiesDataComplete;
BOOL mPendingRoleMemberRequest;
bool mPendingRoleMemberRequest;
F32 mAccessTime;
// Generate a new ID every time mMembers
@@ -309,6 +340,23 @@ class LLGroupMgr : public LLSingleton<LLGroupMgr>
{
LOG_CLASS(LLGroupMgr);
public:
enum EBanRequestType
{
REQUEST_GET = 0,
REQUEST_POST,
REQUEST_PUT,
REQUEST_DEL
};
enum EBanRequestAction
{
BAN_NO_ACTION = 0,
BAN_CREATE = 1,
BAN_DELETE = 2,
BAN_UPDATE = 4
};
public:
LLGroupMgr();
~LLGroupMgr();
@@ -343,6 +391,13 @@ public:
static void sendGroupMemberEjects(const LLUUID& group_id,
uuid_vec_t& member_ids);
static void sendGroupBanRequest(EBanRequestType request_type,
const LLUUID& group_id,
U32 ban_action = BAN_NO_ACTION,
const uuid_vec_t ban_list = uuid_vec_t());
static void processGroupBanRequest(const LLSD& content);
void sendCapGroupMembersRequest(const LLUUID& group_id);
static void processCapGroupMembersRequest(const LLSD& content);
@@ -387,4 +442,3 @@ private:
#endif