summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llimfloatercontainer.cpp24
-rw-r--r--indra/newview/llimfloatercontainer.h4
-rw-r--r--indra/newview/llimview.cpp9
-rw-r--r--indra/newview/skins/default/xui/en/menu_conversation.xml1
4 files changed, 28 insertions, 10 deletions
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index c8897c1f92..8a30b5cd68 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -114,8 +114,7 @@ void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id)
void LLIMFloaterContainer::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id)
{
- removeConversationListItem(old_session_id);
- addConversationListItem(new_session_id);
+ addConversationListItem(new_session_id, removeConversationListItem(old_session_id));
}
void LLIMFloaterContainer::sessionRemoved(const LLUUID& session_id)
@@ -147,6 +146,9 @@ BOOL LLIMFloaterContainer::postBuild()
mConversationsListPanel = getChild<LLPanel>("conversations_list_panel");
+ // Open IM session with selected participant on double click event
+ mConversationsListPanel->setDoubleClickCallback(boost::bind(&LLIMFloaterContainer::doToSelected, this, LLSD("im")));
+
// Create the root model and view for all conversation sessions
LLConversationItem* base_item = new LLConversationItem(getRootViewModel());
@@ -964,6 +966,12 @@ bool LLIMFloaterContainer::enableContextMenuItem(const LLSD& userdata)
uuid_vec_t mUUIDs;
getParticipantUUIDs(mUUIDs);
+ if(item == std::string("can_activate_group"))
+ {
+ LLUUID selected_group_id = getCurSelectedViewModelItem()->getUUID();
+ return gAgent.getGroupID() != selected_group_id;
+ }
+
if(mUUIDs.size() <= 0)
{
return false;
@@ -1141,7 +1149,7 @@ void LLIMFloaterContainer::setNearbyDistances()
}
}
-void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid)
+void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid, bool isWidgetSelected /*= false*/)
{
bool is_nearby_chat = uuid.isNull();
@@ -1196,7 +1204,10 @@ void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid)
current_participant_model++;
}
- setConvItemSelect(uuid);
+ if (isWidgetSelected)
+ {
+ setConvItemSelect(uuid);
+ }
// set the widget to minimized mode if conversations pane is collapsed
widget->toggleMinimizedMode(mConversationsPane->isCollapsed());
@@ -1204,17 +1215,19 @@ void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid)
return;
}
-void LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool change_focus)
+bool LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool change_focus)
{
// Delete the widget and the associated conversation item
// Note : since the mConversationsItems is also the listener to the widget, deleting
// the widget will also delete its listener
+ bool isWidgetSelected = false;
conversations_widgets_map::iterator widget_it = mConversationsWidgets.find(uuid);
if (widget_it != mConversationsWidgets.end())
{
LLFolderViewItem* widget = widget_it->second;
if (widget)
{
+ isWidgetSelected = widget->isSelected();
widget->destroyView();
}
}
@@ -1235,6 +1248,7 @@ void LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool c
widget->selectItem();
}
}
+ return isWidgetSelected;
}
LLConversationViewSession* LLIMFloaterContainer::createConversationItemWidget(LLConversationItem* item)
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
index c9da213f8c..6643471d97 100644
--- a/indra/newview/llimfloatercontainer.h
+++ b/indra/newview/llimfloatercontainer.h
@@ -136,8 +136,8 @@ private:
// Conversation list implementation
public:
- void removeConversationListItem(const LLUUID& uuid, bool change_focus = true);
- void addConversationListItem(const LLUUID& uuid);
+ bool removeConversationListItem(const LLUUID& uuid, bool change_focus = true);
+ void addConversationListItem(const LLUUID& uuid, bool isWidgetSelected = false);
void setTimeNow(const LLUUID& session_id, const LLUUID& participant_id);
void setNearbyDistances();
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index eea59c223a..115da54ec8 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -643,6 +643,12 @@ void LLIMModel::processSessionInitializedReply(const LLUUID& old_session_id, con
{
session->sessionInitReplyReceived(new_session_id);
+ if (old_session_id != new_session_id)
+ {
+ mId2SessionMap.erase(old_session_id);
+ mId2SessionMap[new_session_id] = session;
+ }
+
LLIMFloater* im_floater = LLIMFloater::findInstance(old_session_id);
if (im_floater)
{
@@ -651,9 +657,6 @@ void LLIMModel::processSessionInitializedReply(const LLUUID& old_session_id, con
if (old_session_id != new_session_id)
{
- mId2SessionMap.erase(old_session_id);
- mId2SessionMap[new_session_id] = session;
-
gIMMgr->notifyObserverSessionIDUpdated(old_session_id, new_session_id);
}
diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml
index 912ff811d9..682d70e4f0 100644
--- a/indra/newview/skins/default/xui/en/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/en/menu_conversation.xml
@@ -117,6 +117,7 @@
layout="topleft"
name="activate_group">
<on_click function="Group.DoToSelected" parameter="activate_group"/>
+ <on_enable function="Avatar.EnableItem" parameter="can_activate_group" />
</menu_item_call>
<menu_item_call
label="Leave Group"