Skip to content
Snippets Groups Projects
Commit 18932985 authored by Vadim Savchuk's avatar Vadim Savchuk
Browse files

Fixed bug EXT-4582 ([BSI] "Report" from avatar inspector does not...

Fixed bug EXT-4582 ([BSI] "Report" from avatar inspector does not auto-populate "Abuser name" when Resident is not nearby).
Added method LLFloaterReporter::showFromAvatar() to use for remote avatars.

--HG--
branch : product-engine
parent ff852efd
No related branches found
No related tags found
No related merge requests found
...@@ -277,13 +277,8 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) ...@@ -277,13 +277,8 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
{ {
object_owner.append("Unknown"); object_owner.append("Unknown");
} }
childSetText("object_name", object_owner);
std::string owner_link = setFromAvatar(object_id, object_owner);
LLSLURL::buildCommand("agent", mObjectID, "inspect");
childSetText("owner_name", owner_link);
childSetText("abuser_name_edit", object_owner);
mAbuserID = object_id;
mOwnerName = object_owner;
} }
else else
{ {
...@@ -305,7 +300,6 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) ...@@ -305,7 +300,6 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
} }
} }
void LLFloaterReporter::onClickSelectAbuser() void LLFloaterReporter::onClickSelectAbuser()
{ {
gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, this, _1, _2), FALSE, TRUE )); 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, ...@@ -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 // static
void LLFloaterReporter::onClickSend(void *userdata) void LLFloaterReporter::onClickSend(void *userdata)
{ {
...@@ -458,9 +463,8 @@ void LLFloaterReporter::showFromMenu(EReportType report_type) ...@@ -458,9 +463,8 @@ void LLFloaterReporter::showFromMenu(EReportType report_type)
} }
} }
// static // 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"); LLFloaterReporter* f = LLFloaterReg::showTypedInstance<LLFloaterReporter>("reporter");
...@@ -469,8 +473,11 @@ void LLFloaterReporter::showFromObject(const LLUUID& object_id) ...@@ -469,8 +473,11 @@ void LLFloaterReporter::showFromObject(const LLUUID& object_id)
LLAgentUI::buildFullname(fullname); LLAgentUI::buildFullname(fullname);
f->childSetText("reporter_field", fullname); f->childSetText("reporter_field", fullname);
// Request info for this object if (avatar_name.empty())
f->getObjectInfo(object_id); // Request info for this object
f->getObjectInfo(object_id);
else
f->setFromAvatar(object_id, avatar_name);
// Need to deselect on close // Need to deselect on close
f->mDeselectOnClose = TRUE; f->mDeselectOnClose = TRUE;
...@@ -479,6 +486,18 @@ void LLFloaterReporter::showFromObject(const LLUUID& object_id) ...@@ -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) void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id)
{ {
childSetText("object_name", object_name); childSetText("object_name", object_name);
......
...@@ -93,6 +93,7 @@ class LLFloaterReporter ...@@ -93,6 +93,7 @@ class LLFloaterReporter
static void showFromMenu(EReportType report_type); static void showFromMenu(EReportType report_type);
static void showFromObject(const LLUUID& object_id); 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 onClickSend (void *userdata);
static void onClickCancel (void *userdata); static void onClickCancel (void *userdata);
...@@ -109,6 +110,8 @@ class LLFloaterReporter ...@@ -109,6 +110,8 @@ class LLFloaterReporter
void setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id); void setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id);
private: private:
static void show(const LLUUID& object_id, const std::string& avatar_name = LLStringUtil::null);
void takeScreenshot(); void takeScreenshot();
void sendReportViaCaps(std::string url); void sendReportViaCaps(std::string url);
void uploadImage(); void uploadImage();
...@@ -121,6 +124,7 @@ class LLFloaterReporter ...@@ -121,6 +124,7 @@ class LLFloaterReporter
void enableControls(BOOL own_avatar); void enableControls(BOOL own_avatar);
void getObjectInfo(const LLUUID& object_id); void getObjectInfo(const LLUUID& object_id);
void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids); 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: private:
EReportType mReportType; EReportType mReportType;
......
...@@ -689,7 +689,7 @@ void LLInspectAvatar::onToggleMute() ...@@ -689,7 +689,7 @@ void LLInspectAvatar::onToggleMute()
void LLInspectAvatar::onClickReport() void LLInspectAvatar::onClickReport()
{ {
LLFloaterReporter::showFromObject(mAvatarID); LLFloaterReporter::showFromAvatar(mAvatarID, mAvatarName);
closeFloater(); closeFloater();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment