diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llchiclet.cpp | 41 | ||||
-rw-r--r-- | indra/newview/llchiclet.h | 11 | ||||
-rw-r--r-- | indra/newview/llimview.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llimview.h | 9 | ||||
-rw-r--r-- | indra/newview/llvoicechannel.cpp | 6 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_imchiclet_adhoc.xml | 19 |
6 files changed, 86 insertions, 3 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index f41e326dd0..d533743cfc 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -595,8 +595,49 @@ void LLAdHocChiclet::setCounter(S32 counter) setShowNewMessagesIcon(counter); } +void LLAdHocChiclet::createPopupMenu() +{ + if(mPopupMenu) + { + llwarns << "Menu already exists" << llendl; + return; + } + if(getSessionId().isNull()) + { + return; + } + + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + registrar.add("IMChicletMenu.Action", boost::bind(&LLAdHocChiclet::onMenuItemClicked, this, _2)); + + mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL> + ("menu_imchiclet_adhoc.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); +} + +void LLAdHocChiclet::onMenuItemClicked(const LLSD& user_data) +{ + std::string level = user_data.asString(); + LLUUID group_id = getSessionId(); + + if("end" == level) + { + LLGroupActions::endIM(group_id); + } +} + BOOL LLAdHocChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) { + if(!mPopupMenu) + { + createPopupMenu(); + } + + if (mPopupMenu) + { + mPopupMenu->arrangeAndClear(); + LLMenuGL::showPopup(this, mPopupMenu, x, y); + } + return TRUE; } diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 1ea141e6c4..ed4bcbc6ac 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -518,6 +518,17 @@ protected: friend class LLUICtrlFactory; /** + * Creates chiclet popup menu. Will create AdHoc Chat menu + * based on other participant's id. + */ + virtual void createPopupMenu(); + + /** + * Processes clicks on chiclet popup menu. + */ + virtual void onMenuItemClicked(const LLSD& user_data); + + /** * Displays popup menu. */ virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index be719c0a78..c5c412d4ee 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1348,7 +1348,8 @@ void LLIncomingCallDialog::processCallResponse(S32 response) session_id = gIMMgr->addP2PSession( mPayload["session_name"].asString(), mPayload["caller_id"].asUUID(), - mPayload["session_handle"].asString()); + mPayload["session_handle"].asString(), + mPayload["session_uri"].asString()); if (voice) { diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 40e3a8fb69..b2d3c6b921 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -277,11 +277,16 @@ public: const LLUUID& other_participant_id, const LLDynamicArray<LLUUID>& ids); - // Creates a P2P session with the requisite handle for responding to voice calls + /** + * Creates a P2P session with the requisite handle for responding to voice calls. + * + * @param caller_uri - sip URI of caller. It should be always be passed into the method to avoid + * incorrect working of LLVoiceChannel instances. See EXT-2985. + */ LLUUID addP2PSession(const std::string& name, const LLUUID& other_participant_id, const std::string& voice_session_handle, - const std::string& caller_uri = LLStringUtil::null); + const std::string& caller_uri); /** * Leave the session with session id. Send leave session notification diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 3554528d19..a0396bc790 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -750,6 +750,8 @@ LLVoiceChannelP2P::LLVoiceChannelP2P(const LLUUID& session_id, const std::string mReceivedCall(FALSE) { // make sure URI reflects encoded version of other user's agent id + // *NOTE: in case of Avaline call generated SIP URL will be incorrect. + // But it will be overridden in LLVoiceChannelP2P::setSessionHandle() called when agent accepts call setURI(LLVoiceClient::getInstance()->sipURIFromID(other_user_id)); } @@ -867,6 +869,10 @@ void LLVoiceChannelP2P::setSessionHandle(const std::string& handle, const std::s } else { + LL_WARNS("Voice") << "incoming SIP URL is not provided. Channel may not work properly." << LL_ENDL; + // In case of incoming AvaLine call generated URI will be differ from original one. + // This is because Avatar-2-Avatar URI is based on avatar UUID but Avaline is not. + // See LLVoiceClient::sessionAddedEvent() -> setUUIDFromStringHash() setURI(LLVoiceClient::getInstance()->sipURIFromID(mOtherUserID)); } diff --git a/indra/newview/skins/default/xui/en/menu_imchiclet_adhoc.xml b/indra/newview/skins/default/xui/en/menu_imchiclet_adhoc.xml new file mode 100644 index 0000000000..eb5e31b57d --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_imchiclet_adhoc.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu + height="101" + layout="topleft" + left="100" + mouse_opaque="false" + name="IMChiclet AdHoc Menu" + top="724" + visible="false" + width="128"> + <menu_item_call + label="End Session" + layout="topleft" + name="End Session"> + <menu_item_call.on_click + function="IMChicletMenu.Action" + parameter="end" /> + </menu_item_call> +</menu> |