diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-01-24 23:36:56 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-01-24 23:37:21 +0200 |
commit | e129986a49a9e1ee3ffef8a98a3dc83a310c95c9 (patch) | |
tree | afbe856540dc172f4718f897e42a950de8a7e882 /indra/newview/llchathistory.cpp | |
parent | b6029c4c34782b8c423ea2625712e8b8604af442 (diff) |
SL-3007 Ability to report abuse from chat
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r-- | indra/newview/llchathistory.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index c110e0d815..dffd523b02 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -48,6 +48,7 @@ #include "llspeakers.h" //for LLIMSpeakerMgr #include "lltrans.h" #include "llfloaterreg.h" +#include "llfloaterreporter.h" #include "llfloatersidepanelcontainer.h" #include "llmutelist.h" #include "llstylemap.h" @@ -403,6 +404,10 @@ public: { LLAvatarActions::pay(getAvatarId()); } + else if (level == "report_abuse") + { + LLFloaterReporter::showFromChat(mAvatarID, mFrom, getChild<LLTextBox>("time_box")->getValue().asString(), mText); + } else if(level == "block_unblock") { LLAvatarActions::toggleMute(getAvatarId(), LLMute::flagVoiceChat); @@ -477,6 +482,10 @@ public: { return canModerate(userdata); } + else if (level == "report_abuse") + { + return gAgentID != mAvatarID; + } else if (level == "can_ban_member") { return canBanGroupMember(getAvatarId()); @@ -628,6 +637,11 @@ public: mSessionID = chat.mSessionID; mSourceType = chat.mSourceType; + // To be able to report a message, we need a copy of it's text + // and it's easier to store text directly than trying to get + // it from a lltextsegment or chat's mEditor + mText = chat.mText; + //*TODO overly defensive thing, source type should be maintained out there if((chat.mFromID.isNull() && chat.mFromName.empty()) || (chat.mFromName == SYSTEM_FROM && chat.mFromID.isNull())) { @@ -977,6 +991,7 @@ protected: EChatSourceType mSourceType; std::string mFrom; LLUUID mSessionID; + std::string mText; S32 mMinUserNameWidth; const LLFontGL* mUserNameFont; |