summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
authorrichard <none@none>2009-12-17 10:03:56 -0800
committerrichard <none@none>2009-12-17 10:03:56 -0800
commit724f5fbb7f7b101774c0cf3ff43bb98f9cc4ffc1 (patch)
treebfb7b4009b32761f9f760f97dd97cc0697667a71 /indra/newview/llavataractions.cpp
parent9ff869a6b287a2b4b8c94219584d1c7b66ebb399 (diff)
parentcf63ce4dc1176d9df4fe852821e4a6d32332f7c6 (diff)
merge
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r--indra/newview/llavataractions.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 5f90a7627f..636b1de4d4 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -61,6 +61,7 @@
#include "llviewerregion.h"
#include "llimfloater.h"
#include "lltrans.h"
+#include "llcallingcard.h"
// static
void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name)
@@ -210,11 +211,9 @@ void LLAvatarActions::startCall(const LLUUID& id)
std::string name;
gCacheName->getFullName(id, name);
- LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id);
+ LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id, true);
if (session_id != LLUUID::null)
{
- // always open IM window when connecting to voice
- LLIMFloater::show(session_id);
gIMMgr->startCall(session_id);
}
make_ui_sound("UISndStartIM");
@@ -238,15 +237,12 @@ void LLAvatarActions::startAdhocCall(const std::vector<LLUUID>& ids)
// create the new ad hoc voice session
const std::string title = LLTrans::getString("conference-title");
LLUUID session_id = gIMMgr->addSession(title, IM_SESSION_CONFERENCE_START,
- ids[0], id_array);
+ ids[0], id_array, true);
if (session_id == LLUUID::null)
{
return;
}
- // always open IM window when connecting to voice
- LLIMFloater::show(session_id);
-
// start the call once the session has fully initialized
gIMMgr->autoStartCallOnStartup(session_id);
@@ -265,6 +261,24 @@ bool LLAvatarActions::isCalling(const LLUUID &id)
return (LLIMModel::getInstance()->findIMSession(session_id) != NULL);
}
+//static
+bool LLAvatarActions::canCall(const LLUUID &id)
+{
+ if(isFriend(id))
+ {
+ return LLAvatarTracker::instance().isBuddyOnline(id) && LLVoiceClient::voiceEnabled();
+ }
+ else
+ {
+ // 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();
+ }
+
+}
+
// static
void LLAvatarActions::startConference(const std::vector<LLUUID>& ids)
{