summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterimcontainer.cpp')
-rw-r--r--indra/newview/llfloaterimcontainer.cpp65
1 files changed, 50 insertions, 15 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index e481e056f1..17efeb2ffd 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -586,6 +586,28 @@ void LLFloaterIMContainer::returnFloaterToHost()
floater->onTearOffClicked();
}
+void LLFloaterIMContainer::setMinimized(BOOL b)
+{
+ bool was_minimized = isMinimized();
+ LLMultiFloater::setMinimized(b);
+
+ //Switching from minimized to un-minimized
+ if(was_minimized && !b)
+ {
+ LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(mSelectedSession);
+
+ if(session_floater && !session_floater->isTornOff())
+ {
+ //When in DND mode, remove stored IM notifications
+ //Nearby chat (Null) IMs are not stored while in DND mode, so can ignore removal
+ if(gAgent.isDoNotDisturb() && mSelectedSession.notNull())
+ {
+ LLDoNotDisturbNotificationStorage::getInstance()->removeNotification(LLDoNotDisturbNotificationStorage::toastName, mSelectedSession);
+ }
+ }
+ }
+}
+
void LLFloaterIMContainer::setVisible(BOOL visible)
{ LLFloaterIMNearbyChat* nearby_chat;
if (visible)
@@ -598,10 +620,21 @@ void LLFloaterIMContainer::setVisible(BOOL visible)
// *TODO: find a way to move this to XML as a default panel or something like that
LLSD name("nearby_chat");
LLFloaterReg::toggleInstanceOrBringToFront(name);
- setSelectedSession(LLUUID(NULL));
+ selectConversationPair(LLUUID(NULL), false, false);
}
openNearbyChat();
- selectConversationPair(getSelectedSession(), false, false);
+ flashConversationItemWidget(mSelectedSession,false);
+
+ LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(mSelectedSession);
+ if(session_floater && !session_floater->isMinimized())
+ {
+ //When in DND mode, remove stored IM notifications
+ //Nearby chat (Null) IMs are not stored while in DND mode, so can ignore removal
+ if(gAgent.isDoNotDisturb() && mSelectedSession.notNull())
+ {
+ LLDoNotDisturbNotificationStorage::getInstance()->removeNotification(LLDoNotDisturbNotificationStorage::toastName, mSelectedSession);
+ }
+ }
}
nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat");
@@ -1179,7 +1212,8 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata)
//Enable Chat history item for ad-hoc and group conversations
if ("can_chat_history" == item && uuids.size() > 0)
{
- return LLLogChat::isTranscriptExist(uuids.front());
+ bool is_group = (getCurSelectedViewModelItem()->getType() == LLConversationItem::CONV_SESSION_GROUP);
+ return LLLogChat::isTranscriptExist(uuids.front(),is_group);
}
// If nothing is selected(and selected item is not group chat), everything needs to be disabled
@@ -1390,13 +1424,6 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool
widget->getParentFolder()->setSelection(widget, FALSE, FALSE);
mConversationsRoot->scrollToShowSelection();
}
-
- //When in DND mode, remove stored IM notifications
- //Nearby chat (Null) IMs are not stored while in DND mode, so can ignore removal
- if(gAgent.isDoNotDisturb() && session_id.notNull())
- {
- LLDoNotDisturbNotificationStorage::getInstance()->removeNotification(LLDoNotDisturbNotificationStorage::toastName, session_id);
- }
}
/* floater processing */
@@ -1421,14 +1448,19 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool
{
showStub(true);
}
+
+ //When in DND mode, remove stored IM notifications
+ //Nearby chat (Null) IMs are not stored while in DND mode, so can ignore removal
+ if(gAgent.isDoNotDisturb() && session_id.notNull())
+ {
+ LLDoNotDisturbNotificationStorage::getInstance()->removeNotification(LLDoNotDisturbNotificationStorage::toastName, session_id);
+ }
}
// Set the focus on the selected floater
- if (!session_floater->hasFocus())
+ if (!session_floater->hasFocus() && !session_floater->isMinimized())
{
- BOOL is_minimized = session_floater->isMinimized();
session_floater->setFocus(focus_floater);
- session_floater->setMinimized(is_minimized);
}
}
flashConversationItemWidget(session_id,false);
@@ -1986,8 +2018,11 @@ void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/)
{
// Always unminimize before trying to close.
// Most of the time the user will never see this state.
- setMinimized(FALSE);
-
+ if(isMinimized())
+ {
+ LLMultiFloater::setMinimized(FALSE);
+ }
+
LLFloater::closeFloater(app_quitting);
}