summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llgroupactions.cpp30
-rw-r--r--indra/newview/llgroupactions.h5
-rw-r--r--indra/newview/llpanelpeople.cpp8
-rw-r--r--indra/newview/llpanelpeople.h1
-rw-r--r--indra/newview/skins/default/xui/en/panel_people.xml10
5 files changed, 54 insertions, 0 deletions
diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp
index ff75d461df..22658b4d65 100644
--- a/indra/newview/llgroupactions.cpp
+++ b/indra/newview/llgroupactions.cpp
@@ -119,6 +119,36 @@ void LLGroupActions::search()
}
// static
+void LLGroupActions::startCall(const LLUUID& group_id)
+{
+ // create a new group voice session
+ LLGroupData gdata;
+
+ if (!gAgent.getGroupData(group_id, gdata))
+ {
+ llwarns << "Error getting group data" << llendl;
+ return;
+ }
+
+ LLUUID session_id = gIMMgr->addSession(gdata.mName, IM_SESSION_GROUP_START, group_id, true);
+ if (session_id == LLUUID::null)
+ {
+ llwarns << "Error adding session" << llendl;
+ return;
+ }
+
+ // start the call
+ // *TODO: move this to LLIMMgr?
+ LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id);
+ if (session && session->mSessionInitialized)
+ gIMMgr->startCall(session_id);
+ else
+ gIMMgr->autoStartCallOnStartup(session_id);
+
+ make_ui_sound("UISndStartIM");
+}
+
+// static
void LLGroupActions::join(const LLUUID& group_id)
{
LLGroupMgrGroupData* gdatap =
diff --git a/indra/newview/llgroupactions.h b/indra/newview/llgroupactions.h
index 9750b3e3cb..e99df86cd9 100644
--- a/indra/newview/llgroupactions.h
+++ b/indra/newview/llgroupactions.h
@@ -99,6 +99,11 @@ public:
static bool isInGroup(const LLUUID& group_id);
/**
+ * Start a group voice call.
+ */
+ static void startCall(const LLUUID& group_id);
+
+ /**
* Returns true if avatar is in group.
*
* Note that data about group members is loaded from server.
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index e134840153..e5846c7318 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -564,6 +564,7 @@ BOOL LLPanelPeople::postBuild()
buttonSetAction("chat_btn", boost::bind(&LLPanelPeople::onChatButtonClicked, this));
buttonSetAction("im_btn", boost::bind(&LLPanelPeople::onImButtonClicked, this));
buttonSetAction("call_btn", boost::bind(&LLPanelPeople::onCallButtonClicked, this));
+ buttonSetAction("group_call_btn", boost::bind(&LLPanelPeople::onGroupCallButtonClicked, this));
buttonSetAction("teleport_btn", boost::bind(&LLPanelPeople::onTeleportButtonClicked, this));
buttonSetAction("share_btn", boost::bind(&LLPanelPeople::onShareButtonClicked, this));
@@ -733,6 +734,7 @@ void LLPanelPeople::updateButtons()
buttonSetVisible("view_profile_btn", !group_tab_active);
buttonSetVisible("im_btn", !group_tab_active);
buttonSetVisible("call_btn", !group_tab_active);
+ buttonSetVisible("group_call_btn", group_tab_active);
buttonSetVisible("teleport_btn", friends_tab_active);
buttonSetVisible("share_btn", nearby_tab_active || friends_tab_active);
@@ -781,6 +783,7 @@ void LLPanelPeople::updateButtons()
bool none_group_selected = item_selected && selected_id.isNull();
buttonSetEnabled("group_info_btn", !none_group_selected);
+ buttonSetEnabled("group_call_btn", !none_group_selected);
buttonSetEnabled("chat_btn", !none_group_selected);
}
@@ -1272,6 +1275,11 @@ void LLPanelPeople::onCallButtonClicked()
}
}
+void LLPanelPeople::onGroupCallButtonClicked()
+{
+ LLGroupActions::startCall(getCurrentItemID());
+}
+
void LLPanelPeople::onTeleportButtonClicked()
{
LLAvatarActions::offerTeleport(getCurrentItemID());
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index f5cdc0935c..0d2bae1baf 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -100,6 +100,7 @@ private:
void onChatButtonClicked();
void onImButtonClicked();
void onCallButtonClicked();
+ void onGroupCallButtonClicked();
void onTeleportButtonClicked();
void onShareButtonClicked();
void onMoreButtonClicked();
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index 8883c27c47..08a10553a8 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -411,5 +411,15 @@ background_visible="true"
name="chat_btn"
tool_tip="Open chat session"
width="110" />
+ <button
+ follows="bottom|left"
+ top="4"
+ left_pad="2"
+ height="23"
+ label="Group Call"
+ layout="topleft"
+ name="group_call_btn"
+ tool_tip="Call this group"
+ width="110" />
</panel>
</panel>