diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index 919c0202dd..539daefdda 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -631,7 +631,10 @@ void LLDir::setChatLogsDir(const std::string &path) } } -void LLDir::setPerAccountChatLogsDir(const std::string &username) +// FIRE-7343: Seperate chat logs per grid +//void LLDir::setPerAccountChatLogsDir(const std::string &username) +void LLDir::setPerAccountChatLogsDir(const std::string &gridname, const std::string &username, bool append) +// FIRE-7343: Seperate chat logs per grid { // if both first and last aren't set, assume we're grabbing the cached dir if (!username.empty()) @@ -641,9 +644,21 @@ void LLDir::setPerAccountChatLogsDir(const std::string &username) std::string userlower(username); LLStringUtil::toLower(userlower); LLStringUtil::replaceChar(userlower, ' ', '_'); +// FIRE-7343: Seperate chat logs per grid + std::string gridlower(gridname); + LLStringUtil::toLower(gridlower); + LLStringUtil::replaceChar(gridlower, ' ', '_'); +// FIRE-7343: Seperate chat logs per grid mPerAccountChatLogsDir = getChatLogsDir(); mPerAccountChatLogsDir += mDirDelimiter; mPerAccountChatLogsDir += userlower; +// FIRE-7343: Seperate chat logs per grid + // If the user has elected, append the grid name to chat log directories + if (append && !gridname.empty()) + { + mPerAccountChatLogsDir += "." + gridlower; + } + } else { diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h index 6307605495..16ec5521ef 100644 --- a/indra/llvfs/lldir.h +++ b/indra/llvfs/lldir.h @@ -160,7 +160,10 @@ class LLDir static std::string getForbiddenFileChars(); virtual void setChatLogsDir(const std::string &path); // Set the chat logs dir to this user's dir - virtual void setPerAccountChatLogsDir(const std::string &username); // Set the per user chat log directory. +// FIRE-7343: Seperate chat logs per grid + //virtual void setPerAccountChatLogsDir(const std::string &username); // Set the per user chat log directory. + virtual void setPerAccountChatLogsDir(const std::string &gridname, const std::string &username, bool append); // Set the per user chat log directory. +// FIRE-7343: Seperate chat logs per grid virtual void setLindenUserDir(const std::string &username); // Set the linden user dir to this user's dir virtual void setSkinFolder(const std::string &skin_folder); virtual void setSkinThemeFolder(const std::string &theme_folder); // KB: Catznip Viewer-skins diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f8d908fe1a..942419ef4d 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -18862,5 +18862,16 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSAppendGridToLogFolder + + Comment + Append grid name to chat log folder + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 0bcb79b657..ad02b899bb 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1115,7 +1115,11 @@ bool idle_startup() { gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath")); } - gDirUtilp->setPerAccountChatLogsDir(userid); +// FIRE-7343: Seperate chat logs per grid + //gDirUtilp->setPerAccountChatLogsDir(userid); + static LLCachedControl AppendGrid(gSavedSettings, "FSAppendGridToLogFolder"); + gDirUtilp->setPerAccountChatLogsDir(LLGridManager::getInstance()->getGridLabel(), userid, AppendGrid); +// FIRE-7343: Seperate chat logs per grid LLFile::mkdir(gDirUtilp->getChatLogsDir()); LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());