summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterreporter.cpp43
-rw-r--r--indra/newview/llfloaterreporter.h4
-rw-r--r--indra/newview/llinspectavatar.cpp2
3 files changed, 36 insertions, 13 deletions
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp
index e0f2fca580..2efae0c8db 100644
--- a/indra/newview/llfloaterreporter.cpp
+++ b/indra/newview/llfloaterreporter.cpp
@@ -277,13 +277,8 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
{
object_owner.append("Unknown");
}
- childSetText("object_name", object_owner);
- std::string owner_link =
- LLSLURL::buildCommand("agent", mObjectID, "inspect");
- childSetText("owner_name", owner_link);
- childSetText("abuser_name_edit", object_owner);
- mAbuserID = object_id;
- mOwnerName = object_owner;
+
+ setFromAvatar(object_id, object_owner);
}
else
{
@@ -305,7 +300,6 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
}
}
-
void LLFloaterReporter::onClickSelectAbuser()
{
gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, this, _1, _2), FALSE, TRUE ));
@@ -323,6 +317,17 @@ void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names,
}
+void LLFloaterReporter::setFromAvatar(const LLUUID& avatar_id, const std::string& avatar_name)
+{
+ mAbuserID = mObjectID = avatar_id;
+ mOwnerName = avatar_name;
+
+ std::string avatar_link = LLSLURL::buildCommand("agent", mObjectID, "inspect");
+ childSetText("owner_name", avatar_link);
+ childSetText("object_name", avatar_name); // name
+ childSetText("abuser_name_edit", avatar_name);
+}
+
// static
void LLFloaterReporter::onClickSend(void *userdata)
{
@@ -458,9 +463,8 @@ void LLFloaterReporter::showFromMenu(EReportType report_type)
}
}
-
// static
-void LLFloaterReporter::showFromObject(const LLUUID& object_id)
+void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_name)
{
LLFloaterReporter* f = LLFloaterReg::showTypedInstance<LLFloaterReporter>("reporter");
@@ -469,8 +473,11 @@ void LLFloaterReporter::showFromObject(const LLUUID& object_id)
LLAgentUI::buildFullname(fullname);
f->childSetText("reporter_field", fullname);
- // Request info for this object
- f->getObjectInfo(object_id);
+ if (avatar_name.empty())
+ // Request info for this object
+ f->getObjectInfo(object_id);
+ else
+ f->setFromAvatar(object_id, avatar_name);
// Need to deselect on close
f->mDeselectOnClose = TRUE;
@@ -479,6 +486,18 @@ void LLFloaterReporter::showFromObject(const LLUUID& object_id)
}
+// static
+void LLFloaterReporter::showFromObject(const LLUUID& object_id)
+{
+ show(object_id);
+}
+
+// static
+void LLFloaterReporter::showFromAvatar(const LLUUID& avatar_id, const std::string avatar_name)
+{
+ show(avatar_id, avatar_name);
+}
+
void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id)
{
childSetText("object_name", object_name);
diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h
index cc2dfb2f98..7c6473f975 100644
--- a/indra/newview/llfloaterreporter.h
+++ b/indra/newview/llfloaterreporter.h
@@ -93,6 +93,7 @@ public:
static void showFromMenu(EReportType report_type);
static void showFromObject(const LLUUID& object_id);
+ static void showFromAvatar(const LLUUID& avatar_id, const std::string avatar_name);
static void onClickSend (void *userdata);
static void onClickCancel (void *userdata);
@@ -109,6 +110,8 @@ public:
void setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id);
private:
+ static void show(const LLUUID& object_id, const std::string& avatar_name = LLStringUtil::null);
+
void takeScreenshot();
void sendReportViaCaps(std::string url);
void uploadImage();
@@ -121,6 +124,7 @@ private:
void enableControls(BOOL own_avatar);
void getObjectInfo(const LLUUID& object_id);
void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
+ void setFromAvatar(const LLUUID& avatar_id, const std::string& avatar_name = LLStringUtil::null);
private:
EReportType mReportType;
diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp
index 0374a1d25b..4b0539337b 100644
--- a/indra/newview/llinspectavatar.cpp
+++ b/indra/newview/llinspectavatar.cpp
@@ -689,7 +689,7 @@ void LLInspectAvatar::onToggleMute()
void LLInspectAvatar::onClickReport()
{
- LLFloaterReporter::showFromObject(mAvatarID);
+ LLFloaterReporter::showFromAvatar(mAvatarID, mAvatarName);
closeFloater();
}