diff options
author | Steve Bennetts <steve@lindenlab.com> | 2009-11-18 14:07:35 -0800 |
---|---|---|
committer | Steve Bennetts <steve@lindenlab.com> | 2009-11-18 14:07:35 -0800 |
commit | efb512dc65c43ea73e7b4da3e2c45d276043842e (patch) | |
tree | 3fcf738eb1c46c6c093f85dc7352d93ecbf13e0f | |
parent | 22aa5eed910bbd1b366789cb96247899c744df75 (diff) |
EXT-2644 - Add "Close Session" option to chicklet context menus
-rw-r--r-- | indra/newview/llavataractions.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llavataractions.h | 5 | ||||
-rw-r--r-- | indra/newview/llchiclet.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llfloatergroups.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llgroupactions.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llgroupactions.h | 7 | ||||
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_imchiclet_group.xml | 8 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_imchiclet_p2p.xml | 8 |
9 files changed, 65 insertions, 5 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index ee4a9df15f..0844cca766 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -190,6 +190,19 @@ void LLAvatarActions::startIM(const LLUUID& id) } // 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) { if (id.isNull()) diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 66ea6880db..d9dab95a77 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -74,6 +74,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 */ static void startCall(const LLUUID& id); diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 4078fac4ec..5375c3ea49 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -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); + } } diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 45af515a86..7cb925bc0b 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -327,7 +327,7 @@ void LLPanelGroups::startIM() if (group_list && (group_id = group_list->getCurrentID()).notNull()) { - LLGroupActions::startChat(group_id); + LLGroupActions::startIM(group_id); } } diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index e60bde9fd8..f4e1951c7b 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -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; @@ -299,6 +299,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) { // *TODO: Move all the LLAgent group stuff into another class, such as diff --git a/indra/newview/llgroupactions.h b/indra/newview/llgroupactions.h index 74c84d1561..9750b3e3cb 100644 --- a/indra/newview/llgroupactions.h +++ b/indra/newview/llgroupactions.h @@ -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); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 709525d4e2..4dc8872557 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -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() diff --git a/indra/newview/skins/default/xui/en/menu_imchiclet_group.xml b/indra/newview/skins/default/xui/en/menu_imchiclet_group.xml index 542e319792..dfe4605b7a 100644 --- a/indra/newview/skins/default/xui/en/menu_imchiclet_group.xml +++ b/indra/newview/skins/default/xui/en/menu_imchiclet_group.xml @@ -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> diff --git a/indra/newview/skins/default/xui/en/menu_imchiclet_p2p.xml b/indra/newview/skins/default/xui/en/menu_imchiclet_p2p.xml index c205868429..4cabcb9031 100644 --- a/indra/newview/skins/default/xui/en/menu_imchiclet_p2p.xml +++ b/indra/newview/skins/default/xui/en/menu_imchiclet_p2p.xml @@ -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> |