diff options
author | AlexanderP ProductEngine <apaschenko@productengine.com> | 2012-12-21 20:05:40 +0200 |
---|---|---|
committer | AlexanderP ProductEngine <apaschenko@productengine.com> | 2012-12-21 20:05:40 +0200 |
commit | dd7509f56de5e8a47680b33176e90c11ed518066 (patch) | |
tree | 4184f5f4df1bbb2ea33fcb056b0213b690392ca0 /indra | |
parent | 7549a392cc32dc36f0bc673a6569f01731cc1bbd (diff) |
CHUI-411 Entries in chat history viewer do not show all dates of entries and some entries show on multiple pages
Type of variable for the time saving was changed from S32 to long int ("capacity" of S32-timer is only ~18 hours!)
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llconversationlog.cpp | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index eb3a3731ee..e44749fd79 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -236,17 +236,20 @@ void LLConversationLog::logConversation(const LLUUID& session_id, BOOL has_offli const LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id); LLConversation* conversation = findConversation(session); - if (session && conversation) + if (session) { - if(has_offline_msg) + if (conversation) { - updateOfflineIMs(session, has_offline_msg); + if(has_offline_msg) + { + updateOfflineIMs(session, has_offline_msg); + } + updateConversationTimestamp(conversation); + } + else + { + createConversation(session); } - updateConversationTimestamp(conversation); - } - else if (session && !conversation) - { - createConversation(session); } } @@ -307,19 +310,17 @@ void LLConversationLog::updateConversationTimestamp(LLConversation* conversation LLConversation* LLConversationLog::findConversation(const LLIMModel::LLIMSession* session) { - if (!session) + if (session) { - return NULL; - } + const LLUUID session_id = session->isOutgoingAdHoc() ? session->generateOutgouigAdHocHash() : session->mSessionID; - const LLUUID session_id = session->isOutgoingAdHoc() ? session->generateOutgouigAdHocHash() : session->mSessionID; - - conversations_vec_t::iterator conv_it = mConversations.begin(); - for(; conv_it != mConversations.end(); ++conv_it) - { - if (conv_it->getSessionID() == session_id) + conversations_vec_t::iterator conv_it = mConversations.begin(); + for(; conv_it != mConversations.end(); ++conv_it) { - return &*conv_it; + if (conv_it->getSessionID() == session_id) + { + return &*conv_it; + } } } @@ -411,8 +412,8 @@ bool LLConversationLog::saveToFile(const std::string& filename) // [1343221177] 0 1 0 John Doe| 7e4ec5be-783f-49f5-71dz-16c58c64c145 4ec62a74-c246-0d25-2af6-846beac2aa55 john.doe| // [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, "[%d] %d %d %d %s| %s %s %s|\n", - (S32)conv_it->getTime(), + fprintf(fp, "[%ld] %d %d %d %s| %s %s %s|\n", + conv_it->getTime(), (S32)conv_it->getConversationType(), (S32)0, (S32)conv_it->hasOfflineMessages(), @@ -446,7 +447,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename) char history_file_name[MAX_STRING]; int has_offline_ims; int stype; - S32 time; + time_t time; // before CHUI-348 it was a flag of conversation voice state int prereserved_unused; @@ -456,7 +457,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename) part_id_buffer[0] = '\0'; conv_id_buffer[0] = '\0'; - sscanf(buffer, "[%d] %d %d %d %[^|]| %s %s %[^|]|", + sscanf(buffer, "[%ld] %d %d %d %[^|]| %s %s %[^|]|", &time, &stype, &prereserved_unused, |