From e0eeed2680a2c6ba1055ac2a9f6465cb8004b7d6 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Wed, 4 Jul 2012 20:53:47 +0300 Subject: 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 --- indra/newview/llblocklist.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/newview/llblocklist.cpp') 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); -- cgit v1.2.3