From 2f9cc80c2e0a6ca648871ed74cc10b813d2c4940 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 5 Mar 2010 17:53:32 +0200 Subject: fixed EXT-5910 “Offers logging”, fixed IM message counter when received interactive notification(offer); corrected logging to file of offer notification; enabled logging for FRIENDSHIP_ACCEPTED notification; MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llimview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index b3f085ef6d..9ea8364491 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -723,7 +723,9 @@ LLIMModel::LLIMSession* LLIMModel::addMessageSilently(const LLUUID& session_id, session->mNumUnread++; //update count of unread messages from real participant - if (!(from_id.isNull() || from_id == gAgentID || SYSTEM_FROM == from)) + if (!(from_id.isNull() || from_id == gAgentID || SYSTEM_FROM == from) + // we should increment counter for interactive system messages() + || INTERACTIVE_SYSTEM_FROM == from) { ++(session->mParticipantUnreadMessageCount); } -- cgit v1.3 From 33133d4d7c5ee060dfbd6cb03fe50d8da0235146 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 9 Mar 2010 14:05:09 +0200 Subject: fixed EXT-5910 “Offers logging”, replaced interactive system message marker with correct from string value; MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llimview.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 9ea8364491..6ce06adc80 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -717,8 +717,15 @@ LLIMModel::LLIMSession* LLIMModel::addMessageSilently(const LLUUID& session_id, return NULL; } - addToHistory(session_id, from, from_id, utf8_text); - if (log2file) logToFile(session_id, from, from_id, utf8_text); + // replace interactive system message marker with correct from string value + std::string from_name = from; + if (INTERACTIVE_SYSTEM_FROM == from) + { + from_name = SYSTEM_FROM; + } + + addToHistory(session_id, from_name, from_id, utf8_text); + if (log2file) logToFile(session_id, from_name, from_id, utf8_text); session->mNumUnread++; -- cgit v1.3 From 2d0ca224ea7a05a38e51979d201e55b7e942c855 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 19 Mar 2010 17:27:54 +0200 Subject: fixed EXT-6472 “No indication about new message/offer if IM window is open but not in focus”, allowed to increment IM message counter when IM window is opened but doesn't have focus and reset IM counter when IM window get focus; reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/76/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 2 +- indra/newview/llimfloater.cpp | 16 +++++++++++++++- indra/newview/llimview.cpp | 23 ++++++++++++++++++++--- indra/newview/llimview.h | 11 +++++++++++ 4 files changed, 47 insertions(+), 5 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 8efa814a2e..1f92686a43 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -1137,7 +1137,7 @@ void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){ S32 unread = data["participant_unread"].asInteger(); LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); - if (im_floater && im_floater->getVisible()) + if (im_floater && im_floater->getVisible() && im_floater->hasFocus()) { unread = 0; } diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index f0e195c37a..91f4f57e54 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -128,6 +128,11 @@ void LLIMFloater::onFocusReceived() LLIMModel::getInstance()->setActiveSessionID(mSessionID); LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(mSessionID, true); + + if (getVisible()) + { + LLIMModel::instance().sendNoUnreadMessages(mSessionID); + } } // virtual @@ -609,7 +614,16 @@ void LLIMFloater::updateMessages() bool use_plain_text_chat_history = gSavedSettings.getBOOL("PlainTextChatHistory"); std::list messages; - LLIMModel::instance().getMessages(mSessionID, messages, mLastMessageIndex+1); + + // we shouldn't reset unread message counters if IM floater doesn't have focus + if (hasFocus()) + { + LLIMModel::instance().getMessages(mSessionID, messages, mLastMessageIndex+1); + } + else + { + LLIMModel::instance().getMessagesSilently(mSessionID, messages, mLastMessageIndex+1); + } if (messages.size()) { diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6ce06adc80..7a4febec20 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -608,10 +608,10 @@ bool LLIMModel::clearSession(const LLUUID& session_id) return true; } -void LLIMModel::getMessages(const LLUUID& session_id, std::list& messages, int start_index) +void LLIMModel::getMessagesSilently(const LLUUID& session_id, std::list& messages, int start_index) { LLIMSession* session = findIMSession(session_id); - if (!session) + if (!session) { llwarns << "session " << session_id << "does not exist " << llendl; return; @@ -619,7 +619,7 @@ void LLIMModel::getMessages(const LLUUID& session_id, std::list& messages, int i = session->mMsgs.size() - start_index; - for (std::list::iterator iter = session->mMsgs.begin(); + for (std::list::iterator iter = session->mMsgs.begin(); iter != session->mMsgs.end() && i > 0; iter++) { @@ -628,6 +628,16 @@ void LLIMModel::getMessages(const LLUUID& session_id, std::list& messages, messages.push_back(*iter); i--; } +} + +void LLIMModel::sendNoUnreadMessages(const LLUUID& session_id) +{ + LLIMSession* session = findIMSession(session_id); + if (!session) + { + llwarns << "session " << session_id << "does not exist " << llendl; + return; + } session->mNumUnread = 0; session->mParticipantUnreadMessageCount = 0; @@ -639,6 +649,13 @@ void LLIMModel::getMessages(const LLUUID& session_id, std::list& messages, mNoUnreadMsgsSignal(arg); } +void LLIMModel::getMessages(const LLUUID& session_id, std::list& messages, int start_index) +{ + getMessagesSilently(session_id, messages, start_index); + + sendNoUnreadMessages(session_id); +} + bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) { LLIMSession* session = findIMSession(session_id); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index e7404074e0..f1693d0e17 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -177,6 +177,17 @@ public: */ bool clearSession(const LLUUID& session_id); + /** + * Populate supplied std::list with messages starting from index specified by start_index without + * emitting no unread messages signal. + */ + void getMessagesSilently(const LLUUID& session_id, std::list& messages, int start_index = 0); + + /** + * Sends no unread messages signal. + */ + void sendNoUnreadMessages(const LLUUID& session_id); + /** * Populate supplied std::list with messages starting from index specified by start_index */ -- cgit v1.3