summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llavatariconctrl.cpp7
-rw-r--r--indra/newview/llfloaterconversationpreview.cpp27
-rw-r--r--indra/newview/llnearbychat.cpp40
-rw-r--r--indra/newview/llnearbychat.h2
-rw-r--r--indra/newview/skins/default/xui/en/floater_conversation_preview.xml2
5 files changed, 50 insertions, 28 deletions
diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
index b539ac38ed..62c6c6763b 100755
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -245,9 +245,10 @@ void LLAvatarIconCtrl::setValue(const LLSD& value)
LLIconCtrl::setValue(value);
}
- LLAvatarNameCache::get(mAvatarId,
- boost::bind(&LLAvatarIconCtrl::onAvatarNameCache,
- this, _1, _2));
+ if (mAvatarId != LLUUID::null)
+ {
+ LLAvatarNameCache::get(mAvatarId, boost::bind(&LLAvatarIconCtrl::onAvatarNameCache, this, _1, _2));
+ }
}
bool LLAvatarIconCtrl::updateFromCache()
diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp
index 88efc39764..a3825eafc8 100644
--- a/indra/newview/llfloaterconversationpreview.cpp
+++ b/indra/newview/llfloaterconversationpreview.cpp
@@ -29,6 +29,7 @@
#include "llfloaterconversationpreview.h"
#include "llimview.h"
#include "lllineeditor.h"
+#include "llnearbychat.h"
#include "llspinctrl.h"
#include "lltrans.h"
@@ -43,7 +44,6 @@ LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_i
BOOL LLFloaterConversationPreview::postBuild()
{
mChatHistory = getChild<LLChatHistory>("chat_history");
- getChild<LLUICtrl>("more_history")->setCommitCallback(boost::bind(&LLFloaterConversationPreview::onMoreHistoryBtnClick, this));
const LLConversation* conv = LLConversationLog::instance().getConversation(mSessionID);
std::string name;
@@ -119,20 +119,39 @@ void LLFloaterConversationPreview::showHistory()
{
LLSD msg = *iter;
+ LLUUID from_id = LLUUID::null;
std::string time = msg["time"].asString();
- LLUUID from_id = msg["from_id"].asUUID();
std::string from = msg["from"].asString();
std::string message = msg["message"].asString();
- bool is_history = msg["is_history"].asBoolean();
+
+ if (msg["from_id"].isDefined())
+ {
+ from_id = msg["from_id"].asUUID();
+ }
+ else
+ {
+ std::string legacy_name = gCacheName->buildLegacyName(from);
+ gCacheName->getUUID(legacy_name, from_id);
+ }
LLChat chat;
chat.mFromID = from_id;
chat.mSessionID = mSessionID;
chat.mFromName = from;
chat.mTimeStr = time;
- chat.mChatStyle = is_history ? CHAT_STYLE_HISTORY : chat.mChatStyle;
+ chat.mChatStyle = CHAT_STYLE_HISTORY;
chat.mText = message;
+ if (from_id.isNull() && SYSTEM_FROM == from)
+ {
+ chat.mSourceType = CHAT_SOURCE_SYSTEM;
+
+ }
+ else if (from_id.isNull())
+ {
+ chat.mSourceType = LLNearbyChat::isWordsName(from) ? CHAT_SOURCE_UNKNOWN : CHAT_SOURCE_OBJECT;
+ }
+
mChatHistory->appendMessage(chat);
}
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index a803b35aa8..76626bd5a6 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -69,26 +69,6 @@
S32 LLNearbyChat::sLastSpecialChatChannel = 0;
-// --- function in the global namespace :( ---
-bool isWordsName(const std::string& name)
-{
- // checking to see if it's display name plus username in parentheses
- S32 open_paren = name.find(" (", 0);
- S32 close_paren = name.find(')', 0);
-
- if (open_paren != std::string::npos &&
- close_paren == name.length()-1)
- {
- return true;
- }
- else
- {
- //checking for a single space
- S32 pos = name.find(' ', 0);
- return std::string::npos != pos && name.rfind(' ', name.length()) == pos && 0 != pos && name.length()-1 != pos;
- }
-}
-
const S32 EXPANDED_HEIGHT = 266;
const S32 COLLAPSED_HEIGHT = 60;
const S32 EXPANDED_MIN_HEIGHT = 150;
@@ -717,6 +697,26 @@ void LLNearbyChat::sendChatFromViewer(const LLWString &wtext, EChatType type, BO
send_chat_from_viewer(utf8_out_text, type, channel);
}
+// static
+bool LLNearbyChat::isWordsName(const std::string& name)
+{
+ // checking to see if it's display name plus username in parentheses
+ S32 open_paren = name.find(" (", 0);
+ S32 close_paren = name.find(')', 0);
+
+ if (open_paren != std::string::npos &&
+ close_paren == name.length()-1)
+ {
+ return true;
+ }
+ else
+ {
+ //checking for a single space
+ S32 pos = name.find(' ', 0);
+ return std::string::npos != pos && name.rfind(' ', name.length()) == pos && 0 != pos && name.length()-1 != pos;
+ }
+}
+
// static
void LLNearbyChat::startChat(const char* line)
{
diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h
index 2cbafbfa62..648098113a 100644
--- a/indra/newview/llnearbychat.h
+++ b/indra/newview/llnearbychat.h
@@ -79,6 +79,8 @@ public:
static void sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate);
static void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate);
+ static bool isWordsName(const std::string& name);
+
void showHistory();
protected:
diff --git a/indra/newview/skins/default/xui/en/floater_conversation_preview.xml b/indra/newview/skins/default/xui/en/floater_conversation_preview.xml
index 0e5af67f68..6f1ddaaf4f 100644
--- a/indra/newview/skins/default/xui/en/floater_conversation_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_conversation_preview.xml
@@ -52,7 +52,7 @@
width="50"/>
<text
follows="bottom|right"
- font="SandSerif"
+ font="SansSerif"
height="22"
layout="topleft"
name="page_num_label"