diff options
Diffstat (limited to 'linden/indra/newview/llmutelist.h')
-rw-r--r-- | linden/indra/newview/llmutelist.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/linden/indra/newview/llmutelist.h b/linden/indra/newview/llmutelist.h index d8f1bf6..4624bfd 100644 --- a/linden/indra/newview/llmutelist.h +++ b/linden/indra/newview/llmutelist.h | |||
@@ -43,8 +43,22 @@ public: | |||
43 | // Legacy mutes are BY_NAME and have null UUID. | 43 | // Legacy mutes are BY_NAME and have null UUID. |
44 | enum EType { BY_NAME = 0, AGENT = 1, OBJECT = 2, GROUP = 3, COUNT = 4 }; | 44 | enum EType { BY_NAME = 0, AGENT = 1, OBJECT = 2, GROUP = 3, COUNT = 4 }; |
45 | 45 | ||
46 | LLMute(const LLUUID& id, const LLString& name = "", EType type = BY_NAME) | 46 | // Bits in the mute flags. For backwards compatibility (since any mute list entries that were created before the flags existed |
47 | : mID(id), mName(name), mType(type) { } | 47 | // will have a flags field of 0), some of the flags are "inverted". |
48 | // Note that it's possible, through flags, to completely disable an entry in the mute list. The code should detect this case | ||
49 | // and remove the mute list entry instead. | ||
50 | enum | ||
51 | { | ||
52 | flagTextChat = 0x00000001, // If set, don't mute user's text chat | ||
53 | flagVoiceChat = 0x00000002, // If set, don't mute user's voice chat | ||
54 | flagParticles = 0x00000004, // If set, don't mute user's particles | ||
55 | flagObjectSounds = 0x00000008, // If set, mute user's object sounds | ||
56 | |||
57 | flagAll = 0x0000000F // Mask of all currently defined flags | ||
58 | }; | ||
59 | |||
60 | LLMute(const LLUUID& id, const LLString& name = "", EType type = BY_NAME, U32 flags = 0) | ||
61 | : mID(id), mName(name), mType(type),mFlags(flags) { } | ||
48 | 62 | ||
49 | // Returns name + suffix based on type | 63 | // Returns name + suffix based on type |
50 | // For example: "James Tester (resident)" | 64 | // For example: "James Tester (resident)" |
@@ -59,6 +73,7 @@ public: | |||
59 | LLUUID mID; // agent or object id | 73 | LLUUID mID; // agent or object id |
60 | LLString mName; // agent or object name | 74 | LLString mName; // agent or object name |
61 | EType mType; // needed for UI display of existing mutes | 75 | EType mType; // needed for UI display of existing mutes |
76 | U32 mFlags; // flags pertaining to this mute entry | ||
62 | }; | 77 | }; |
63 | 78 | ||
64 | class LLMuteList | 79 | class LLMuteList |
@@ -70,14 +85,17 @@ public: | |||
70 | void addObserver(LLMuteListObserver* observer); | 85 | void addObserver(LLMuteListObserver* observer); |
71 | void removeObserver(LLMuteListObserver* observer); | 86 | void removeObserver(LLMuteListObserver* observer); |
72 | 87 | ||
73 | // Add either a normal or a BY_NAME mute. | 88 | // Add either a normal or a BY_NAME mute, for any or all properties. |
74 | BOOL add(const LLMute& mute); | 89 | BOOL add(const LLMute& mute, U32 flags = 0); |
75 | 90 | ||
76 | // Remove both normal and legacy mutes. | 91 | // Remove both normal and legacy mutes, for any or all properties. |
77 | BOOL remove(const LLMute& mute); | 92 | BOOL remove(const LLMute& mute, U32 flags = 0); |
78 | 93 | ||
79 | // Name is required to test against legacy text-only mutes. | 94 | // Name is required to test against legacy text-only mutes. |
80 | BOOL isMuted(const LLUUID& id, const LLString& name = LLString::null) const; | 95 | BOOL isMuted(const LLUUID& id, const LLString& name = LLString::null, U32 flags = 0) const; |
96 | |||
97 | // Alternate (convenience) form for places we don't need to pass the name, but do need flags | ||
98 | BOOL isMuted(const LLUUID& id, U32 flags) const { return isMuted(id, LLString::null, flags); }; | ||
81 | 99 | ||
82 | BOOL isLinden(const LLString& name) const; | 100 | BOOL isLinden(const LLString& name) const; |
83 | 101 | ||