summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2024-10-18 02:57:20 +0200
committerGuru <alexandrgproductengine@lindenlab.com>2024-10-18 18:40:37 +0200
commitd33047bde23ea629901a3477edd90f3e19c1a4db (patch)
treea8e266d117c49032bb0c044fc9d36b02df1b510c /indra/newview/llviewermenu.cpp
parentfc1c5635d38bceb70132bddf6454e07be61acec2 (diff)
#2303 An error occured while trying to connect to voice
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 39213569a5..68c38c3692 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7808,15 +7808,29 @@ class LLAvatarSendIM : public view_listener_t
class LLAvatarCall : public view_listener_t
{
+ static LLVOAvatar* findAvatar()
+ {
+ return find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
+ }
+
bool handleEvent(const LLSD& userdata)
{
- LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
- if(avatar)
+ if (LLVOAvatar* avatar = findAvatar())
{
LLAvatarActions::startCall(avatar->getID());
}
return true;
}
+
+public:
+ static bool isAvailable()
+ {
+ if (LLVOAvatar* avatar = findAvatar())
+ {
+ return LLAvatarActions::canCallTo(avatar->getID());
+ }
+ return LLAvatarActions::canCall();
+ }
};
namespace
@@ -10075,7 +10089,7 @@ void initialize_menus()
registrar.add("Avatar.ShowInspector", boost::bind(&handle_avatar_show_inspector));
view_listener_t::addMenu(new LLAvatarSendIM(), "Avatar.SendIM");
view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call", cb_info::UNTRUSTED_BLOCK);
- enable.add("Avatar.EnableCall", boost::bind(&LLAvatarActions::canCall));
+ enable.add("Avatar.EnableCall", boost::bind(&LLAvatarCall::isAvailable));
view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse", cb_info::UNTRUSTED_THROTTLE);
view_listener_t::addMenu(new LLAvatarToggleMyProfile(), "Avatar.ToggleMyProfile");
view_listener_t::addMenu(new LLAvatarTogglePicks(), "Avatar.TogglePicks");