From b8da1259ba9fa9b2afc0a2b6050b147dbf13ccb8 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 21 Oct 2024 16:35:23 -0700 Subject: Issue #2907: Process metadata sent along with chats of type IM_NOTHING_SPECIAL, The metadata can contain information about the bot status of the sender. It may also contain a system-injected notification that is displayed to the agent as part of the 1:1 chat window. --- indra/newview/llimprocessing.cpp | 47 ++++++++++++++++++++++++-- indra/newview/llimprocessing.h | 1 + indra/newview/llimview.cpp | 2 +- indra/newview/llviewermessage.cpp | 18 +++++++++- indra/newview/skins/default/xui/da/strings.xml | 4 +++ indra/newview/skins/default/xui/de/strings.xml | 4 +++ indra/newview/skins/default/xui/en/strings.xml | 4 +++ indra/newview/skins/default/xui/es/strings.xml | 4 +++ indra/newview/skins/default/xui/fr/strings.xml | 4 +++ indra/newview/skins/default/xui/it/strings.xml | 4 +++ indra/newview/skins/default/xui/ja/strings.xml | 4 +++ indra/newview/skins/default/xui/pl/strings.xml | 4 +++ indra/newview/skins/default/xui/pt/strings.xml | 4 +++ indra/newview/skins/default/xui/ru/strings.xml | 4 +++ indra/newview/skins/default/xui/tr/strings.xml | 4 +++ indra/newview/skins/default/xui/zh/strings.xml | 4 +++ 16 files changed, 111 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 590cd09a31..5d1317f00f 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -422,6 +422,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, U8 *binary_bucket, S32 binary_bucket_size, LLHost &sender, + LLSD metadata, LLUUID aux_id) { LLChat chat; @@ -451,6 +452,30 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, bool is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT && LLMuteList::isLinden(name); + /*** + * The simulator has flagged this sender as a bot, if the viewer would like to display + * the chat text in a different color or font, the below code is how the viewer can + * tell if the sender is a bot. + *----------------------------------------------------- + bool is_bot = false; + if (metadata.has("sender")) + { // The server has identified this sender as a bot. + is_bot = metadata["sender"]["bot"].asBoolean(); + } + *----------------------------------------------------- + */ + + bool is_system_notice = false; + std::string notice_id; + LLSD notice_args; + if (metadata.has("notice")) + { // The server has injected a notice into the IM conversation. + // These will be things like bot notifications, etc. + is_system_notice = true; + notice_id = metadata["notice"]["id"].asString(); + notice_args = metadata["notice"]["data"]; + } + chat.mMuted = is_muted; chat.mFromID = from_id; chat.mFromName = name; @@ -544,7 +569,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, } else { - // standard message, not from system + // standard message, server may have injected a notice into the conversation. std::string saved; if (offline == IM_OFFLINE) { @@ -579,8 +604,16 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, region_message = true; } } - gIMMgr->addMessage( - session_id, + + if (is_system_notice) + { // The simulator has injected some sort of notice into the conversation. + // findString will only replace the contents of buffer if the notice_id is found. + LLTrans::findString(buffer, notice_id, notice_args); + name = SYSTEM_FROM; + from_id = LLUUID::null; + } + + gIMMgr->addMessage(session_id, from_id, name, buffer, @@ -592,6 +625,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, position, region_message, timestamp); + } else { @@ -1627,6 +1661,12 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) from_group = message_data["from_group"].asString() == "Y"; } + LLSD metadata; + if (message_data.has("metadata")) + { + metadata = message_data["metadata"]; + } + EInstantMessage dialog = static_cast(message_data["dialog"].asInteger()); LLUUID session_id = message_data["transaction-id"].asUUID(); if (session_id.isNull() && dialog == IM_FROM_TASK) @@ -1654,6 +1694,7 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) local_bin_bucket.data(), S32(local_bin_bucket.size()), local_sender, + metadata, message_data["asset_id"].asUUID()); }); diff --git a/indra/newview/llimprocessing.h b/indra/newview/llimprocessing.h index 030d28b198..66ffc59ae0 100644 --- a/indra/newview/llimprocessing.h +++ b/indra/newview/llimprocessing.h @@ -48,6 +48,7 @@ public: U8 *binary_bucket, S32 binary_bucket_size, LLHost &sender, + LLSD metadata, LLUUID aux_id = LLUUID::null); // Either receives list of offline messages from 'ReadOfflineMsgs' capability diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 1402cc8c37..8a54267292 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3143,7 +3143,7 @@ void LLIMMgr::addMessage( const LLUUID& region_id, const LLVector3& position, bool is_region_msg, - U32 timestamp) // May be zero + U32 timestamp) // May be zero { LLUUID other_participant_id = target_id; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 33d9b5eb67..d722851851 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2139,6 +2139,21 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) EInstantMessage dialog = (EInstantMessage)d; LLHost sender = msg->getSender(); + LLSD metadata; + if (msg->getNumberOfBlocksFast(_PREHASH_MetaData) > 0) + { + S32 metadata_size = msg->getSizeFast(_PREHASH_MetaData, 0, _PREHASH_Data); + std::string metadata_buffer; + metadata_buffer.resize(metadata_size, 0); + + msg->getBinaryDataFast(_PREHASH_MetaData, _PREHASH_Data, &metadata_buffer[0], metadata_size, 0, metadata_size ); + std::stringstream metadata_stream(metadata_buffer); + if (LLSDSerialize::fromBinary(metadata, metadata_stream, metadata_size) == LLSDParser::PARSE_FAILURE) + { + metadata.clear(); + } + } + LLIMProcessing::processNewMessage(from_id, from_group, to_id, @@ -2153,7 +2168,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) position, binary_bucket, binary_bucket_size, - sender); + sender, + metadata); } void send_do_not_disturb_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id) diff --git a/indra/newview/skins/default/xui/da/strings.xml b/indra/newview/skins/default/xui/da/strings.xml index e4f99d14e9..c4275d43f7 100644 --- a/indra/newview/skins/default/xui/da/strings.xml +++ b/indra/newview/skins/default/xui/da/strings.xml @@ -3723,6 +3723,10 @@ Hvis du bliver ved med at modtage denne besked, kontakt venligst [SUPPORT_SITE]. Konference med [AGENT_NAME] + +Du chatter med en bot, [NAME]. Del ikke personlige oplysninger. +Læs mere på https://second.life/scripted-agents. + (IM session eksisterer ikke) diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index 8464bd9b0c..dd003e72d9 100644 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -1613,6 +1613,10 @@ Falls diese Meldung weiterhin angezeigt wird, wenden Sie sich bitte an [SUPPORT_ Konferenz mit [AGENT_NAME] Inventarobjekt „[ITEM_NAME]“ angeboten Inventarordner „[ITEM_NAME]“ angeboten + + Sie chatten mit einem Bot, [NAME]. Geben Sie keine persönlichen Informationen weiter. +Erfahren Sie mehr unter https://second.life/scripted-agents. + Objekte aus dem Inventar hier her ziehen Sie haben auf Facebook gepostet. Sie haben auf Flickr gepostet. diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 3ec4b7205b..9be4a8f737 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3720,6 +3720,10 @@ Please reinstall viewer from https://secondlife.com/support/downloads/ and cont Inventory folder '[ITEM_NAME]' offered + + You are chatting with a bot, [NAME]. Do not share any personal information. +Learn more at https://second.life/scripted-agents. + Drag items from inventory here diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml index 9fcfc2daa5..97e86e994c 100644 --- a/indra/newview/skins/default/xui/es/strings.xml +++ b/indra/newview/skins/default/xui/es/strings.xml @@ -1584,6 +1584,10 @@ Si sigues recibiendo este mensaje, contacta con [SUPPORT_SITE]. Conferencia con [AGENT_NAME] Ítem del inventario '[ITEM_NAME]' ofrecido Carpeta del inventario '[ITEM_NAME]' ofrecida + +Estás conversando con un bot, [NAME]. No compartas información personal. +Más información en https://second.life/scripted-agents. + Arrastra los ítems desde el invenbtario hasta aquí Has publicado en Facebook. Has publicado en Flickr. diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index 55f6209fe1..60916ef92b 100644 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -1614,6 +1614,10 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE]. Conférence avec [AGENT_NAME] Objet de l’inventaire [ITEM_NAME] offert Dossier de l’inventaire [ITEM_NAME] offert + +Vous discutez avec un bot, [NAME]. Ne partagez pas d’informations personnelles. +En savoir plus sur https://second.life/scripted-agents. + Faire glisser les objets de l'inventaire ici Vous avez publié sur Facebook. Vous avez publié sur Flickr. diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml index f77ab1062a..88708a2b4d 100644 --- a/indra/newview/skins/default/xui/it/strings.xml +++ b/indra/newview/skins/default/xui/it/strings.xml @@ -1586,6 +1586,10 @@ Se il messaggio persiste, contatta [SUPPORT_SITE]. Chiamata in conferenza con [AGENT_NAME] Offerto oggetto di inventario "[ITEM_NAME]" Offerta cartella di inventario "[ITEM_NAME]" + +Stai parlando con un bot, [NAME]. Non condividere informazioni personali. +Scopri di più su https://second.life/scripted-agents. + Hai pubblicato su Facebook. Hai pubblicato su Flickr. Hai pubblicato su Twitter. diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index fa6c329fe7..ff3b1a53a2 100644 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -6150,6 +6150,10 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ フォルダ「[ITEM_NAME]」がインベントリに送られてきました。 + +[NAME]とチャットしています。個人情報を共有しないでください。 +詳細は https://second.life/scripted-agents をご覧ください。 + インベントリからここにアイテムをドラッグします。 diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml index 8032443020..65b487e1b3 100644 --- a/indra/newview/skins/default/xui/pl/strings.xml +++ b/indra/newview/skins/default/xui/pl/strings.xml @@ -4412,6 +4412,10 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Zaoferowano folder: '[ITEM_NAME]' + +Rozmawiasz z botem [NAME]. Nie udostępniaj żadnych danych osobowych. +Dowiedz się więcej na https://second.life/scripted-agents. + Przeciągaj tutaj rzeczy z Szafy diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml index 4ce1e6d2ec..9e66777b5a 100644 --- a/indra/newview/skins/default/xui/pt/strings.xml +++ b/indra/newview/skins/default/xui/pt/strings.xml @@ -1549,6 +1549,10 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Conversa com [AGENT_NAME] Item do inventário '[ITEM_NAME]' oferecido Pasta do inventário '[ITEM_NAME]' oferecida + +Você está conversando com um bot, [NAME]. Não compartilhe informações pessoais. +Saiba mais em https://second.life/scripted-agents. + Você publicou no Facebook. Você publicou no Flickr. Você publicou no Twitter. diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml index 0079309ba2..174999ea36 100644 --- a/indra/newview/skins/default/xui/ru/strings.xml +++ b/indra/newview/skins/default/xui/ru/strings.xml @@ -4576,6 +4576,10 @@ support@secondlife.com. Предложена папка инвентаря «[ITEM_NAME]» + +Вы общаетесь с ботом [NAME]. Не передавайте личные данные. +Подробнее на https://second.life/scripted-agents. + Перетаскивайте вещи из инвентаря сюда diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml index fa2fd3a802..6c1f6506a2 100644 --- a/indra/newview/skins/default/xui/tr/strings.xml +++ b/indra/newview/skins/default/xui/tr/strings.xml @@ -4579,6 +4579,10 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. "[ITEM_NAME]" envanter klasörü sunuldu + +Bir bot ile sohbet ediyorsunuz, [NAME]. Kişisel bilgilerinizi paylaşmayın. +Daha fazla bilgi için: https://second.life/scripted-agents. + Envanterinizden buraya öğeler sürükleyin diff --git a/indra/newview/skins/default/xui/zh/strings.xml b/indra/newview/skins/default/xui/zh/strings.xml index bdb16c9bf1..a3a9915dc4 100644 --- a/indra/newview/skins/default/xui/zh/strings.xml +++ b/indra/newview/skins/default/xui/zh/strings.xml @@ -4573,6 +4573,10 @@ http://secondlife.com/support 求助解決問題。 收納區資料夾'[ITEM_NAME]'已向人提供 + +您正在与人工智能机器人 [NAME] 聊天。请勿分享任何个人信息。 +了解更多:https://second.life/scripted-agents。 + 將收納區物品拖曳到這裡 -- cgit v1.2.3 From 1f4b1dc174625d32bfdbd0e93847bd478f06f47f Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 23 Oct 2024 11:31:29 -0700 Subject: Issue #2907: Code review comments. --- indra/newview/llimprocessing.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 5d1317f00f..f5b149335b 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -453,7 +453,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, LLMuteList::isLinden(name); /*** - * The simulator has flagged this sender as a bot, if the viewer would like to display + * The simulator may have flagged this sender as a bot, if the viewer would like to display * the chat text in a different color or font, the below code is how the viewer can * tell if the sender is a bot. *----------------------------------------------------- @@ -465,14 +465,12 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, *----------------------------------------------------- */ - bool is_system_notice = false; - std::string notice_id; + std::string notice_name; LLSD notice_args; if (metadata.has("notice")) { // The server has injected a notice into the IM conversation. // These will be things like bot notifications, etc. - is_system_notice = true; - notice_id = metadata["notice"]["id"].asString(); + notice_name = metadata["notice"]["id"].asString(); notice_args = metadata["notice"]["data"]; } @@ -605,10 +603,10 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, } } - if (is_system_notice) + if (!notice_name.empty()) { // The simulator has injected some sort of notice into the conversation. // findString will only replace the contents of buffer if the notice_id is found. - LLTrans::findString(buffer, notice_id, notice_args); + LLTrans::findString(buffer, notice_name, notice_args); name = SYSTEM_FROM; from_id = LLUUID::null; } -- cgit v1.2.3 From 297c2016a12ca4bb427572dca73206d8ba2b1888 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Thu, 24 Oct 2024 00:36:48 +0200 Subject: #2577 Worn transparent prims no longer show with 'Highlight transparent' --- indra/newview/pipeline.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 84f026699e..0b4b98d674 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -11248,21 +11248,24 @@ public: } }; - +// Called from LLViewHighlightTransparent when "Highlight Transparent" is toggled void LLPipeline::rebuildDrawInfo() { - for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); - iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + const U32 types_to_traverse[] = { - LLViewerRegion* region = *iter; - - LLOctreeDirty dirty; - - LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_VOLUME); - dirty.traverse(part->mOctree); + LLViewerRegion::PARTITION_VOLUME, + LLViewerRegion::PARTITION_BRIDGE, + LLViewerRegion::PARTITION_AVATAR + }; - part = region->getSpatialPartition(LLViewerRegion::PARTITION_BRIDGE); - dirty.traverse(part->mOctree); + LLOctreeDirty dirty; + for (LLViewerRegion* region : LLWorld::getInstance()->getRegionList()) + { + for (U32 type : types_to_traverse) + { + LLSpatialPartition* part = region->getSpatialPartition(type); + dirty.traverse(part->mOctree); + } } } -- cgit v1.2.3 From f9be6cb5b3e6fe3eadafc7ddbcc000c3fe8ed225 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 24 Oct 2024 17:29:45 +0300 Subject: #2904 output position should ignore cursor position --- indra/newview/llfloaterluadebug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterluadebug.cpp b/indra/newview/llfloaterluadebug.cpp index 7a7824c7e6..362a02a642 100644 --- a/indra/newview/llfloaterluadebug.cpp +++ b/indra/newview/llfloaterluadebug.cpp @@ -60,7 +60,7 @@ bool LLFloaterLUADebug::postBuild() { LLCachedControl show_source_info(gSavedSettings, "LuaDebugShowSource", false); std::string source_info = show_source_info ? data["source_info"].asString() : ""; - mResultOutput->pasteTextWithLinebreaks(stringize(data["level"].asString(), source_info, data["msg"].asString())); + mResultOutput->pasteTextWithLinebreaks(stringize(data["level"].asString(), source_info, data["msg"].asString()), true); mResultOutput->addLineBreakChar(true); return false; }); -- cgit v1.2.3 From 299c37adaec5cf33981cbbaa3c25c68152b14725 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 24 Oct 2024 18:01:03 +0300 Subject: #2899 Mac: add the libSDL2 link to SLPlugin --- indra/newview/viewer_manifest.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index efc90b8991..18ff6cf7b6 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1032,6 +1032,12 @@ class Darwin_x86_64_Manifest(ViewerManifest): ): dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) + # SDL2 + for libfile in ( + 'libSDL2-2.0.dylib', + ): + dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) + # our apps executable_path = {} embedded_apps = [ (os.path.join("llplugin", "slplugin"), "SLPlugin.app") ] -- cgit v1.2.3