From a2e22732f195dc075a733c79f15156752f522a43 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 30 Jul 2013 19:13:45 -0700 Subject: Summer cleaning - removed a lot of llcommon dependencies to speed up build times consolidated most indra-specific constants in llcommon under indra_constants.h fixed issues with operations on mixed unit types (implicit and explicit) made LL_INFOS() style macros variadic in order to subsume other logging methods such as ll_infos added optional tag output to error recorders --- indra/newview/llconversationlog.cpp | 66 +++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 35 deletions(-) (limited to 'indra/newview/llconversationlog.cpp') diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 7883e4cb89..7ecc572a8a 100755 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -37,21 +37,16 @@ const int CONVERSATION_LIFETIME = 30; // lifetime of LLConversation is 30 days by spec -struct ConversationParams -{ - ConversationParams(time_t time) - : mTime(time), - mTimestamp(LLConversation::createTimestamp(time)) - {} - - time_t mTime; - std::string mTimestamp; - SessionType mConversationType; - std::string mConversationName; - std::string mHistoryFileName; - LLUUID mSessionID; - LLUUID mParticipantID; - bool mHasOfflineIMs; +struct ConversationParams : public LLInitParam::Block +{ + Mandatory > time; + Mandatory timestamp; + Mandatory conversation_type; + Mandatory conversation_name, + history_filename; + Mandatory session_id, + participant_id; + Mandatory has_offline_ims; }; /************************************************************************/ @@ -59,14 +54,14 @@ struct ConversationParams /************************************************************************/ LLConversation::LLConversation(const ConversationParams& params) -: mTime(params.mTime), - mTimestamp(params.mTimestamp), - mConversationType(params.mConversationType), - mConversationName(params.mConversationName), - mHistoryFileName(params.mHistoryFileName), - mSessionID(params.mSessionID), - mParticipantID(params.mParticipantID), - mHasOfflineIMs(params.mHasOfflineIMs) +: mTime(params.time), + mTimestamp(params.timestamp), + mConversationType(params.conversation_type), + mConversationName(params.conversation_name), + mHistoryFileName(params.history_filename), + mSessionID(params.session_id), + mParticipantID(params.participant_id), + mHasOfflineIMs(params.has_offline_ims) { setListenIMFloaterOpened(); } @@ -118,11 +113,11 @@ void LLConversation::onIMFloaterShown(const LLUUID& session_id) } // static -const std::string LLConversation::createTimestamp(const time_t& utc_time) +const std::string LLConversation::createTimestamp(const LLUnit& utc_time) { std::string timeStr; LLSD substitution; - substitution["datetime"] = (S32) utc_time; + substitution["datetime"] = (S32)utc_time.value(); timeStr = "["+LLTrans::getString ("TimeMonth")+"]/[" +LLTrans::getString ("TimeDay")+"]/[" @@ -137,8 +132,8 @@ const std::string LLConversation::createTimestamp(const time_t& utc_time) bool LLConversation::isOlderThan(U32 days) const { - time_t now = time_corrected(); - U32 age = (U32)((now - mTime) / SEC_PER_DAY); // age of conversation in days + LLUnit now = time_corrected(); + LLUnit age = now - mTime; return age > days; } @@ -485,7 +480,7 @@ bool LLConversationLog::saveToFile(const std::string& filename) // [1343222639] 2 0 0 Ad-hoc Conference| c3g67c89-c479-4c97-b21d-32869bcfe8rc 68f1c33e-4135-3e3e-a897-8c9b23115c09 Ad-hoc Conference hash597394a0-9982-766d-27b8-c75560213b9a| fprintf(fp, "[%lld] %d %d %d %s| %s %s %s|\n", - (S64)conv_it->getTime(), + (S64)conv_it->getTime().value(), (S32)conv_it->getConversationType(), (S32)0, (S32)conv_it->hasOfflineMessages(), @@ -539,13 +534,14 @@ bool LLConversationLog::loadFromFile(const std::string& filename) conv_id_buffer, history_file_name); - ConversationParams params((time_t)time); - params.mConversationType = (SessionType)stype; - params.mHasOfflineIMs = has_offline_ims; - params.mConversationName = std::string(conv_name_buffer); - params.mParticipantID = LLUUID(part_id_buffer); - params.mSessionID = LLUUID(conv_id_buffer); - params.mHistoryFileName = std::string(history_file_name); + ConversationParams params; + params.time(time) + .conversation_type((SessionType)stype) + .has_offline_ims(has_offline_ims) + .conversation_name(conv_name_buffer) + .participant_id(LLUUID(part_id_buffer)) + .session_id(LLUUID(conv_id_buffer)) + .history_filename(history_file_name); LLConversation conversation(params); -- cgit v1.2.3 From e340009fc59d59e59b2e8d903a884acb76b178eb Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 9 Aug 2013 17:11:19 -0700 Subject: second phase summer cleaning replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc. --- indra/newview/llconversationlog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llconversationlog.cpp') diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 7ecc572a8a..8dd148e304 100755 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -455,14 +455,14 @@ bool LLConversationLog::saveToFile(const std::string& filename) { if (!filename.size()) { - llwarns << "Call log list filename is empty!" << llendl; + LL_WARNS() << "Call log list filename is empty!" << LL_ENDL; return false; } LLFILE* fp = LLFile::fopen(filename, "wb"); if (!fp) { - llwarns << "Couldn't open call log list" << filename << llendl; + LL_WARNS() << "Couldn't open call log list" << filename << LL_ENDL; return false; } @@ -496,14 +496,14 @@ bool LLConversationLog::loadFromFile(const std::string& filename) { if(!filename.size()) { - llwarns << "Call log list filename is empty!" << llendl; + LL_WARNS() << "Call log list filename is empty!" << LL_ENDL; return false; } LLFILE* fp = LLFile::fopen(filename, "rb"); if (!fp) { - llwarns << "Couldn't open call log list" << filename << llendl; + LL_WARNS() << "Couldn't open call log list" << filename << LL_ENDL; return false; } -- cgit v1.2.3 From 26581404e426b00cd0a07c38b5cb858d5d5faa28 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 14 Aug 2013 11:51:49 -0700 Subject: BUILDFIX: added header for numeric_limits support on gcc added convenience types for units F32Seconds, etc. --- indra/newview/llconversationlog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llconversationlog.cpp') diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 8dd148e304..a17a4e5e21 100755 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -132,7 +132,7 @@ const std::string LLConversation::createTimestamp(const LLUnit now = time_corrected(); + LLUnit now(time_corrected()); LLUnit age = now - mTime; return age > days; @@ -535,7 +535,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename) history_file_name); ConversationParams params; - params.time(time) + params.time(LLUnits::Seconds::fromValue(time)) .conversation_type((SessionType)stype) .has_offline_ims(has_offline_ims) .conversation_name(conv_name_buffer) -- cgit v1.2.3 From 9f7bfa1c3710856cd2b0a0a8a429d6c45b0fcd09 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 15 Aug 2013 00:02:23 -0700 Subject: moved unit types out of LLUnits namespace, since they are prefixed --- indra/newview/llconversationlog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llconversationlog.cpp') diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index a17a4e5e21..9311056a27 100755 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -39,7 +39,7 @@ const int CONVERSATION_LIFETIME = 30; // lifetime of LLConversation is 30 days b struct ConversationParams : public LLInitParam::Block { - Mandatory > time; + Mandatory time; Mandatory timestamp; Mandatory conversation_type; Mandatory conversation_name, @@ -113,7 +113,7 @@ void LLConversation::onIMFloaterShown(const LLUUID& session_id) } // static -const std::string LLConversation::createTimestamp(const LLUnit& utc_time) +const std::string LLConversation::createTimestamp(const U64Seconds& utc_time) { std::string timeStr; LLSD substitution; @@ -132,7 +132,7 @@ const std::string LLConversation::createTimestamp(const LLUnit now(time_corrected()); + U64Seconds now(time_corrected()); LLUnit age = now - mTime; return age > days; -- cgit v1.2.3 From 612892b45a3413b16e40c49d3bfde77a4ca927fd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 18 Aug 2013 22:30:27 -0700 Subject: SH-4433 WIP: Interesting: Statistics > Ping Sim is always 0 ms continued conversion to units system made units perform type promotion correctly and preserve type in arithmetic e.g. can now do LLVector3 in units added typedefs for remaining common unit types, including implicits --- indra/newview/llconversationlog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llconversationlog.cpp') diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 9311056a27..03b1f14a03 100755 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -35,7 +35,7 @@ #include #include "boost/lexical_cast.hpp" -const int CONVERSATION_LIFETIME = 30; // lifetime of LLConversation is 30 days by spec +const S32Days CONVERSATION_LIFETIME = (S32Days)30; // lifetime of LLConversation is 30 days by spec struct ConversationParams : public LLInitParam::Block { @@ -100,7 +100,7 @@ LLConversation::~LLConversation() void LLConversation::updateTimestamp() { - mTime = time_corrected(); + mTime = (U64Seconds)time_corrected(); mTimestamp = createTimestamp(mTime); } @@ -130,10 +130,10 @@ const std::string LLConversation::createTimestamp(const U64Seconds& utc_time) return timeStr; } -bool LLConversation::isOlderThan(U32 days) const +bool LLConversation::isOlderThan(U32Days days) const { U64Seconds now(time_corrected()); - LLUnit age = now - mTime; + U32Days age = now - mTime; return age > days; } -- cgit v1.2.3 From ccc15df25f86d14bb28c550d64ca4ed77f3fde6e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 26 Feb 2014 11:58:37 -0800 Subject: MAINT-3448 FIX: Timestamps disappear from conversation log after viewer restart --- indra/newview/llconversationlog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llconversationlog.cpp') diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 03b1f14a03..91f99d7b47 100755 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -55,7 +55,7 @@ struct ConversationParams : public LLInitParam::Block LLConversation::LLConversation(const ConversationParams& params) : mTime(params.time), - mTimestamp(params.timestamp), + mTimestamp(params.timestamp.isProvided() ? params.timestamp : createTimestamp(params.time)), mConversationType(params.conversation_type), mConversationName(params.conversation_name), mHistoryFileName(params.history_filename), -- cgit v1.2.3 From ac9849fb03ec5173ff7ec1b968550e006e8c769e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 26 Feb 2014 11:59:49 -0800 Subject: fixed mispelling of generateOutgoingAdHocHash --- indra/newview/llconversationlog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llconversationlog.cpp') diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 91f99d7b47..05c7e6caa5 100755 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -72,7 +72,7 @@ LLConversation::LLConversation(const LLIMModel::LLIMSession& session) mConversationType(session.mSessionType), mConversationName(session.mName), mHistoryFileName(session.mHistoryFileName), - mSessionID(session.isOutgoingAdHoc() ? session.generateOutgouigAdHocHash() : session.mSessionID), + mSessionID(session.isOutgoingAdHoc() ? session.generateOutgoingAdHocHash() : session.mSessionID), mParticipantID(session.mOtherParticipantID), mHasOfflineIMs(session.mHasOfflineMessage) { @@ -313,7 +313,7 @@ LLConversation* LLConversationLog::findConversation(const LLIMModel::LLIMSession { if (session) { - const LLUUID session_id = session->isOutgoingAdHoc() ? session->generateOutgouigAdHocHash() : session->mSessionID; + const LLUUID session_id = session->isOutgoingAdHoc() ? session->generateOutgoingAdHocHash() : session->mSessionID; conversations_vec_t::iterator conv_it = mConversations.begin(); for(; conv_it != mConversations.end(); ++conv_it) -- cgit v1.2.3