Skip to content
Snippets Groups Projects
Commit 3375a71f authored by Steve Bennetts's avatar Steve Bennetts
Browse files

merge

parents 81eca4a7 2878328b
No related branches found
No related tags found
No related merge requests found
...@@ -189,6 +189,19 @@ void LLAvatarActions::startIM(const LLUUID& id) ...@@ -189,6 +189,19 @@ void LLAvatarActions::startIM(const LLUUID& id)
make_ui_sound("UISndStartIM"); 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 // static
void LLAvatarActions::startCall(const LLUUID& id) void LLAvatarActions::startCall(const LLUUID& id)
{ {
......
...@@ -73,6 +73,11 @@ class LLAvatarActions ...@@ -73,6 +73,11 @@ class LLAvatarActions
*/ */
static void startIM(const LLUUID& id); 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 * Start an avatar-to-avatar voice call with another user
*/ */
......
...@@ -474,6 +474,10 @@ void LLIMP2PChiclet::onMenuItemClicked(const LLSD& user_data) ...@@ -474,6 +474,10 @@ void LLIMP2PChiclet::onMenuItemClicked(const LLSD& user_data)
{ {
LLAvatarActions::requestFriendshipDialog(other_participant_id); LLAvatarActions::requestFriendshipDialog(other_participant_id);
} }
else if("end" == level)
{
LLAvatarActions::endIM(other_participant_id);
}
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -768,12 +772,16 @@ void LLIMGroupChiclet::onMenuItemClicked(const LLSD& user_data) ...@@ -768,12 +772,16 @@ void LLIMGroupChiclet::onMenuItemClicked(const LLSD& user_data)
if("group chat" == level) if("group chat" == level)
{ {
LLGroupActions::startChat(group_id); LLGroupActions::startIM(group_id);
} }
else if("info" == level) else if("info" == level)
{ {
LLGroupActions::show(group_id); LLGroupActions::show(group_id);
} }
else if("end" == level)
{
LLGroupActions::endIM(group_id);
}
} }
......
...@@ -327,7 +327,7 @@ void LLPanelGroups::startIM() ...@@ -327,7 +327,7 @@ void LLPanelGroups::startIM()
if (group_list && (group_id = group_list->getCurrentID()).notNull()) 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) ...@@ -272,7 +272,7 @@ void LLGroupActions::closeGroup(const LLUUID& group_id)
// static // static
void LLGroupActions::startChat(const LLUUID& group_id) void LLGroupActions::startIM(const LLUUID& group_id)
{ {
if (group_id.isNull()) if (group_id.isNull())
return; return;
...@@ -298,6 +298,19 @@ void LLGroupActions::startChat(const LLUUID& group_id) ...@@ -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 // static
bool LLGroupActions::isInGroup(const LLUUID& group_id) bool LLGroupActions::isInGroup(const LLUUID& group_id)
{ {
......
...@@ -88,7 +88,12 @@ class LLGroupActions ...@@ -88,7 +88,12 @@ class LLGroupActions
/** /**
* Start group instant messaging session. * 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 /// Returns if the current user is a member of the group
static bool isInGroup(const LLUUID& group_id); static bool isInGroup(const LLUUID& group_id);
......
...@@ -1017,7 +1017,7 @@ void LLPanelPeople::onChatButtonClicked() ...@@ -1017,7 +1017,7 @@ void LLPanelPeople::onChatButtonClicked()
{ {
LLUUID group_id = getCurrentItemID(); LLUUID group_id = getCurrentItemID();
if (group_id.notNull()) if (group_id.notNull())
LLGroupActions::startChat(group_id); LLGroupActions::startIM(group_id);
} }
void LLPanelPeople::onImButtonClicked() void LLPanelPeople::onImButtonClicked()
......
...@@ -9,7 +9,15 @@ ...@@ -9,7 +9,15 @@
visible="false" visible="false"
width="128"> width="128">
<menu_item_call <menu_item_call
label="Chat..." label="Group Info"
layout="topleft"
name="Show Profile">
<menu_item_call.on_click
function="IMChicletMenu.Action"
parameter="info" />
</menu_item_call>
<menu_item_call
label="Show Session"
layout="topleft" layout="topleft"
name="Chat"> name="Chat">
<menu_item_call.on_click <menu_item_call.on_click
...@@ -17,11 +25,11 @@ ...@@ -17,11 +25,11 @@
parameter="group chat" /> parameter="group chat" />
</menu_item_call> </menu_item_call>
<menu_item_call <menu_item_call
label="Info..." label="End Session"
layout="topleft" layout="topleft"
name="Show Profile"> name="End Session">
<menu_item_call.on_click <menu_item_call.on_click
function="IMChicletMenu.Action" function="IMChicletMenu.Action"
parameter="info" /> parameter="end" />
</menu_item_call> </menu_item_call>
</menu> </menu>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
visible="false" visible="false"
width="128"> width="128">
<menu_item_call <menu_item_call
label="Show Profile..." label="Show Profile"
layout="topleft" layout="topleft"
name="Show Profile"> name="Show Profile">
<menu_item_call.on_click <menu_item_call.on_click
...@@ -17,7 +17,15 @@ ...@@ -17,7 +17,15 @@
parameter="profile" /> parameter="profile" />
</menu_item_call> </menu_item_call>
<menu_item_call <menu_item_call
label="Send IM..." label="Add Friend"
layout="topleft"
name="Add Friend">
<menu_item_call.on_click
function="IMChicletMenu.Action"
parameter="add" />
</menu_item_call>
<menu_item_call
label="Show Session"
layout="topleft" layout="topleft"
name="Send IM"> name="Send IM">
<menu_item_call.on_click <menu_item_call.on_click
...@@ -25,11 +33,11 @@ ...@@ -25,11 +33,11 @@
parameter="im" /> parameter="im" />
</menu_item_call> </menu_item_call>
<menu_item_call <menu_item_call
label="Add Friend..." label="End Session"
layout="topleft" layout="topleft"
name="Add Friend"> name="End Session">
<menu_item_call.on_click <menu_item_call.on_click
function="IMChicletMenu.Action" function="IMChicletMenu.Action"
parameter="add" /> parameter="end" />
</menu_item_call> </menu_item_call>
</menu> </menu>
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment