diff options
author | Wolfpup Lowenhar <wolfpup67@earthlink.net> | 2010-11-23 17:32:00 -0500 |
---|---|---|
committer | Wolfpup Lowenhar <wolfpup67@earthlink.net> | 2010-11-23 17:32:00 -0500 |
commit | 379c3858773e9079fbe9b0838b5f7625b5821718 (patch) | |
tree | a1cb0bebc67892fe2c597e8c4c0fee2088f6947f /indra/newview | |
parent | 2e47e4f303b9b4d9222cbf6310e0a887468e3109 (diff) |
STORM-102: this is to correct a minor issue with ad-hoc conferences so that they do not
get date stamped at all since each one is defined as a unique conversation.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llimview.cpp | 7 | ||||
-rw-r--r-- | indra/newview/lllogchat.cpp | 46 |
2 files changed, 40 insertions, 13 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 3578c98622..2f40f51763 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -555,7 +555,12 @@ void LLIMModel::LLIMSession::buildHistoryFileName() //ad-hoc requires sophisticated chat history saving schemes if (isAdHoc()) { - //in case of outgoing ad-hoc sessions + /* in case of outgoing ad-hoc sessions we need to make specilized names + * if this naming system is ever changed then the filtering definitions in + * lllogchat.cpp need to be change acordingly so that the filtering for the + * date stamp code introduced in STORM-102 will work properly and not add + * a date stamp to the Ad-hoc conferences. + */ if (mInitialTargetIDs.size()) { std::set<LLUUID> sorted_uuids(mInitialTargetIDs.begin(), mInitialTargetIDs.end()); diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 2fb5ba82ba..0121bbb1ed 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -89,6 +89,16 @@ const static boost::regex TIMESTAMP_AND_STUFF("^(\\[\\d{4}/\\d{1,2}/\\d{1,2}\\s+ */ const static boost::regex NAME_AND_TEXT("([^:]+[:]{1})?(\\s*)(.*)"); +/**
+ * These are recognizers for matching the names of ad-hoc conferences when generating the log file name
+ * On invited side, an ad-hoc is named like "<first name> <last name> Conference 2010/11/19 03:43 f0f4"
+ * On initiating side, an ad-hoc is named like Ad-hoc Conference hash<hash>"
+ * If the naming system for ad-hoc conferences are change in LLIMModel::LLIMSession::buildHistoryFileName()
+ * then these definition need to be adjusted as well.
+ */
+const static boost::regex INBOUND_CONFERENCE("^[a-zA-Z]{1,31} [a-zA-Z]{1,31} Conference [0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2} [0-9a-f]{4}");
+const static boost::regex OUTBOUND_CONFERENCE("^Ad-hoc Conference hash[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}");
+ //is used to parse complex object names like "Xstreet SL Terminal v2.2.5 st" const static std::string NAME_TEXT_DIVIDER(": "); @@ -182,25 +192,37 @@ private: //static std::string LLLogChat::makeLogFileName(std::string filename) { - if( gSavedPerAccountSettings.getBOOL("LogFileNamewithDate") ) + /** + * Testing for in bound and out bound ad-hoc file names + * if it is then skip date stamping. + **/ + //LL_INFOS("") << "Befor:" << filename << LL_ENDL;/* uncomment if you want to verify step, delete on commit */ + boost::match_results<std::string::const_iterator> matches; + bool inboundConf = boost::regex_match(filename, matches, INBOUND_CONFERENCE); + bool outboundConf = boost::regex_match(filename, matches, OUTBOUND_CONFERENCE); + if (!(inboundConf || outboundConf)) { - time_t now; - time(&now); - char dbuffer[20]; /* Flawfinder: ignore */ - if (filename == "chat") + if( gSavedPerAccountSettings.getBOOL("LogFileNamewithDate") ) { - strftime(dbuffer, 20, "-%Y-%m-%d", localtime(&now)); - } - else - { - strftime(dbuffer, 20, "-%Y-%m", localtime(&now)); + time_t now; + time(&now); + char dbuffer[20]; /* Flawfinder: ignore */ + if (filename == "chat") + { + strftime(dbuffer, 20, "-%Y-%m-%d", localtime(&now)); + } + else + { + strftime(dbuffer, 20, "-%Y-%m", localtime(&now)); + } + filename += dbuffer; } - filename += dbuffer; } + //LL_INFOS("") << "After:" << filename << LL_ENDL;/* uncomment if you want to verify step, delete on commit */ filename = cleanFileName(filename); filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_ACCOUNT_CHAT_LOGS,filename); filename += ".txt"; - //LL_INFOS("") << "Current:" << filename << LL_ENDL;/* uncomment if you want to verify step, delete on commit */ + //LL_INFOS("") << "Full:" << filename << LL_ENDL;/* uncomment if you want to verify step, delete on commit */ return filename; } |