summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationmodel.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-09-21 20:13:50 -0700
committerMerov Linden <merov@lindenlab.com>2012-09-21 20:13:50 -0700
commit552f288a0caea45e30a231478a19f4243d69689c (patch)
treea81d25696bf1b5e1fe29f0ba8f341cfec9d4e2e4 /indra/newview/llconversationmodel.cpp
parentf95974637e720a7968b959d80cc4ab68260ccbe5 (diff)
CHUI-340 : Implement distance computation and update
Diffstat (limited to 'indra/newview/llconversationmodel.cpp')
-rw-r--r--indra/newview/llconversationmodel.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index e090d1647f..b0d691fa13 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -181,6 +181,16 @@ void LLConversationItemSession::setTimeNow(const LLUUID& participant_id)
}
}
+void LLConversationItemSession::setDistance(const LLUUID& participant_id, F64 dist)
+{
+ LLConversationItemParticipant* participant = findParticipant(participant_id);
+ if (participant)
+ {
+ participant->setDistance(dist);
+ mNeedsRefresh = true;
+ }
+}
+
// The time of activity of a session is the time of the most recent activity, session and participants included
const bool LLConversationItemSession::getTime(F64& time) const
{
@@ -224,13 +234,17 @@ void LLConversationItemSession::dumpDebugData()
LLConversationItemParticipant::LLConversationItemParticipant(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
LLConversationItem(display_name,uuid,root_view_model),
mIsMuted(false),
- mIsModerator(false)
+ mIsModerator(false),
+ mDistToAgent(-1.0)
{
mConvType = CONV_PARTICIPANT;
}
LLConversationItemParticipant::LLConversationItemParticipant(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
- LLConversationItem(uuid,root_view_model)
+ LLConversationItem(uuid,root_view_model),
+ mIsMuted(false),
+ mIsModerator(false),
+ mDistToAgent(-1.0)
{
mConvType = CONV_PARTICIPANT;
}
@@ -284,13 +298,13 @@ bool LLConversationSort::operator()(const LLConversationItem* const& a, const LL
}
else if (sort_order == LLConversationFilter::SO_DISTANCE)
{
- F32 dist_a = 0.0;
- F32 dist_b = 0.0;
+ F64 dist_a = 0.0;
+ F64 dist_b = 0.0;
bool has_dist_a = a->getDistanceToAgent(dist_a);
bool has_dist_b = b->getDistanceToAgent(dist_b);
if (has_dist_a && has_dist_b)
{
- return (dist_a > dist_b);
+ return (dist_a < dist_b);
}
else if (has_dist_a || has_dist_b)
{