summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
authorLynx Linden <lynx@lindenlab.com>2009-11-09 19:28:14 +0000
committerLynx Linden <lynx@lindenlab.com>2009-11-09 19:28:14 +0000
commita9b16734a1690551cc6277dc419dcb8629f4ddd1 (patch)
treea2bd035c45264cbdf1adaa446e7a5670a790bcbe /indra/newview/llavataractions.cpp
parent90d985946ce167a313e2765728caf2652931dfdd (diff)
DEV-41317 DEV-41318: Enabled the Call button in the Profile panel.
I've added a new LLAvatarActions::startCall() method to make it easy to start a new P2P call. The Resident Profile "Call" button is now hooked up to this. I've also put back the "Call" menu in the avatar popup menu and hooked this up too. While I was there I noticed that the "IM" popup menu code could all be removed in favor of a call to LLAvatarActions::startIM().
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r--indra/newview/llavataractions.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 3fc37aa3d5..dae4296a82 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -186,6 +186,38 @@ void LLAvatarActions::startIM(const LLUUID& id)
}
// static
+void LLAvatarActions::startCall(const LLUUID& id)
+{
+ if (id.isNull() || isCalling(id))
+ {
+ return;
+ }
+
+ std::string name;
+ gCacheName->getFullName(id, name);
+ LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id);
+ 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");
+}
+
+// static
+bool LLAvatarActions::isCalling(const LLUUID &id)
+{
+ if (id.isNull())
+ {
+ return false;
+ }
+
+ LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, id);
+ return (LLIMModel::getInstance()->findIMSession(session_id) != NULL);
+}
+
+// static
void LLAvatarActions::startConference(const std::vector<LLUUID>& ids)
{
// *HACK: Copy into dynamic array