EXT-2644 - Add "Close Session" option to chicklet context menus
parent
22aa5eed91
commit
efb512dc65
|
|
@ -189,6 +189,19 @@ void LLAvatarActions::startIM(const LLUUID& id)
|
|||
make_ui_sound("UISndStartIM");
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -73,6 +73,11 @@ public:
|
|||
*/
|
||||
static void startIM(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* End instant messaging session.
|
||||
*/
|
||||
static void endIM(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* Start an avatar-to-avatar voice call with another user
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -482,6 +482,10 @@ void LLIMP2PChiclet::onMenuItemClicked(const LLSD& user_data)
|
|||
{
|
||||
LLAvatarActions::requestFriendshipDialog(other_participant_id);
|
||||
}
|
||||
else if("close" == level)
|
||||
{
|
||||
LLAvatarActions::endIM(other_participant_id);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -776,12 +780,16 @@ void LLIMGroupChiclet::onMenuItemClicked(const LLSD& user_data)
|
|||
|
||||
if("group chat" == level)
|
||||
{
|
||||
LLGroupActions::startChat(group_id);
|
||||
LLGroupActions::startIM(group_id);
|
||||
}
|
||||
else if("info" == level)
|
||||
{
|
||||
LLGroupActions::show(group_id);
|
||||
}
|
||||
else if("close" == level)
|
||||
{
|
||||
LLGroupActions::endIM(group_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ void LLPanelGroups::startIM()
|
|||
|
||||
if (group_list && (group_id = group_list->getCurrentID()).notNull())
|
||||
{
|
||||
LLGroupActions::startChat(group_id);
|
||||
LLGroupActions::startIM(group_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ void LLGroupActions::closeGroup(const LLUUID& group_id)
|
|||
|
||||
|
||||
// static
|
||||
void LLGroupActions::startChat(const LLUUID& group_id)
|
||||
void LLGroupActions::startIM(const LLUUID& group_id)
|
||||
{
|
||||
if (group_id.isNull())
|
||||
return;
|
||||
|
|
@ -298,6 +298,19 @@ void LLGroupActions::startChat(const LLUUID& group_id)
|
|||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLGroupActions::endIM(const LLUUID& group_id)
|
||||
{
|
||||
if (group_id.isNull())
|
||||
return;
|
||||
|
||||
LLUUID session_id = gIMMgr->computeSessionID(IM_SESSION_GROUP_START, group_id);
|
||||
if (session_id != LLUUID::null)
|
||||
{
|
||||
gIMMgr->leaveSession(session_id);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLGroupActions::isInGroup(const LLUUID& group_id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -88,7 +88,12 @@ public:
|
|||
/**
|
||||
* Start group instant messaging session.
|
||||
*/
|
||||
static void startChat(const LLUUID& group_id);
|
||||
static void startIM(const LLUUID& group_id);
|
||||
|
||||
/**
|
||||
* End group instant messaging session.
|
||||
*/
|
||||
static void endIM(const LLUUID& group_id);
|
||||
|
||||
/// Returns if the current user is a member of the group
|
||||
static bool isInGroup(const LLUUID& group_id);
|
||||
|
|
|
|||
|
|
@ -1017,7 +1017,7 @@ void LLPanelPeople::onChatButtonClicked()
|
|||
{
|
||||
LLUUID group_id = getCurrentItemID();
|
||||
if (group_id.notNull())
|
||||
LLGroupActions::startChat(group_id);
|
||||
LLGroupActions::startIM(group_id);
|
||||
}
|
||||
|
||||
void LLPanelPeople::onImButtonClicked()
|
||||
|
|
|
|||
|
|
@ -24,4 +24,12 @@
|
|||
function="IMChicletMenu.Action"
|
||||
parameter="info" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Close Session"
|
||||
layout="topleft"
|
||||
name="Close Session">
|
||||
<menu_item_call.on_click
|
||||
function="IMChicletMenu.Action"
|
||||
parameter="close" />
|
||||
</menu_item_call>
|
||||
</menu>
|
||||
|
|
|
|||
|
|
@ -32,4 +32,12 @@
|
|||
function="IMChicletMenu.Action"
|
||||
parameter="add" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Close Session"
|
||||
layout="topleft"
|
||||
name="Close Session">
|
||||
<menu_item_call.on_click
|
||||
function="IMChicletMenu.Action"
|
||||
parameter="close" />
|
||||
</menu_item_call>
|
||||
</menu>
|
||||
|
|
|
|||
Loading…
Reference in New Issue