summaryrefslogtreecommitdiff
path: root/indra/newview/llchathistory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r--indra/newview/llchathistory.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index aaca568320..a66196a2cb 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -43,6 +43,7 @@
#include "llagentdata.h"
#include "llavataractions.h"
#include "lltrans.h"
+#include "llmutelist.h"
static LLDefaultChildRegistry::Register<LLChatHistory> r("chat_history");
static const std::string MESSAGE_USERNAME_DATE_SEPARATOR(" ----- ");
@@ -77,6 +78,19 @@ public:
return LLPanel::handleMouseUp(x,y,mask);
}
+ void onObjectIconContextMenuItemClicked(const LLSD& userdata)
+ {
+ std::string level = userdata.asString();
+
+ if (level == "profile")
+ {
+ }
+ else if (level == "block")
+ {
+ LLMuteList::getInstance()->add(LLMute(getAvatarId(), mFrom, LLMute::OBJECT));
+ }
+ }
+
void onAvatarIconContextMenuItemClicked(const LLSD& userdata)
{
std::string level = userdata.asString();
@@ -109,11 +123,16 @@ public:
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
registrar.add("AvatarIcon.Action", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2));
+ registrar.add("ObjectIcon.Action", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2));
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
-
mPopupMenuHandleAvatar = menu->getHandle();
+ menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
+ mPopupMenuHandleObject = menu->getHandle();
+
+
+
return LLPanel::postBuild();
}
@@ -163,7 +182,10 @@ public:
LLTextBox* userName = getChild<LLTextBox>("user_name");
if(!chat.mFromName.empty())
+ {
userName->setValue(chat.mFromName);
+ mFrom = chat.mFromName;
+ }
else
{
std::string SL = LLTrans::getString("SECOND_LIFE");
@@ -206,8 +228,12 @@ protected:
void showSystemContextMenu(S32 x,S32 y)
{
}
+
void showObjectContextMenu(S32 x,S32 y)
{
+ LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandleObject.get();
+ if(menu)
+ LLMenuGL::showPopup(this, menu, x, y);
}
void showAvatarContextMenu(S32 x,S32 y)
@@ -238,11 +264,13 @@ protected:
protected:
LLHandle<LLView> mPopupMenuHandleAvatar;
+ LLHandle<LLView> mPopupMenuHandleObject;
LLUUID mAvatarID;
EChatSourceType mSourceType;
std::string mFirstName;
std::string mLastName;
+ std::string mFrom;
};