diff options
author | Dave Parks <davep@lindenlab.com> | 2009-11-24 23:21:57 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2009-11-24 23:21:57 -0600 |
commit | e264f00c833805e1f813bc1d0b2cfd7a1bf7b272 (patch) | |
tree | 1a64a520502d2ed2c7dadc2316e543ae9e9a91d2 /indra/newview/llavataractions.cpp | |
parent | c9e153c182dae9472a2b87cddfec8c47b30b06b9 (diff) | |
parent | 5b5354c933aa7b1ceeb307853c24fba28d4e31bf (diff) |
Merge
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r-- | indra/newview/llavataractions.cpp | 70 |
1 files changed, 66 insertions, 4 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index dae4296a82..839a84f2d2 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -54,11 +54,15 @@ #include "llmutelist.h" #include "llrecentpeople.h" #include "llsidetray.h" +#include "lltrans.h" #include "llviewerobjectlist.h" #include "llviewermessage.h" // for handle_lure #include "llviewerregion.h" #include "llimfloater.h" +#include "lltrans.h" +// callback connection to auto-call when the IM floater initializes +boost::signals2::connection gAdhocAutoCall; // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name) @@ -186,9 +190,22 @@ void LLAvatarActions::startIM(const LLUUID& id) } // static +void LLAvatarActions::endIM(const LLUUID& id) +{ + if (id.isNull()) + return; + + LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, id); + if (session_id != LLUUID::null) + { + gIMMgr->leaveSession(session_id); + } +} + +// static void LLAvatarActions::startCall(const LLUUID& id) { - if (id.isNull() || isCalling(id)) + if (id.isNull()) { return; } @@ -206,6 +223,39 @@ void LLAvatarActions::startCall(const LLUUID& id) } // static +void LLAvatarActions::startAdhocCall(const std::vector<LLUUID>& ids) +{ + if (ids.size() == 0) + { + return; + } + + // convert vector into LLDynamicArray for addSession + LLDynamicArray<LLUUID> id_array; + for (std::vector<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it) + { + id_array.push_back(*it); + } + + // 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); + if (session_id == LLUUID::null) + { + return; + } + + // always open IM window when connecting to voice + LLIMFloater::show(session_id); + + // start the call once the floater has fully initialized + gAdhocAutoCall = LLIMModel::getInstance()->addSessionInitializedCallback(callbackAutoStartCall); + + make_ui_sound("UISndStartIM"); +} + +// static bool LLAvatarActions::isCalling(const LLUUID &id) { if (id.isNull()) @@ -226,7 +276,8 @@ void LLAvatarActions::startConference(const std::vector<LLUUID>& ids) { id_array.push_back(*it); } - LLUUID session_id = gIMMgr->addSession("Friends Conference", IM_SESSION_CONFERENCE_START, ids[0], id_array); + const std::string title = LLTrans::getString("conference-title"); + LLUUID session_id = gIMMgr->addSession(title, IM_SESSION_CONFERENCE_START, ids[0], id_array); if (session_id != LLUUID::null) { LLIMFloater::show(session_id); @@ -246,7 +297,7 @@ void LLAvatarActions::showProfile(const LLUUID& id) //Show own profile if(gAgent.getID() == id) { - LLSideTray::getInstance()->showPanel("panel_me_profile", params); + LLSideTray::getInstance()->showPanel("panel_me", params); } //Show other user profile else @@ -296,9 +347,9 @@ void LLAvatarActions::inviteToGroup(const LLUUID& id) LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance<LLFloaterGroupPicker>("group_picker", LLSD(id)); if (widget) { - widget->removeNoneOption(); widget->center(); widget->setPowersMask(GP_MEMBER_INVITE); + widget->removeNoneOption(); widget->setSelectGroupCallback(boost::bind(callback_invite_to_group, _1, id)); } } @@ -394,6 +445,17 @@ bool LLAvatarActions::callbackAddFriend(const LLSD& notification, const LLSD& re } // static +void LLAvatarActions::callbackAutoStartCall(const LLSD& data) +{ + // start the adhoc voice call now the IM panel has initialized + LLUUID session_id = data["session_id"].asUUID(); + gIMMgr->startCall(session_id); + + // and deschedule this callback as its work is done now + gAdhocAutoCall.disconnect(); +} + +// static void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message) { const LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD); |