diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c947e3394d..f263c38f69 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -94,6 +94,8 @@ #include "llgiveinventory.h" #include "llinventoryfunctions.h" +#include "omnifilterengine.h" // Omnifilter support + #include const static std::string ADHOC_NAME_SUFFIX(" Conference"); @@ -3474,6 +3476,30 @@ void LLIMMgr::addMessage( bool is_announcement, // Special parameter indicating announcements bool keyword_alert_performed) // Pass info if keyword alert has been performed { + // Omnifilter support + static LLCachedControl use_omnifilter(gSavedSettings, "OmnifilterEnabled"); + if (use_omnifilter) + { + // this is the type for new group IM sessions started - apparently this is the only place + // we get this type of message + if (dialog == IM_SESSION_INVITE) + { + OmnifilterEngine::Haystack haystack; + haystack.mContent = msg; + haystack.mSenderName = from; + haystack.mOwnerID = target_id; + haystack.mType = OmnifilterEngine::eType::GroupChat; + + const OmnifilterEngine::Needle* needle = OmnifilterEngine::getInstance()->match(haystack); + if (needle) + { + // no text replacement for agent messages to prevent forgery attempts + return; + } + } + } + // + LLUUID other_participant_id = target_id; std::string message_display_name = (display_name.empty()) ? from : std::string(display_name); if (display_id.isNull() && (display_name.empty()))