diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
index 0ee3e784095094fef1f601fb2824973bd14431e7..46902006a61ce00318009a42a3c11d4fe43e35a9 100644
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -195,14 +195,6 @@ LLAvatarIconCtrl::LLAvatarIconCtrl(const LLAvatarIconCtrl::Params& p)
 	{
 		LLIconCtrl::setValue("default_profile_picture.j2c");
 	}
-
-	LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
-
-	registrar.add("AvatarIcon.Action", boost::bind(&LLAvatarIconCtrl::onAvatarIconContextMenuItemClicked, this, _2));
-
-	LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
-
-	mPopupMenuHandle = menu->getHandle();
 }
 
 LLAvatarIconCtrl::~LLAvatarIconCtrl()
@@ -212,8 +204,6 @@ LLAvatarIconCtrl::~LLAvatarIconCtrl()
 		LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarId, this);
 		// Name callbacks will be automatically disconnected since LLUICtrl is trackable
 	}
-
-	LLView::deleteViewByHandle(mPopupMenuHandle);
 }
 
 //virtual
@@ -295,32 +285,6 @@ void LLAvatarIconCtrl::processProperties(void* data, EAvatarProcessorType type)
 	}
 }
 
-BOOL LLAvatarIconCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
-{
-	LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
-
-	if(menu)
-	{
-		bool is_friend = LLAvatarTracker::instance().getBuddyInfo(mAvatarId) != NULL;
-		
-		menu->setItemEnabled("Add Friend", !is_friend);
-		menu->setItemEnabled("Remove Friend", is_friend);
-
-		if(gAgentID == mAvatarId)
-		{
-			menu->setItemEnabled("Add Friend", false);
-			menu->setItemEnabled("Send IM", false);
-			menu->setItemEnabled("Remove Friend", false);
-		}
-
-		menu->buildDrawLabels();
-		menu->updateParent(LLMenuGL::sMenuContainer);
-		LLMenuGL::showPopup(this, menu, x, y);
-	}
-
-	return TRUE;
-}
-
 void LLAvatarIconCtrl::nameUpdatedCallback(
 	const LLUUID& id,
 	const std::string& first,
@@ -338,40 +302,3 @@ void LLAvatarIconCtrl::nameUpdatedCallback(
 		}
 	}
 }
-
-void LLAvatarIconCtrl::onAvatarIconContextMenuItemClicked(const LLSD& userdata)
-{
-	std::string level = userdata.asString();
-	LLUUID id = getAvatarId();
-
-	if (level == "profile")
-	{
-		LLAvatarActions::showProfile(id);
-	}
-	else if (level == "im")
-	{
-		std::string name;
-		name.assign(getFirstName());
-		name.append(" ");
-		name.append(getLastName());
-
-		LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id);
-		if (session_id != LLUUID::null)
-		{
-			LLIMFloater::show(session_id);
-		}
-	}
-	else if (level == "add")
-	{
-		std::string name;
-		name.assign(getFirstName());
-		name.append(" ");
-		name.append(getLastName());
-
-		LLAvatarActions::requestFriendshipDialog(id, name);
-	}
-	else if (level == "remove")
-	{
-		LLAvatarActions::removeFriendDialog(id);
-	}
-}
diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h
index 65b5c86ed54302a26fc203f113642d46fcd6cf33..5eb830df4bc0326be0ca498c5dd4a981b7282986 100644
--- a/indra/newview/llavatariconctrl.h
+++ b/indra/newview/llavatariconctrl.h
@@ -81,8 +81,6 @@ class LLAvatarIconCtrl
 	LLAvatarIconCtrl(const Params&);
 	friend class LLUICtrlFactory;
 
-	void onAvatarIconContextMenuItemClicked(const LLSD& userdata);
-
 public:
 	virtual ~LLAvatarIconCtrl();
 
@@ -91,8 +89,6 @@ class LLAvatarIconCtrl
 	// LLAvatarPropertiesProcessor observer trigger
 	virtual void processProperties(void* data, EAvatarProcessorType type);
 
-	BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
-
 	void nameUpdatedCallback(
 		const LLUUID& id,
 		const std::string& first,
@@ -109,7 +105,6 @@ class LLAvatarIconCtrl
 	LLUUID				mAvatarId;
 	std::string			mFirstName;
 	std::string			mLastName;
-	LLHandle<LLView>	mPopupMenuHandle;
 	bool				mDrawTooltip;
 
 
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index f20ffa75591870692f5f594d278e5a2dbd6a6010..fd643cdcc9dcb1464bd66c4e6fcb0ae3511823ed 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -508,6 +508,8 @@ BOOL LLPanelPeople::postBuild()
 
 	mNearbyList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
 	mRecentList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
+	mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
+	mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
 
 	setSortOrder(mRecentList,		(ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"),	false);
 	setSortOrder(mAllFriendList,	(ESortOrder)gSavedSettings.getU32("FriendsSortOrder"),		false);