From 7b8822a24ae0a26228b975ebff3f22a0365ffd9e Mon Sep 17 00:00:00 2001
From: maksymsproductengine <maksymsproductengine@lindenlab.com>
Date: Thu, 28 Feb 2013 19:59:26 +0200
Subject: CHUI-795 FIXED 'Chat history' is enabled but not functional in
 context menu for friend in Conversation pane while all logs cleared.

---
 indra/newview/llfloaterimcontainer.cpp | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index d6571845cc..46ec1d510d 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -1096,12 +1096,9 @@ void LLFloaterIMContainer::doToSelectedConversation(const std::string& command,
         }
         else if("chat_history" == command)
         {
-			const LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(conversationItem->getUUID());
-
-			if (NULL != session)
+			if (selectedIDS.size() > 0)
 			{
-				const LLUUID session_id = session->isOutgoingAdHoc() ? session->generateOutgouigAdHocHash() : session->mSessionID;
-				LLFloaterReg::showInstance("preview_conversation", session_id, true);
+				LLAvatarActions::viewChatHistory(selectedIDS.front());
 			}
         }
         else
@@ -1165,15 +1162,9 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata)
 	}
 
 	//Enable Chat history item for ad-hoc and group conversations
-	if ("can_chat_history" == item)
+	if ("can_chat_history" == item && uuids.size() > 0)
 	{
-		if(getCurSelectedViewModelItem())
-		{
-			if (getCurSelectedViewModelItem()->getType() != LLConversationItem::CONV_PARTICIPANT)
-			{
-				return isConversationLoggingAllowed();
-			}
-		}
+		return LLLogChat::isTranscriptExist(uuids.front());
 	}
 
 	// If nothing is selected(and selected item is not group chat), everything needs to be disabled
-- 
cgit v1.2.3