summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-02-25 12:57:39 -0800
committerGilbert Gonzales <gilbert@lindenlab.com>2013-02-25 12:57:39 -0800
commite5d6b29260159f402391be393d046721dfeacbc9 (patch)
tree2d66514de5eb2d08b4088c406b8a92fad383d112 /indra/newview
parentc3377625fd31f0381143f3f52f33325702b6c74d (diff)
parent3c121e83446a755220f83f21637193d011c5b5a7 (diff)
merge
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llavataractions.cpp14
-rwxr-xr-xindra/newview/llconversationview.cpp7
-rw-r--r--indra/newview/llfloaterconversationpreview.cpp17
-rw-r--r--indra/newview/llfloaterconversationpreview.h5
-rw-r--r--indra/newview/llfloaterimcontainer.cpp10
-rw-r--r--indra/newview/llfloaterimcontainer.h1
-rwxr-xr-xindra/newview/llfloaterpreference.cpp14
-rw-r--r--indra/newview/lllogchat.cpp26
-rw-r--r--indra/newview/lllogchat.h1
-rw-r--r--indra/newview/llpanelpeoplemenus.cpp7
10 files changed, 90 insertions, 12 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/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 441de2e1a5..73b2c6f88c 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,12 @@ void LLConversationViewSession::startFlashing()
{
mFlashStarted = true;
mFlashTimer->startFlashing();
+
+ // flash chat toolbar button if scrolled out of sight (because flashing will not be visible)
+ if (mContainer->isScrolledOutOfSight(this))
+ {
+ gToolBarView->flashCommand(LLCommandId("chat"), true);
+ }
}
}
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<LLSD> mMessages;
+ std::string mAccountName;
+ std::string mCompleteName;
};
#endif /* LLFLOATERCONVERSATIONPREVIEW_H_ */
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 73fcfa244e..c5edd11c12 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -1877,6 +1877,16 @@ void LLFloaterIMContainer::flashConversationItemWidget(const LLUUID& session_id,
}
}
+bool LLFloaterIMContainer::isScrolledOutOfSight(LLConversationViewSession* conversation_item_widget)
+{
+ llassert(conversation_item_widget != NULL);
+
+ // 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*/)
{
// Always unminimize before trying to close.
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index 33d63a391c..419239f90b 100644
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -186,6 +186,7 @@ public:
void updateSpeakBtnState();
static bool isConversationLoggingAllowed();
void flashConversationItemWidget(const LLUUID& session_id, bool is_flashes);
+ bool isScrolledOutOfSight(LLConversationViewSession* conversation_item_widget);
boost::signals2::connection mMicroChangedSignal;
S32 getConversationListItemSize() { return mConversationsWidgets.size(); }
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index b9239b544f..988190f96a 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -814,7 +814,7 @@ void LLFloaterPreference::onBtnOK()
if(mGotPersonalInfo)
{
gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE);
- }
+ }
}
else
{
@@ -1451,7 +1451,7 @@ 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();
@@ -1467,12 +1467,12 @@ void LLFloaterPreference::onClickLogPath()
//Path changed
if(proposed_name != dir_name)
{
- gSavedPerAccountSettings.setString("InstantMessageLogPath", dir_name);
+ gSavedPerAccountSettings.setString("InstantMessageLogPath", dir_name);
mPriorInstantMessageLogPath = proposed_name;
-
- // enable/disable 'Delete transcripts button
- updateDeleteTranscriptsButton();
- }
+
+ // enable/disable 'Delete transcripts button
+ updateDeleteTranscriptsButton();
+}
}
bool LLFloaterPreference::moveTranscriptsAndLog()
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index 95b0e6b9d6..d9d28c6d70 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"
@@ -609,6 +610,31 @@ void LLLogChat::deleteTranscripts()
LLFloaterIMSessionTab::processChatHistoryStyleUpdate(true);
}
+// static
+bool LLLogChat::isTranscriptExist(const LLUUID& avatar_id)
+{
+ std::vector<std::string> 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 <actual_object's_name>"
diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h
index 244f1c8790..784786a565 100644
--- a/indra/newview/lllogchat.h
+++ b/indra/newview/lllogchat.h
@@ -65,6 +65,7 @@ public:
std::vector<std::string>& listOfFilesToMove);
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;