Skip to content
Snippets Groups Projects
Commit df450ff1 authored by Vadim ProductEngine's avatar Vadim ProductEngine
Browse files

STORM-1021 ADDITIONAL_FIX Replaced usual object inspector with the remote one...

STORM-1021 ADDITIONAL_FIX Replaced usual object inspector with the remote one in nearby chat toasts.
parent e4a4d751
No related branches found
No related tags found
No related merge requests found
...@@ -793,21 +793,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL ...@@ -793,21 +793,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
if ( chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mFromID.notNull()) if ( chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mFromID.notNull())
{ {
// for object IMs, create a secondlife:///app/objectim SLapp // for object IMs, create a secondlife:///app/objectim SLapp
std::string url = LLSLURL("objectim", chat.mFromID, "").getSLURLString(); std::string url = LLViewerChat::getSenderSLURL(chat, args);
url += "?name=" + chat.mFromName;
url += "&owner=" + chat.mOwnerID.asString();
std::string slurl = args["slurl"].asString();
if (slurl.empty())
{
LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosAgent(chat.mPosAgent);
if(region)
{
LLSLURL region_slurl(region->getName(), chat.mPosAgent);
slurl = region_slurl.getLocationString();
}
}
url += "&slurl=" + LLURI::escape(slurl);
// set the link for the object name to be the objectim SLapp // set the link for the object name to be the objectim SLapp
// (don't let object names with hyperlinks override our objectim Url) // (don't let object names with hyperlinks override our objectim Url)
......
...@@ -213,17 +213,6 @@ void LLNearbyChatToastPanel::init(LLSD& notification) ...@@ -213,17 +213,6 @@ void LLNearbyChatToastPanel::init(LLSD& notification)
{ {
LLStyle::Params style_params_name; LLStyle::Params style_params_name;
std::string href;
if (mSourceType == CHAT_SOURCE_AGENT)
{
href = LLSLURL("agent", mFromID, "about").getSLURLString();
}
else
{
href = LLSLURL("object", mFromID, "inspect").getSLURLString();
}
LLColor4 user_name_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); LLColor4 user_name_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
style_params_name.color(user_name_color); style_params_name.color(user_name_color);
...@@ -232,7 +221,7 @@ void LLNearbyChatToastPanel::init(LLSD& notification) ...@@ -232,7 +221,7 @@ void LLNearbyChatToastPanel::init(LLSD& notification)
style_params_name.font.name(font_name); style_params_name.font.name(font_name);
style_params_name.font.size(font_style_size); style_params_name.font.size(font_style_size);
style_params_name.link_href = href; style_params_name.link_href = notification["sender_slurl"].asString();
style_params_name.is_link = true; style_params_name.is_link = true;
msg_text->appendText(str_sender, FALSE, style_params_name); msg_text->appendText(str_sender, FALSE, style_params_name);
......
...@@ -558,6 +558,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args) ...@@ -558,6 +558,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
} }
*/ */
// Add a nearby chat toast.
LLUUID id; LLUUID id;
id.generate(); id.generate();
...@@ -583,6 +584,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args) ...@@ -583,6 +584,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
notification["text_color"] = r_color_name; notification["text_color"] = r_color_name;
notification["color_alpha"] = r_color_alpha; notification["color_alpha"] = r_color_alpha;
notification["font_size"] = (S32)LLViewerChat::getChatFontSize() ; notification["font_size"] = (S32)LLViewerChat::getChatFontSize() ;
// Pass sender info so that it can be rendered properly (STORM-1021).
notification["sender_slurl"] = LLViewerChat::getSenderSLURL(chat_msg, args);
channel->addNotification(notification); channel->addNotification(notification);
} }
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#include "llagent.h" // gAgent #include "llagent.h" // gAgent
#include "lluicolortable.h" #include "lluicolortable.h"
#include "llviewercontrol.h" // gSavedSettings #include "llviewercontrol.h" // gSavedSettings
#include "llviewerregion.h"
#include "llworld.h"
#include "llinstantmessage.h" //SYSTEM_FROM #include "llinstantmessage.h" //SYSTEM_FROM
// LLViewerChat // LLViewerChat
...@@ -214,3 +216,43 @@ void LLViewerChat::formatChatMsg(const LLChat& chat, std::string& formated_msg) ...@@ -214,3 +216,43 @@ void LLViewerChat::formatChatMsg(const LLChat& chat, std::string& formated_msg)
} }
//static
std::string LLViewerChat::getSenderSLURL(const LLChat& chat, const LLSD& args)
{
switch (chat.mSourceType)
{
case CHAT_SOURCE_AGENT:
return LLSLURL("agent", chat.mFromID, "about").getSLURLString();
case CHAT_SOURCE_OBJECT:
return getObjectImSLURL(chat, args);
default:
llwarns << "Getting SLURL for an unsupported sender type: " << chat.mSourceType << llendl;
}
return LLStringUtil::null;
}
//static
std::string LLViewerChat::getObjectImSLURL(const LLChat& chat, const LLSD& args)
{
std::string url = LLSLURL("objectim", chat.mFromID, "").getSLURLString();
url += "?name=" + chat.mFromName;
url += "&owner=" + chat.mOwnerID.asString();
std::string slurl = args["slurl"].asString();
if (slurl.empty())
{
LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosAgent(chat.mPosAgent);
if(region)
{
LLSLURL region_slurl(region->getName(), chat.mPosAgent);
slurl = region_slurl.getLocationString();
}
}
url += "&slurl=" + LLURI::escape(slurl);
return url;
}
...@@ -40,6 +40,10 @@ class LLViewerChat ...@@ -40,6 +40,10 @@ class LLViewerChat
static LLFontGL* getChatFont(); static LLFontGL* getChatFont();
static S32 getChatFontSize(); static S32 getChatFontSize();
static void formatChatMsg(const LLChat& chat, std::string& formated_msg); static void formatChatMsg(const LLChat& chat, std::string& formated_msg);
static std::string getSenderSLURL(const LLChat& chat, const LLSD& args);
private:
static std::string getObjectImSLURL(const LLChat& chat, const LLSD& args);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment