summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2020-07-22 19:15:28 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2020-07-22 19:15:28 +0300
commit48a4e9f5ed3851bd56bd54c5c761fe9133b92350 (patch)
treea8826d2dc98d5e234beb71c5b56d7678a341506a /indra
parent7d4b1c014c9900af47005a529df50ece14249326 (diff)
SL-13620 FIXED The code appears instead of the maturity icon in the chat history
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llimprocessing.cpp18
-rw-r--r--indra/newview/llnotificationhandler.h1
-rw-r--r--indra/newview/llnotificationhandlerutil.cpp15
-rw-r--r--indra/newview/llnotificationofferhandler.cpp16
4 files changed, 35 insertions, 15 deletions
diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp
index 7b87b43243..6ccb9766a5 100644
--- a/indra/newview/llimprocessing.cpp
+++ b/indra/newview/llimprocessing.cpp
@@ -1606,15 +1606,15 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url)
bin_bucket.push_back(0);
}
- // Todo: once drtsim-451 releases, remove the string option
- BOOL from_group;
- if (message_data["from_group"].isInteger())
- {
- from_group = message_data["from_group"].asInteger();
- }
- else
- {
- from_group = message_data["from_group"].asString() == "Y";
+ // Todo: once drtsim-451 releases, remove the string option
+ BOOL from_group;
+ if (message_data["from_group"].isInteger())
+ {
+ from_group = message_data["from_group"].asInteger();
+ }
+ else
+ {
+ from_group = message_data["from_group"].asString() == "Y";
}
LLIMProcessing::processNewMessage(
diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h
index 52c5234137..ef4aced2c7 100644
--- a/indra/newview/llnotificationhandler.h
+++ b/indra/newview/llnotificationhandler.h
@@ -297,6 +297,7 @@ public:
* Writes notification message to IM p2p session.
*/
static void logToIMP2P(const LLNotificationPtr& notification, bool to_file_only = false);
+ static void logToIMP2P(const LLUUID& from_id, const std::string& message, bool to_file_only = false);
/**
* Writes group notice notification message to IM group session.
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index 9a3f1a853a..39a0b9b50e 100644
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -123,15 +123,13 @@ void log_name_callback(const LLAvatarName& av_name, const std::string& from_name
}
// static
-void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_file_only)
+void LLHandlerUtil::logToIMP2P(const LLUUID& from_id, const std::string& message, bool to_file_only)
{
if (!gCacheName)
{
return;
}
- LLUUID from_id = notification->getPayload()["from_id"];
-
if (from_id.isNull())
{
// Normal behavior for system generated messages, don't spam.
@@ -141,15 +139,22 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi
if(to_file_only)
{
- LLAvatarNameCache::get(from_id, boost::bind(&log_name_callback, _2, "", notification->getMessage(), LLUUID()));
+ LLAvatarNameCache::get(from_id, boost::bind(&log_name_callback, _2, "", message, LLUUID()));
}
else
{
- LLAvatarNameCache::get(from_id, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id));
+ LLAvatarNameCache::get(from_id, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, message, from_id));
}
}
// static
+void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_file_only)
+{
+ LLUUID from_id = notification->getPayload()["from_id"];
+ logToIMP2P(from_id, notification->getMessage(), to_file_only);
+}
+
+// static
void LLHandlerUtil::logGroupNoticeToIMGroup(
const LLNotificationPtr& notification)
{
diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp
index 14d25d8158..a9678b1e93 100644
--- a/indra/newview/llnotificationofferhandler.cpp
+++ b/indra/newview/llnotificationofferhandler.cpp
@@ -37,6 +37,8 @@
#include "llimview.h"
#include "llnotificationsutil.h"
+#include <boost/regex.hpp>
+
using namespace LLNotificationsUI;
//--------------------------------------------------------------------------
@@ -143,7 +145,19 @@ bool LLOfferHandler::processNotification(const LLNotificationPtr& notification)
{
// log only to file if notif panel can be embedded to IM and IM is opened
bool file_only = add_notif_to_im && LLHandlerUtil::isIMFloaterOpened(notification);
- LLHandlerUtil::logToIMP2P(notification, file_only);
+ if ((notification->getName() == "TeleportOffered"
+ || notification->getName() == "TeleportOffered_MaturityExceeded"
+ || notification->getName() == "TeleportOffered_MaturityBlocked"))
+ {
+ boost::regex r("<icon\\s*>\\s*([^<]*)?\\s*</icon\\s*>( - )?",
+ boost::regex::perl|boost::regex::icase);
+ std::string stripped_msg = boost::regex_replace(notification->getMessage(), r, "");
+ LLHandlerUtil::logToIMP2P(notification->getPayload()["from_id"], stripped_msg,file_only);
+ }
+ else
+ {
+ LLHandlerUtil::logToIMP2P(notification, file_only);
+ }
}
}