summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul ProductEngine <pguslisty@productengine.com>2012-07-04 20:53:47 +0300
committerPaul ProductEngine <pguslisty@productengine.com>2012-07-04 20:53:47 +0300
commite0eeed2680a2c6ba1055ac2a9f6465cb8004b7d6 (patch)
tree3e3d4050ccb45c18009c3f076d52bab6e5bad777
parent22f8301b1dea787e0adda80b2625a8d7d9ddbda4 (diff)
CHUI-189 FIXED (Blocked objects by name are not sorted correctly)
- Fixed sort criteria. It's needed to take into account that objects in mute list are represented by two types: LLMute::BY_NAME and LLMute::OBJECT
-rw-r--r--indra/newview/llblocklist.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp
index cb68f677eb..0165a9c4e8 100644
--- a/indra/newview/llblocklist.cpp
+++ b/indra/newview/llblocklist.cpp
@@ -267,9 +267,15 @@ bool LLBlockListNameTypeComparator::doCompare(const LLBlockedListItem* blocked_i
LLMute::EType type1 = blocked_item1->getType();
LLMute::EType type2 = blocked_item2->getType();
- if (type1 != type2)
+ // if mute type is LLMute::BY_NAME or LLMute::OBJECT it means that this mute is an object
+ bool both_mutes_are_objects = (LLMute::OBJECT == type1 || LLMute::BY_NAME == type1) && (LLMute::OBJECT == type2 || LLMute::BY_NAME == type2);
+
+ // mute types may be different, but since both LLMute::BY_NAME and LLMute::OBJECT types represent objects
+ // it's needed to perform additional checking of both_mutes_are_objects variable
+ if (type1 != type2 && !both_mutes_are_objects)
{
- return type1 > type2;
+ // objects in block list go first, so return true if mute type is not an avatar
+ return LLMute::AGENT != type1;
}
return NAME_COMPARATOR.compare(blocked_item1, blocked_item2);