summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Kondrashev <ekondrashev@productengine.com>2009-11-18 17:57:47 +0200
committerEugene Kondrashev <ekondrashev@productengine.com>2009-11-18 17:57:47 +0200
commitb3cb61a26a0e4c7bfc3c18fd2705325a795684b8 (patch)
treee6d3474189d2978d6b18be756c8bfe0882a0f87c
parentfce52249abdba7a865f03c88692a45e8ff972763 (diff)
Fixed major bug EXT-2532-IM timestamp is when message is viewed, not when it was sent and received. Time str from the arriving message used now instead of constructing it dynamicly.
--HG-- branch : product-engine
-rw-r--r--indra/llcommon/llchat.h2
-rw-r--r--indra/newview/llchathistory.cpp19
-rw-r--r--indra/newview/llimfloater.cpp1
3 files changed, 5 insertions, 17 deletions
diff --git a/indra/llcommon/llchat.h b/indra/llcommon/llchat.h
index acd0da61a4..5af7991006 100644
--- a/indra/llcommon/llchat.h
+++ b/indra/llcommon/llchat.h
@@ -84,6 +84,7 @@ public:
mAudible(CHAT_AUDIBLE_FULLY),
mMuted(FALSE),
mTime(0.0),
+ mTimeStr(),
mPosAgent(),
mURL(),
mChatStyle(CHAT_STYLE_NORMAL)
@@ -97,6 +98,7 @@ public:
EChatAudible mAudible;
BOOL mMuted; // pass muted chat to maintain list of chatters
F64 mTime; // viewer only, seconds from viewer start
+ std::string mTimeStr;
LLVector3 mPosAgent;
std::string mURL;
EChatStyle mChatStyle;
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index cd5c5edac0..4ce3b50ed5 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -50,21 +50,6 @@
static LLDefaultChildRegistry::Register<LLChatHistory> r("chat_history");
-std::string formatCurrentTime()
-{
- time_t utc_time;
- utc_time = time_corrected();
- std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:["
- +LLTrans::getString("TimeMin")+"]";
-
- LLSD substitution;
-
- substitution["datetime"] = (S32) utc_time;
- LLStringUtil::format (timeStr, substitution);
-
- return timeStr;
-}
-
class LLChatHistoryHeader: public LLPanel
{
public:
@@ -219,7 +204,7 @@ public:
LLTextBox* timeBox = getChild<LLTextBox>("time_box");
- timeBox->setValue(formatCurrentTime());
+ timeBox->setValue(chat.mTimeStr);
LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon");
@@ -352,7 +337,7 @@ LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style
void LLChatHistory::appendWidgetMessage(const LLChat& chat, const LLStyle::Params& input_append_params)
{
LLView* view = NULL;
- std::string view_text = "\n[" + formatCurrentTime() + "] ";
+ std::string view_text = "\n[" + chat.mTimeStr + "] ";
if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM)
view_text += chat.mFromName + ": ";
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index c2c83191e0..bfac35d866 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -474,6 +474,7 @@ void LLIMFloater::updateMessages()
chat.mFromID = from_id;
chat.mFromName = from;
chat.mText = message;
+ chat.mTimeStr = time;
//Handle IRC styled /me messages.
std::string prefix = message.substr(0, 4);