diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index d4ec377e03ddb3e606966734d30c489859ffecb3..c0c9ea145164b27d65ee4a0d0e201043e78d80d9 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -793,21 +793,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
 			if ( chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mFromID.notNull())
 			{
 				// for object IMs, create a secondlife:///app/objectim SLapp
-				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);
+				std::string url = LLViewerChat::getSenderSLURL(chat, args);
 
 				// set the link for the object name to be the objectim SLapp
 				// (don't let object names with hyperlinks override our objectim Url)
diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp
index 899e0431e7c29634dd37c8e7ddd7c759151b8eca..8584885bc974e842e63d916ead326abf9e76db4d 100644
--- a/indra/newview/llchatitemscontainerctrl.cpp
+++ b/indra/newview/llchatitemscontainerctrl.cpp
@@ -213,17 +213,6 @@ void LLNearbyChatToastPanel::init(LLSD& notification)
 		{
 			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");
 			style_params_name.color(user_name_color);
 
@@ -232,7 +221,7 @@ void LLNearbyChatToastPanel::init(LLSD& notification)
 			style_params_name.font.name(font_name);
 			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;
 
 			msg_text->appendText(str_sender, FALSE, style_params_name);
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index de5439e4e03e5a88002a454a74e790cd503548db..0d9daeb44ead9302fbb14c5b818ec880ab4ee8ae 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -558,6 +558,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
 	}
 	*/
 
+	// Add a nearby chat toast.
 	LLUUID id;
 	id.generate();
 
@@ -583,6 +584,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
 		notification["text_color"] = r_color_name;
 		notification["color_alpha"] = r_color_alpha;
 		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);	
 	}
 
diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp
index 0af850a46b015b2de2e60d9c2cb4d7328e0a101a..286b16bab2ede0749a22b2ffbc91f679fd0c5856 100644
--- a/indra/newview/llviewerchat.cpp
+++ b/indra/newview/llviewerchat.cpp
@@ -31,6 +31,8 @@
 #include "llagent.h" 	// gAgent		
 #include "lluicolortable.h"
 #include "llviewercontrol.h" // gSavedSettings
+#include "llviewerregion.h"
+#include "llworld.h"
 #include "llinstantmessage.h" //SYSTEM_FROM
 
 // LLViewerChat
@@ -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;
+}
diff --git a/indra/newview/llviewerchat.h b/indra/newview/llviewerchat.h
index a9f9a98960f06b60cc7c07d7ae390bbca65b83d4..0f15d29f04ec3a0a8f884d328d4b9cd78b3193dc 100644
--- a/indra/newview/llviewerchat.h
+++ b/indra/newview/llviewerchat.h
@@ -40,6 +40,10 @@ class LLViewerChat
 	static LLFontGL* getChatFont();
 	static S32 getChatFontSize();
 	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);
 
 };