[FIRE-36242] Display a notification if a chat transcript doesn't exist and tries to be opened externally

This commit is contained in:
Hecklezz
2025-12-24 23:57:36 +10:00
parent 318592a414
commit b8ac4125f7
3 changed files with 32 additions and 3 deletions
+11 -2
View File
@@ -32,6 +32,7 @@
#include "llgroupactions.h"
#include "llconversationloglist.h"
#include "llconversationloglistitem.h"
#include "llnotificationsutil.h" // <FS:TJ/>
#include "llviewermenu.h"
#include "lltrans.h"
#include "llviewercontrol.h" // <FS:CR>
@@ -360,8 +361,16 @@ void LLConversationLogList::onCustomAction(const LLSD& userdata)
// <FS:CR> Open conversation history externally
else if ("chat_history_external" == command_name)
{
gViewerWindow->getWindow()->openFile(LLLogChat::makeLogFileName(
LLConversationLog::getInstance()->getConversation(selected_conversation_session_id)->getHistoryFileName()));
std::string log_file_name = LLLogChat::makeLogFileName(
LLConversationLog::getInstance()->getConversation(selected_conversation_session_id)->getHistoryFileName());
if (gDirUtilp->fileExists(log_file_name))
{
gViewerWindow->getWindow()->openFile(log_file_name);
}
else
{
LLNotificationsUtil::add("ChatHistoryIsMissing");
}
}
// </FS:CR>
}
@@ -307,7 +307,15 @@ void LLFloaterConversationPreview::onMoreHistoryBtnClick()
// <FS:CR> Open chat history externally
void LLFloaterConversationPreview::onBtnOpenExternal()
{
gViewerWindow->getWindow()->openFile(LLLogChat::makeLogFileName(mChatHistoryFileName));
std::string log_file_name = LLLogChat::makeLogFileName(mChatHistoryFileName);
if (gDirUtilp->fileExists(log_file_name))
{
gViewerWindow->getWindow()->openFile(log_file_name);
}
else
{
LLNotificationsUtil::add("ChatHistoryIsMissing");
}
}
// [FS:CR] FIRE-6545
@@ -14976,4 +14976,16 @@ Error message:
[ERROR_MESSAGE] ([ERROR_CODE])
</notification>
<!-- </FS:Zi> -->
<!-- <FS:TJ>-->
<notification
icon="alert.tga"
name="ChatHistoryIsMissing"
type="alertmodal">
Chat transcript file is missing. Either there are no transcripts for this chat, or transcripts aren't being saved.
You can enable saving transcripts under Preferences &gt; Privacy &gt; Logs &amp; Transcripts
<usetemplate
name="okbutton"
yestext="OK"/>
</notification>
<!-- </FS:TJ>-->
</notifications>