summaryrefslogtreecommitdiff
path: root/indra/newview/llnearbychat.cpp
diff options
context:
space:
mode:
authorIgor Borovkov <iborovkov@productengine.com>2010-02-24 17:18:05 +0200
committerIgor Borovkov <iborovkov@productengine.com>2010-02-24 17:18:05 +0200
commit6575b685e91d334198789c88dec2efab7e5a1ac9 (patch)
treee2e2532ebb95682dca1c061421d24360941da2a3 /indra/newview/llnearbychat.cpp
parentdf29381dc0027fd1e33cc68b2c0b22e85ad622ad (diff)
fixed EXT-5526 Objects are shown as persons in the chat history from previous sessions
- new chat source type CHAT_SOURCE_UNKNOWN for avatar names not in cache and object names consisting of two words (avatar names like) - new icon (unknown_icon.png) for message headers () of nearby chat messagses coming from CHAT_SOURCE_UNKNOWN - context menu no longer displayed for object names from chat history (no UUIDs) - double click on message headers in nearby chat no longer opens Inspector (no UUIDs) - object names (loaded from chat history) in nearby chat are no longer SLURLed (no UUIDs for them) --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llnearbychat.cpp')
-rw-r--r--indra/newview/llnearbychat.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index 16384ef6e0..c8d5d782b7 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -278,6 +278,13 @@ void LLNearbyChat::processChatHistoryStyleUpdate(const LLSD& newvalue)
nearby_chat->updateChatHistoryStyle();
}
+bool isTwoWordsName(const std::string& name)
+{
+ //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;
+}
+
void LLNearbyChat::loadHistory()
{
LLSD do_not_log;
@@ -304,6 +311,18 @@ void LLNearbyChat::loadHistory()
chat.mText = msg[IM_TEXT].asString();
chat.mTimeStr = msg[IM_TIME].asString();
chat.mChatStyle = CHAT_STYLE_HISTORY;
+
+ chat.mSourceType = CHAT_SOURCE_AGENT;
+ if (from_id.isNull() && SYSTEM_FROM == from)
+ {
+ chat.mSourceType = CHAT_SOURCE_SYSTEM;
+
+ }
+ else if (from_id.isNull())
+ {
+ chat.mSourceType = isTwoWordsName(from) ? CHAT_SOURCE_UNKNOWN : CHAT_SOURCE_OBJECT;
+ }
+
addMessage(chat, true, do_not_log);
it++;