summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r--indra/newview/llavataractions.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 8c4dfaea50..bfd3d12efb 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -251,31 +251,25 @@ void LLAvatarActions::startAdhocCall(const std::vector<LLUUID>& ids)
make_ui_sound("UISndStartIM");
}
+/* AD *TODO: Is this function needed any more?
+ I fixed it a bit(added check for canCall), but it appears that it is not used
+ anywhere. Maybe it should be removed?
// static
bool LLAvatarActions::isCalling(const LLUUID &id)
{
- if (id.isNull())
+ if (id.isNull() || !canCall())
{
return false;
}
LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, id);
return (LLIMModel::getInstance()->findIMSession(session_id) != NULL);
-}
+}*/
//static
-bool LLAvatarActions::canCall(const LLUUID &id)
+bool LLAvatarActions::canCall()
{
- // For now we do not need to check whether passed UUID is ID of agent's friend.
- // Use common check of Voice Client state.
- {
- // don't need to check online/offline status because "usual resident" (resident that is not a friend)
- // can be only ONLINE. There is no way to see "usual resident" in OFFLINE status. If we see "usual
- // resident" it automatically means that the resident is ONLINE. So to make a call to the "usual resident"
- // we need to check only that "our" voice is enabled.
- return LLVoiceClient::voiceEnabled();
- }
-
+ return LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking();
}
// static
@@ -619,3 +613,13 @@ bool LLAvatarActions::isBlocked(const LLUUID& id)
gCacheName->getFullName(id, name);
return LLMuteList::getInstance()->isMuted(id, name);
}
+
+// static
+bool LLAvatarActions::canBlock(const LLUUID& id)
+{
+ std::string firstname, lastname;
+ gCacheName->getName(id, firstname, lastname);
+ bool is_linden = !LLStringUtil::compareStrings(lastname, "Linden");
+ bool is_self = id == gAgentID;
+ return !is_self && !is_linden;
+}