diff --git a/indra/newview/fsfloaterim.cpp b/indra/newview/fsfloaterim.cpp index 089e18bfc6..5cc9e6bad2 100644 --- a/indra/newview/fsfloaterim.cpp +++ b/indra/newview/fsfloaterim.cpp @@ -482,9 +482,13 @@ void FSFloaterIM::onHistoryButtonClicked() { lldebugs << "FSFloaterIM::onHistoryButtonClicked" << llendl; if (gSavedSettings.getBOOL("FSUseBuiltInHistory")) + { LLFloaterReg::showInstance("preview_conversation", mSessionID, true); + } else - LLAvatarActions::viewChatHistoryExternally(mSessionID); + { + gViewerWindow->getWindow()->openFile(LLLogChat::makeLogFileName(LLIMModel::instance().getHistoryFileName(mSessionID))); + } } // support sysinfo button -Zi diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 592d3761fe..e669822069 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -1125,7 +1125,18 @@ void LLAvatarActions::viewChatHistory(const LLUUID& id) LLAvatarNameCache::get(id, &avatar_name); extended_id[LL_FCP_COMPLETE_NAME] = avatar_name.getCompleteName(); - extended_id[LL_FCP_ACCOUNT_NAME] = avatar_name.getAccountName(); + // [Legacy IM logfile names] + //extended_id[LL_FCP_ACCOUNT_NAME] = avatar_name.getAccountName(); + if (gSavedSettings.getBOOL("UseLegacyIMLogNames")) + { + std::string avatar_user_name = avatar_name.getUserName(); + extended_id[LL_FCP_ACCOUNT_NAME] = avatar_user_name.substr(0, avatar_user_name.find(" Resident"));; + } + else + { + extended_id[LL_FCP_ACCOUNT_NAME] = avatar_name.getAccountName(); + } + // [Legacy IM logfile names] LLFloaterReg::showInstance("preview_conversation", extended_id, true); } } @@ -1136,7 +1147,22 @@ void LLAvatarActions::viewChatHistoryExternally(const LLUUID& id) { if (LLLogChat::isTranscriptExist(id)) { - gViewerWindow->getWindow()->openFile(LLLogChat::makeLogFileName(LLIMModel::instance().getHistoryFileName(id))); + LLAvatarName av_name; + + if (LLAvatarNameCache::get(id, &av_name)) + { + std::string history_filename; + if (gSavedSettings.getBOOL("UseLegacyIMLogNames")) + { + std::string user_name = av_name.getUserName(); + history_filename = user_name.substr(0, user_name.find(" Resident"));; + } + else + { + history_filename = LLCacheName::buildUsername(av_name.getUserName()); + } + gViewerWindow->getWindow()->openFile(LLLogChat::makeLogFileName(history_filename)); + } } } // diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index 542302bc40..89c1a3d7f6 100755 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -35,6 +35,8 @@ #include "llviewermenu.h" #include "lltrans.h" #include "llviewercontrol.h" // +#include "llviewerwindow.h" +#include "llwindow.h" static LLDefaultChildRegistry::Register r("conversation_log_list"); @@ -351,7 +353,8 @@ void LLConversationLogList::onCustomAction(const LLSD& userdata) // Open conversation history externally else if ("chat_history_external") { - LLAvatarActions::viewChatHistoryExternally(selected_conversation_participant_id); + gViewerWindow->getWindow()->openFile(LLLogChat::makeLogFileName( + LLConversationLog::getInstance()->getConversation(selected_conversation_session_id)->getHistoryFileName())); } // } diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 5282a07e80..df6b379545 100755 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -40,6 +40,7 @@ #include "llavataractions.h" #include "llviewerwindow.h" #include "llwindow.h" +#include "llconversationlog.h" // const std::string LL_FCP_COMPLETE_NAME("complete_name"); @@ -84,6 +85,8 @@ BOOL LLFloaterConversationPreview::postBuild() name = LLTrans::getString("NearbyChatTitle"); file = "chat"; } + // Remember used log file name + mFileName = file; LLStringUtil::format_map_t args; args["[NAME]"] = name; @@ -205,12 +208,5 @@ void LLFloaterConversationPreview::onMoreHistoryBtnClick() // Open chat history externally void (LLFloaterConversationPreview::onBtnOpenExternal()) { - if (mSessionID.notNull()) - { - LLAvatarActions::viewChatHistoryExternally(mSessionID); - } - else - { - gViewerWindow->getWindow()->openFile(LLLogChat::makeLogFileName("chat")); - } + gViewerWindow->getWindow()->openFile(LLLogChat::makeLogFileName(mFileName)); } diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h index 13dc0d4f61..249da56369 100755 --- a/indra/newview/llfloaterconversationpreview.h +++ b/indra/newview/llfloaterconversationpreview.h @@ -66,6 +66,9 @@ private: std::list mMessages; std::string mAccountName; std::string mCompleteName; + + // Remember used log file name + std::string mFileName; }; #endif /* LLFLOATERCONVERSATIONPREVIEW_H_ */ diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index f22e88e724..a54badb683 100755 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -673,8 +673,21 @@ bool LLLogChat::isTranscriptExist(const LLUUID& avatar_id) { LLAvatarName avatar_name; LLAvatarNameCache::get(avatar_id, &avatar_name); - std::string avatar_user_name = avatar_name.getAccountName(); - std::replace(avatar_user_name.begin(), avatar_user_name.end(), '.', '_'); + // [Legacy IM logfile names] + //std::string avatar_user_name = avatar_name.getAccountName(); + //std::replace(avatar_user_name.begin(), avatar_user_name.end(), '.', '_'); + std::string avatar_user_name; + if (gSavedSettings.getBOOL("UseLegacyIMLogNames")) + { + avatar_user_name = avatar_name.getUserName(); + avatar_user_name = avatar_user_name.substr(0, avatar_user_name.find(" Resident"));; + } + else + { + avatar_user_name = avatar_name.getAccountName(); + std::replace(avatar_user_name.begin(), avatar_user_name.end(), '.', '_'); + } + // [Legacy IM logfile names] BOOST_FOREACH(std::string& transcript_file_name, list_of_transcriptions) {