diff options
author | McCabe Maxsted | 2009-09-11 00:33:33 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-09-11 00:33:33 -0700 |
commit | efa0d701845542e9ef555260fe6d2ad0beeb0760 (patch) | |
tree | 4527fe04a062d3353e4d1a77c547d1c2b1d475e9 /linden/indra/newview/llfloaterchat.cpp | |
parent | Fixed missing 'm' for draw distance slider (diff) | |
download | meta-impy-efa0d701845542e9ef555260fe6d2ad0beeb0760.zip meta-impy-efa0d701845542e9ef555260fe6d2ad0beeb0760.tar.gz meta-impy-efa0d701845542e9ef555260fe6d2ad0beeb0760.tar.bz2 meta-impy-efa0d701845542e9ef555260fe6d2ad0beeb0760.tar.xz |
Backported clickable object names from 1.23
Diffstat (limited to 'linden/indra/newview/llfloaterchat.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterchat.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index f624ec3..d0713bc 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp | |||
@@ -189,7 +189,7 @@ void LLFloaterChat::updateConsoleVisibility() | |||
189 | || (getHost() && getHost()->isMinimized() )); // are we hosted in a minimized floater? | 189 | || (getHost() && getHost()->isMinimized() )); // are we hosted in a minimized floater? |
190 | } | 190 | } |
191 | 191 | ||
192 | void add_timestamped_line(LLViewerTextEditor* edit, const LLChat &chat, const LLColor4& color) | 192 | void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& color) |
193 | { | 193 | { |
194 | std::string line = chat.mText; | 194 | std::string line = chat.mText; |
195 | bool prepend_newline = true; | 195 | bool prepend_newline = true; |
@@ -199,16 +199,22 @@ void add_timestamped_line(LLViewerTextEditor* edit, const LLChat &chat, const LL | |||
199 | prepend_newline = false; | 199 | prepend_newline = false; |
200 | } | 200 | } |
201 | 201 | ||
202 | // If the msg is not from an agent (not yourself though), | 202 | // If the msg is from an agent (not yourself though), |
203 | // extract out the sender name and replace it with the hotlinked name. | 203 | // extract out the sender name and replace it with the hotlinked name. |
204 | if (chat.mSourceType == CHAT_SOURCE_AGENT && | 204 | if (chat.mSourceType == CHAT_SOURCE_AGENT && |
205 | chat.mFromID != LLUUID::null && | 205 | chat.mFromID != LLUUID::null) |
206 | (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) | 206 | { |
207 | chat.mURL = llformat("secondlife:///app/agent/%s/about",chat.mFromID.asString().c_str()); | ||
208 | } | ||
209 | |||
210 | // If the chat line has an associated url, link it up to the name. | ||
211 | if (!chat.mURL.empty() | ||
212 | && (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) | ||
207 | { | 213 | { |
208 | std::string start_line = line.substr(0, chat.mFromName.length() + 1); | 214 | std::string start_line = line.substr(0, chat.mFromName.length() + 1); |
209 | line = line.substr(chat.mFromName.length() + 1); | 215 | line = line.substr(chat.mFromName.length() + 1); |
210 | const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID); | 216 | const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID,chat.mURL); |
211 | edit->appendStyledText(start_line, false, prepend_newline, &sourceStyle); | 217 | edit->appendStyledText(start_line, false, prepend_newline, sourceStyle); |
212 | prepend_newline = false; | 218 | prepend_newline = false; |
213 | } | 219 | } |
214 | edit->appendColoredText(line, false, prepend_newline, color); | 220 | edit->appendColoredText(line, false, prepend_newline, color); |