diff options
author | Merov Linden <merov@lindenlab.com> | 2013-04-23 07:23:10 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-04-23 07:23:10 -0700 |
commit | 54de43834c8b89e88db26441e5fe191547fb9e62 (patch) | |
tree | 9ac5911e9821c1ab6f69731c83faee07f539d52e | |
parent | 244734647c38f256ace2d64fde4d3149d37e0e25 (diff) | |
parent | 25c222e31770cb2c10e262b02ae9065521986349 (diff) |
Pull merge from lindenlab/viewer-chui
-rw-r--r-- | indra/newview/llconversationmodel.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llfloaterimcontainer.cpp | 28 | ||||
-rw-r--r-- | indra/newview/lllogchat.cpp | 17 | ||||
-rw-r--r-- | indra/newview/lllogchat.h | 1 |
4 files changed, 47 insertions, 3 deletions
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index c74ce24872..6e95df8383 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -386,6 +386,10 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) addVoiceOptions(items); items.push_back(std::string("chat_history")); } + else if(this->getType() == CONV_SESSION_NEARBY) + { + items.push_back(std::string("chat_history")); + } hide_context_entries(menu, items, disabled_items); } diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 6a6b48cfb1..7519942901 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1165,7 +1165,7 @@ void LLFloaterIMContainer::doToSelectedConversation(const std::string& command, } else if("chat_history" == command) { - if (selectedIDS.size() > 0) + if (selectedIDS.size() > 0) { LLAvatarActions::viewChatHistory(selectedIDS.front()); } @@ -1178,6 +1178,17 @@ void LLFloaterIMContainer::doToSelectedConversation(const std::string& command, } } } + //if there is no LLFloaterIMSession* instance for selected conversation it might be Nearby chat + else + { + if(conversationItem->getType() == LLConversationItem::CONV_SESSION_NEARBY) + { + if("chat_history" == command) + { + LLFloaterReg::showInstance("preview_conversation", LLSD(LLUUID::null), true); + } + } + } } void LLFloaterIMContainer::doToSelected(const LLSD& userdata) @@ -1233,8 +1244,19 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) //Enable Chat history item for ad-hoc and group conversations if ("can_chat_history" == item && uuids.size() > 0) { - bool is_group = (getCurSelectedViewModelItem()->getType() == LLConversationItem::CONV_SESSION_GROUP); - return LLLogChat::isTranscriptExist(uuids.front(),is_group); + //Disable menu item if selected participant is user agent + if(uuids.front() != gAgentID) + { + if (getCurSelectedViewModelItem()->getType() == LLConversationItem::CONV_SESSION_NEARBY) + { + return LLLogChat::isNearbyTranscriptExist(); + } + else + { + 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 diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 82409da4ba..379bbc5f8d 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -671,6 +671,23 @@ bool LLLogChat::isTranscriptExist(const LLUUID& avatar_id, bool is_group) return false; } +bool LLLogChat::isNearbyTranscriptExist() +{ + std::vector<std::string> list_of_transcriptions; + LLLogChat::getListOfTranscriptFiles(list_of_transcriptions); + + std::string file_name; + file_name = makeLogFileName("chat"); + BOOST_FOREACH(std::string& transcript_file_name, list_of_transcriptions) + { + if (transcript_file_name == file_name) + { + return true; + } + } + return false; +} + //*TODO mark object's names in a special way so that they will be distinguishable form avatar name //which are more strict by its nature (only firstname and secondname) //Example, an object's name can be written like "Object <actual_object's_name>" diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index 77bb2a1570..bd70dbaac9 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -68,6 +68,7 @@ public: static void deleteTranscripts(); static bool isTranscriptExist(const LLUUID& avatar_id, bool is_group=false); + static bool isNearbyTranscriptExist(); private: static std::string cleanFileName(std::string filename); |