diff --git a/indra/llcommon/llchat.h b/indra/llcommon/llchat.h
index 5af79910068c584d7d6ded09864d165c1a17c0b9..46456882baa18f5aa31725bf52db9f3afff87148 100644
--- a/indra/llcommon/llchat.h
+++ b/indra/llcommon/llchat.h
@@ -87,7 +87,8 @@ public:
 		mTimeStr(),
 		mPosAgent(),
 		mURL(),
-		mChatStyle(CHAT_STYLE_NORMAL)
+		mChatStyle(CHAT_STYLE_NORMAL),
+		mSessionID()
 	{ }
 	
 	std::string		mText;		// UTF-8 line of text
@@ -102,6 +103,7 @@ public:
 	LLVector3		mPosAgent;
 	std::string		mURL;
 	EChatStyle		mChatStyle;
+	LLUUID			mSessionID;
 };
 
 #endif
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index d6a7edee5b4742c10b88fb97ba5b563ceaf30d0d..2cdbd18996cbfe6a1443532b08dfc33be2a2b4b6 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -34,6 +34,7 @@
 
 #include "llinstantmessage.h"
 
+#include "llimview.h"
 #include "llchathistory.h"
 #include "llpanel.h"
 #include "lluictrlfactory.h"
@@ -183,6 +184,7 @@ public:
 	void setup(const LLChat& chat,const LLStyle::Params& style_params) 
 	{
 		mAvatarID = chat.mFromID;
+		mSessionID = chat.mSessionID;
 		mSourceType = chat.mSourceType;
 		gCacheName->get(mAvatarID, FALSE, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3, _4));
 		if(chat.mFromID.isNull())
@@ -305,6 +307,11 @@ protected:
 				menu->setItemEnabled("Remove Friend", false);
 			}
 
+			if (mSessionID == LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, mAvatarID))
+			{
+				menu->setItemVisible("Send IM", false);
+			}
+
 			menu->buildDrawLabels();
 			menu->updateParent(LLMenuGL::sMenuContainer);
 			LLMenuGL::showPopup(this, menu, x, y);
@@ -344,6 +351,7 @@ protected:
 	std::string			mFirstName;
 	std::string			mLastName;
 	std::string			mFrom;
+	LLUUID				mSessionID;
 
 	S32					mMinUserNameWidth;
 };
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 73597e7de3393b066d4c9224f1fb3f97f10d2aa7..c0f22fcea22f98ac1b4e2d83f4e3b5c2a7a1903f 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -599,6 +599,7 @@ void LLIMFloater::updateMessages()
 
 			LLChat chat;
 			chat.mFromID = from_id;
+			chat.mSessionID = mSessionID;
 			chat.mFromName = from;
 			chat.mText = message;
 			chat.mTimeStr = time;