diff options
Diffstat (limited to 'indra/newview/lllogchat.cpp')
-rw-r--r-- | indra/newview/lllogchat.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 92f19c9232..96ce01c05f 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -35,7 +35,6 @@ #include "llagent.h" #include "llagentui.h" #include "lllogchat.h" -#include "llfloaterchat.h" #include "lltrans.h" #include "llviewercontrol.h" @@ -139,16 +138,20 @@ void LLLogChat::saveHistory(const std::string& filename, const LLUUID& from_id, const std::string& line) { - if(!filename.size()) + std::string tmp_filename = filename; + LLStringUtil::trim(tmp_filename); + if (tmp_filename.empty()) { - llinfos << "Filename is Empty!" << llendl; + std::string warn = "Chat history filename [" + filename + "] is empty!"; + llwarning(warn, 666); + llassert(tmp_filename.size()); return; } - + llofstream file (LLLogChat::makeLogFileName(filename), std::ios_base::app); if (!file.is_open()) { - llinfos << "Couldn't open chat history log!" << llendl; + llwarns << "Couldn't open chat history log! - " + filename << llendl; return; } @@ -238,15 +241,15 @@ void append_to_last_message(std::list<LLSD>& messages, const std::string& line) messages.back()[IM_TEXT] = im_text; } -void LLLogChat::loadAllHistory(const std::string& session_name, std::list<LLSD>& messages) +void LLLogChat::loadAllHistory(const std::string& file_name, std::list<LLSD>& messages) { - if (session_name.empty()) + if (file_name.empty()) { llwarns << "Session name is Empty!" << llendl; return ; } - LLFILE* fptr = LLFile::fopen(makeLogFileName(session_name), "r"); /*Flawfinder: ignore*/ + LLFILE* fptr = LLFile::fopen(makeLogFileName(file_name), "r"); /*Flawfinder: ignore*/ if (!fptr) return; //No previous conversation with this name. char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/ |