From 4b6e1c26f05d89aa130a899803553940069457c0 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 22 Feb 2013 17:08:33 +0200 Subject: CHUI-633 FIXED User is not able to open chat history by 'View chat history' menu item from pop-up menu of People floater --- indra/newview/llavataractions.cpp | 14 +++++++++++++- indra/newview/llfloaterconversationpreview.cpp | 17 ++++++++++++++--- indra/newview/llfloaterconversationpreview.h | 5 +++++ indra/newview/lllogchat.cpp | 26 ++++++++++++++++++++++++++ indra/newview/lllogchat.h | 1 + indra/newview/llpanelpeoplemenus.cpp | 7 ++++++- 6 files changed, 65 insertions(+), 5 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index d6e457887b..ce063a9887 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -44,6 +44,7 @@ #include "llcallingcard.h" // for LLAvatarTracker #include "llconversationlog.h" #include "llfloateravatarpicker.h" // for LLFloaterAvatarPicker +#include "llfloaterconversationpreview.h" #include "llfloatergroupinvite.h" #include "llfloatergroups.h" #include "llfloaterreg.h" @@ -926,9 +927,20 @@ void LLAvatarActions::viewChatHistory(const LLUUID& id) if (iter->getParticipantID() == id) { LLFloaterReg::showInstance("preview_conversation", iter->getSessionID(), true); - break; + return; } } + + if (LLLogChat::isTranscriptExist(id)) + { + LLAvatarName avatar_name; + LLSD extended_id(id); + + LLAvatarNameCache::get(id, &avatar_name); + extended_id[LL_FCP_COMPLETE_NAME] = avatar_name.getCompleteName(); + extended_id[LL_FCP_ACCOUNT_NAME] = avatar_name.getAccountName(); + LLFloaterReg::showInstance("preview_conversation", extended_id, true); + } } //== private methods ======================================================================================== diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 48e0caa0ce..a3d715530d 100644 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -33,13 +33,19 @@ #include "llspinctrl.h" #include "lltrans.h" +const std::string LL_FCP_COMPLETE_NAME("complete_name"); +const std::string LL_FCP_ACCOUNT_NAME("user_name"); + LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_id) : LLFloater(session_id), mChatHistory(NULL), mSessionID(session_id.asUUID()), mCurrentPage(0), - mPageSize(gSavedSettings.getS32("ConversationHistoryPageSize")) -{} + mPageSize(gSavedSettings.getS32("ConversationHistoryPageSize")), + mAccountName(session_id[LL_FCP_ACCOUNT_NAME]), + mCompleteName(session_id[LL_FCP_COMPLETE_NAME]) +{ +} BOOL LLFloaterConversationPreview::postBuild() { @@ -49,7 +55,12 @@ BOOL LLFloaterConversationPreview::postBuild() std::string name; std::string file; - if (mSessionID != LLUUID::null && conv) + if (mAccountName != "") + { + name = mCompleteName; + file = mAccountName; + } + else if (mSessionID != LLUUID::null && conv) { name = conv->getConversationName(); file = conv->getHistoryFileName(); diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h index 0341e5d2a0..b17ae84b63 100644 --- a/indra/newview/llfloaterconversationpreview.h +++ b/indra/newview/llfloaterconversationpreview.h @@ -29,6 +29,9 @@ #include "llchathistory.h" #include "llfloater.h" +extern const std::string LL_FCP_COMPLETE_NAME; //"complete_name" +extern const std::string LL_FCP_ACCOUNT_NAME; //"user_name" + class LLSpinCtrl; class LLFloaterConversationPreview : public LLFloater @@ -54,6 +57,8 @@ private: int mPageSize; std::list mMessages; + std::string mAccountName; + std::string mCompleteName; }; #endif /* LLFLOATERCONVERSATIONPREVIEW_H_ */ diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 17b72c5023..09f816a4e6 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -28,6 +28,7 @@ #include "llagent.h" #include "llagentui.h" +#include "llavatarnamecache.h" #include "lllogchat.h" #include "lltrans.h" #include "llviewercontrol.h" @@ -540,6 +541,31 @@ void LLLogChat::deleteTranscripts() LLFloaterIMSessionTab::processChatHistoryStyleUpdate(true); } +// static +bool LLLogChat::isTranscriptExist(const LLUUID& avatar_id) +{ + std::vector list_of_transcriptions; + LLLogChat::getListOfTranscriptFiles(list_of_transcriptions); + + if (list_of_transcriptions.size() > 0) + { + LLAvatarName avatar_name; + LLAvatarNameCache::get(avatar_id, &avatar_name); + std::string avatar_user_name = avatar_name.getAccountName(); + std::replace(avatar_user_name.begin(), avatar_user_name.end(), '.', '_'); + + BOOST_FOREACH(std::string& transcript_file_name, list_of_transcriptions) + { + if (std::string::npos != transcript_file_name.find(avatar_user_name)) + { + return true; + } + } + } + + return false; +} + //*TODO mark object's names in a special way so that they will be distinguishable form avatar name //which are more strict by its nature (only firstname and secondname) //Example, an object's name can be written like "Object " diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index 5fbb4ade96..b981d9ce04 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -57,6 +57,7 @@ public: static boost::signals2::connection setSaveHistorySignal(const save_history_signal_t::slot_type& cb); static void deleteTranscripts(); + static bool isTranscriptExist(const LLUUID& avatar_id); private: static std::string cleanFileName(std::string filename); diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 61e9468ce5..47d6b49a50 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -37,6 +37,7 @@ #include "llagentdata.h" // for gAgentID #include "llavataractions.h" #include "llcallingcard.h" // for LLAvatarTracker +#include "lllogchat.h" #include "llviewermenu.h" // for gMenuHolder namespace LLPanelPeopleMenus @@ -180,7 +181,11 @@ bool NearbyMenu::enableContextMenuItem(const LLSD& userdata) { return LLAvatarActions::canOfferTeleport(mUUIDs); } - else if (item == std::string("can_im") || item == std::string("can_callog") || item == std::string("can_invite") || + else if (item == std::string("can_callog")) + { + return LLLogChat::isTranscriptExist(mUUIDs.front()); + } + else if (item == std::string("can_im") || item == std::string("can_invite") || item == std::string("can_share") || item == std::string("can_pay")) { return true; -- cgit v1.2.3 From 6185c16a0af02c90625dec71119d12dec07bb056 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 22 Feb 2013 20:54:58 +0000 Subject: CHUI-772 FIX User sees no notification of conversation activity not visible in long scrolling conversation list Added LLFLoaterIMContainer::isConversationItemWidgetvisible() which is now used in LLConversationViewSession::startFlashing() to flash chat toolbar button if out of view --- indra/newview/llconversationview.cpp | 12 ++++++++++++ indra/newview/llfloaterimcontainer.cpp | 16 ++++++++++++++++ indra/newview/llfloaterimcontainer.h | 1 + 3 files changed, 29 insertions(+) diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 441de2e1a5..850668388f 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -39,6 +39,7 @@ #include "llfloaterreg.h" #include "llgroupiconctrl.h" #include "lluictrlfactory.h" +#include "lltoolbarview.h" // // Implementation of conversations list session widgets @@ -114,6 +115,17 @@ void LLConversationViewSession::startFlashing() { mFlashStarted = true; mFlashTimer->startFlashing(); + + // get session id + LLConversationItem* vmi = dynamic_cast(getViewModelItem()); + if (vmi) + { + // flash chat toolbar button if scrolled out of view (because flashing will not be visible) + if (!mContainer->isConversationItemWidgetVisible(vmi->getUUID())) + { + gToolBarView->flashCommand(LLCommandId("chat"), true); + } + } } } diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index c8088588da..0260f2b89e 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1853,6 +1853,22 @@ void LLFloaterIMContainer::flashConversationItemWidget(const LLUUID& session_id, } } +bool LLFloaterIMContainer::isConversationItemWidgetVisible(const LLUUID& session_id) +{ + // find the conversation line item using the session_id + LLConversationViewSession* widget = dynamic_cast(get_ptr_in_map(mConversationsWidgets, session_id)); + + if (widget) + { + // check whether the widget is in the visible portion of the scroll container + LLRect widget_rect; + widget->localRectToOtherView(widget->getLocalRect(), &widget_rect, mConversationsRoot); + return (mConversationsRoot->getVisibleRect().overlaps(widget_rect)); + } + + return false; +} + void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/) { // Always unminimize before trying to close. diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 569fa9faab..156f11f14e 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -185,6 +185,7 @@ public: void updateSpeakBtnState(); static bool isConversationLoggingAllowed(); void flashConversationItemWidget(const LLUUID& session_id, bool is_flashes); + bool isConversationItemWidgetVisible(const LLUUID& session_id); boost::signals2::connection mMicroChangedSignal; private: -- cgit v1.2.3 From 6194302a849431e84c046325d3cd19e92f62aa6f Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 22 Feb 2013 21:42:08 +0000 Subject: CHUI-772 FIX User sees no notification of conversation activity not visible in long scrolling conversation list Renamed LLFLoaterIMContainer::isConversationItemWidgetvisible() to isScrolledOutOfView() with opposite return value --- indra/newview/llconversationview.cpp | 11 +++-------- indra/newview/llfloaterimcontainer.cpp | 18 ++++++------------ indra/newview/llfloaterimcontainer.h | 2 +- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 850668388f..73b2c6f88c 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -116,15 +116,10 @@ void LLConversationViewSession::startFlashing() mFlashStarted = true; mFlashTimer->startFlashing(); - // get session id - LLConversationItem* vmi = dynamic_cast(getViewModelItem()); - if (vmi) + // flash chat toolbar button if scrolled out of sight (because flashing will not be visible) + if (mContainer->isScrolledOutOfSight(this)) { - // flash chat toolbar button if scrolled out of view (because flashing will not be visible) - if (!mContainer->isConversationItemWidgetVisible(vmi->getUUID())) - { - gToolBarView->flashCommand(LLCommandId("chat"), true); - } + gToolBarView->flashCommand(LLCommandId("chat"), true); } } } diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 0260f2b89e..2d12d4ec21 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1853,20 +1853,14 @@ void LLFloaterIMContainer::flashConversationItemWidget(const LLUUID& session_id, } } -bool LLFloaterIMContainer::isConversationItemWidgetVisible(const LLUUID& session_id) +bool LLFloaterIMContainer::isScrolledOutOfSight(LLConversationViewSession* conversation_item_widget) { - // find the conversation line item using the session_id - LLConversationViewSession* widget = dynamic_cast(get_ptr_in_map(mConversationsWidgets, session_id)); + llassert(conversation_item_widget != NULL); - if (widget) - { - // check whether the widget is in the visible portion of the scroll container - LLRect widget_rect; - widget->localRectToOtherView(widget->getLocalRect(), &widget_rect, mConversationsRoot); - return (mConversationsRoot->getVisibleRect().overlaps(widget_rect)); - } - - return false; + // check whether the widget is in the visible portion of the scroll container + LLRect widget_rect; + conversation_item_widget->localRectToOtherView(conversation_item_widget->getLocalRect(), &widget_rect, mConversationsRoot); + return !mConversationsRoot->getVisibleRect().overlaps(widget_rect); } void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/) diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 156f11f14e..5ba29b8cfb 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -185,7 +185,7 @@ public: void updateSpeakBtnState(); static bool isConversationLoggingAllowed(); void flashConversationItemWidget(const LLUUID& session_id, bool is_flashes); - bool isConversationItemWidgetVisible(const LLUUID& session_id); + bool isScrolledOutOfSight(LLConversationViewSession* conversation_item_widget); boost::signals2::connection mMicroChangedSignal; private: -- cgit v1.2.3 From c70a951abd0993c85aa96a930a54ff89c93cd03a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 25 Feb 2013 11:41:22 -0800 Subject: CHUI-778: Pushing a quick fix that only pertains to CHUI-778 so we can close out this issue. --- indra/newview/llfloaterpreference.cpp | 32 +++++++++++++++++++++++--------- indra/newview/llfloaterpreference.h | 1 + 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 3d8d0e15ec..688d453789 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -646,9 +646,6 @@ void LLFloaterPreference::cancel() LLFloaterPathfindingConsole* pPathfindingConsole = pathfindingConsoleHandle.get(); pPathfindingConsole->onRegionBoundaryCross(); } - - std::string dir_name(gSavedPerAccountSettings.getString("InstantMessageLogPath")); - updateLogLocation(dir_name); } void LLFloaterPreference::onOpen(const LLSD& key) @@ -798,6 +795,14 @@ void LLFloaterPreference::onBtnOK() apply(); closeFloater(false); + //Conversation transcript and log path changed so reload conversations based on new location + if(mPriorInstantMessageLogPath.length()) + { + std::string dir_name(gSavedPerAccountSettings.getString("InstantMessageLogPath")); + updateLogLocation(dir_name); + mPriorInstantMessageLogPath.clear(); + } + LLUIColorTable::instance().saveUserSettings(); gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); } @@ -1436,19 +1441,28 @@ void LLFloaterPreference::setAllIgnored() void LLFloaterPreference::onClickLogPath() { - std::string proposed_name(gSavedPerAccountSettings.getString("InstantMessageLogPath")); - + std::string proposed_name(gSavedPerAccountSettings.getString("InstantMessageLogPath")); + mPriorInstantMessageLogPath.clear(); + LLDirPicker& picker = LLDirPicker::instance(); + //Launches a directory picker and waits for feedback if (!picker.getDir(&proposed_name ) ) { return; //Canceled! } + //Gets the path from the directory picker std::string dir_name = picker.getDirName(); - gSavedPerAccountSettings.setString("InstantMessageLogPath", dir_name); - - // enable/disable 'Delete transcripts button - updateDeleteTranscriptsButton(); + + //Path changed + if(proposed_name != dir_name) + { + gSavedPerAccountSettings.setString("InstantMessageLogPath", dir_name); + mPriorInstantMessageLogPath = proposed_name; + + // enable/disable 'Delete transcripts button + updateDeleteTranscriptsButton(); + } } void LLFloaterPreference::updateLogLocation(const std::string& dir_name) diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index dbd87f74a1..31c1e2d9e5 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -187,6 +187,7 @@ private: bool mOriginalIMViaEmail; bool mLanguageChanged; bool mAvatarDataInitialized; + std::string mPriorInstantMessageLogPath; bool mOriginalHideOnlineStatus; std::string mDirectoryVisibility; -- cgit v1.2.3