diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 7e369cf26..e191928e7 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -393,6 +393,17 @@ Value This is an autoresponse! + AutoresponseMutedShow + + Comment + Whether to show that AutoresponseMuted's were sent + Persist + 1 + Type + Boolean + Value + 0 + AutoresponseOnlyIfAway Comment diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index c604a3260..aacfe6826 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -83,6 +83,7 @@ LLPrefsAscentChat::LLPrefsAscentChat() childSetValue("AutoresponseMuted", gSavedPerAccountSettings.getBOOL("AutoresponseMuted")); childSetValue("AutoresponseMutedItem", gSavedPerAccountSettings.getBOOL("AutoresponseMutedItem")); childSetValue("AutoresponseMutedMessage", gSavedPerAccountSettings.getString("AutoresponseMutedMessage")); + childSetValue("AutoresponseMutedShow", gSavedPerAccountSettings.getBOOL("AutoresponseMutedShow")); childSetValue("BusyModeResponse", gSavedPerAccountSettings.getString("BusyModeResponse")); childSetValue("BusyModeResponseItem", gSavedPerAccountSettings.getBOOL("BusyModeResponseItem")); childSetValue("BusyModeResponseShow", gSavedPerAccountSettings.getBOOL("BusyModeResponseShow")); @@ -291,6 +292,7 @@ void LLPrefsAscentChat::refreshValues() gSavedPerAccountSettings.setBOOL("AutoresponseMuted", childGetValue("AutoresponseMuted")); gSavedPerAccountSettings.setBOOL("AutoresponseMutedItem", childGetValue("AutoresponseMutedItem")); gSavedPerAccountSettings.setString("AutoresponseMutedMessage", childGetValue("AutoresponseMutedMessage")); + gSavedPerAccountSettings.setBOOL("AutoresponseMutedShow", childGetValue("AutoresponseMutedShow")); gSavedPerAccountSettings.setString("BusyModeResponse", childGetValue("BusyModeResponse")); gSavedPerAccountSettings.setBOOL("BusyModeResponseItem", childGetValue("BusyModeResponseItem")); gSavedPerAccountSettings.setBOOL("BusyModeResponseShow", childGetValue("BusyModeResponseShow")); diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index 3eda4098f..1183a359d 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -66,9 +66,9 @@ #include "llchat.h" #include "llfloaterchat.h" +#include "rlvhandler.h" - -void cmdline_printchat(std::string message); +void cmdline_printchat(const std::string& message); void cmdline_rezplat(bool use_saved_value = true, F32 visual_radius = 30.0); void cmdline_tp2name(std::string target); @@ -623,11 +623,11 @@ void cmdline_rezplat(bool use_saved_value, F32 visual_radius) //cmdline_rezplat( msg->sendReliable(gAgent.getRegionHost()); } -void cmdline_printchat(std::string message) +void cmdline_printchat(const std::string& message) { - LLChat chat; - chat.mText = message; + LLChat chat(message); chat.mSourceType = CHAT_SOURCE_SYSTEM; - LLFloaterChat::addChat(chat, FALSE, FALSE); + if (rlv_handler_t::isEnabled()) chat.mRlvLocFiltered = chat.mRlvNamesFiltered = true; + LLFloaterChat::addChat(chat); } diff --git a/indra/newview/floaterao.cpp b/indra/newview/floaterao.cpp index c9386d95a..ace2fbad9 100644 --- a/indra/newview/floaterao.cpp +++ b/indra/newview/floaterao.cpp @@ -38,7 +38,7 @@ #include // Uncomment and use instead if we ever add the chatbar as a command line - MC -void cmdline_printchat(std::string message); +void cmdline_printchat(const std::string& message); class AONotecardCallback : public LLInventoryCallback { diff --git a/indra/newview/importtracker.cpp b/indra/newview/importtracker.cpp index bddbf790e..568567c50 100644 --- a/indra/newview/importtracker.cpp +++ b/indra/newview/importtracker.cpp @@ -87,7 +87,7 @@ void ImportTracker::expectRez() state = IDLE; finish(); } -void cmdline_printchat(std::string message);*/ +void cmdline_printchat(const std::string& message);*/ LLViewerObject* find(U32 local) { S32 i; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 2779f1404..bee61a0f9 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2164,6 +2164,27 @@ std::string replace_wildcards(std::string autoresponse, const LLUUID& id, const return autoresponse; } +void autoresponder_finish(bool show_autoresponded, const LLUUID& computed_session_id, const LLUUID& from_id, const std::string& name, const LLUUID& itemid, bool is_muted) +{ + LLAvatarName av_name; + const std::string ns_name(LLAvatarNameCache::get(from_id, &av_name) ? av_name.getNSName() : name); + void cmdline_printchat(const std::string& message); + if (show_autoresponded) + { + const std::string notice(LLTrans::getString("IM_autoresponded_to") + ' ' + ns_name); + is_muted ? cmdline_printchat(notice) : gIMMgr->addMessage(computed_session_id, from_id, name, notice); + } + if (LLViewerInventoryItem* item = gInventory.getItem(itemid)) + { + LLGiveInventory::doGiveInventoryItem(from_id, item, computed_session_id); + if (show_autoresponded) + { + const std::string notice(llformat("%s %s \"%s\"", ns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str())); + is_muted ? cmdline_printchat(notice) : gIMMgr->addMessage(computed_session_id, from_id, name, notice); + } + } +} + void process_improved_im(LLMessageSystem *msg, void **user_data) { if (gNoRender) @@ -2422,7 +2443,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) response = gSavedPerAccountSettings.getString("AutoresponseMutedMessage"); if (gSavedPerAccountSettings.getBOOL("AutoresponseMutedItem")) itemid = static_cast(gSavedPerAccountSettings.getString("AutoresponseMutedItemID")); - // We don't show that we've responded to mutes + show_autoresponded = gSavedPerAccountSettings.getBOOL("AutoresponseMutedShow"); } else if (is_autorespond_nonfriends) { @@ -2442,7 +2463,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) gMessageSystem, gAgentID, FALSE, - gAgent.getSessionID(), + gAgentSessionID, from_id, my_name, replace_wildcards(response, from_id, name), @@ -2451,21 +2472,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) session_id); gAgent.sendReliableMessage(); - LLAvatarName av_name; - std::string ns_name = LLAvatarNameCache::get(from_id, &av_name) ? av_name.getNSName() : name; - if (show_autoresponded) - { - gIMMgr->addMessage(session_id, from_id, name, LLTrans::getString("IM_autoresponded_to") + " " + ns_name); - } - if (LLViewerInventoryItem* item = gInventory.getItem(itemid)) - { - LLGiveInventory::doGiveInventoryItem(from_id, item, computed_session_id); - if (show_autoresponded) - { - gIMMgr->addMessage(computed_session_id, from_id, name, - llformat("%s %s \"%s\"", ns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str())); - } - } + autoresponder_finish(show_autoresponded, computed_session_id, from_id, name, itemid, is_muted); } // We stored the incoming IM in history before autoresponding, logically. } @@ -2561,7 +2568,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) gMessageSystem, gAgentID, FALSE, - gAgent.getSessionID(), + gAgentSessionID, from_id, my_name, replace_wildcards(gSavedPerAccountSettings.getString("AutoresponseMutedMessage"), from_id, name), @@ -2569,9 +2576,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) IM_BUSY_AUTO_RESPONSE, session_id); gAgent.sendReliableMessage(); - if (gSavedPerAccountSettings.getBOOL("AutoresponseMutedItem")) - if (LLViewerInventoryItem* item = gInventory.getItem(static_cast(gSavedPerAccountSettings.getString("AutoresponseMutedItemID")))) - LLGiveInventory::doGiveInventoryItem(from_id, item, computed_session_id); + LLAvatarName av_name; + autoresponder_finish(gSavedPerAccountSettings.getBOOL("AutoresponseMutedShow"), computed_session_id, from_id, LLAvatarNameCache::get(from_id, &av_name) ? av_name.getNSName() : name, gSavedPerAccountSettings.getBOOL("AutoresponseMutedItem") ? static_cast(gSavedPerAccountSettings.getString("AutoresponseMutedItemID")) : LLUUID::null, true); } } } @@ -2624,19 +2630,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) pack_instant_message(gMessageSystem, gAgentID, false, gAgentSessionID, from_id, my_name, replace_wildcards(response, from_id, name), IM_ONLINE, IM_BUSY_AUTO_RESPONSE, session_id); gAgent.sendReliableMessage(); - if (show_autoresponded) - { - gIMMgr->addMessage(session_id, from_id, name, LLTrans::getString("IM_autoresponded_to") + " " + ns_name); - } - if (LLViewerInventoryItem* item = gInventory.getItem(itemid)) - { - LLGiveInventory::doGiveInventoryItem(from_id, item, computed_session_id); - if (show_autoresponded) - { - gIMMgr->addMessage(computed_session_id, from_id, name, - llformat("%s %s \"%s\"", ns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str())); - } - } + autoresponder_finish(show_autoresponded, computed_session_id, from_id, name, itemid, is_muted); } } LLPointer im_info = new LLIMInfo(gMessageSystem); @@ -3488,7 +3482,7 @@ void send_do_not_disturb_message (LLMessageSystem* msg, const LLUUID& from_id, c std::string ns_name = LLAvatarNameCache::get(from_id, &av_name) ? av_name.getNSName() : from_name; LLUUID session_id; msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ID, session_id); - if (gSavedPerAccountSettings.getBOOL("BusyModeResponseShow")) gIMMgr->addMessage(session_id, from_id, from_name, LLTrans::getString("IM_autoresponded_to") + " " + ns_name); + if (gSavedPerAccountSettings.getBOOL("BusyModeResponseShow")) gIMMgr->addMessage(session_id, from_id, from_name, LLTrans::getString("IM_autoresponded_to") + ' ' + ns_name); if (!gSavedPerAccountSettings.getBOOL("BusyModeResponseItem")) return; // Not sending an item, finished if (LLViewerInventoryItem* item = gInventory.getItem(static_cast(gSavedPerAccountSettings.getString("BusyModeResponseItemID")))) { diff --git a/indra/newview/scriptcounter.cpp b/indra/newview/scriptcounter.cpp index 61219980b..f6f53c067 100644 --- a/indra/newview/scriptcounter.cpp +++ b/indra/newview/scriptcounter.cpp @@ -40,7 +40,7 @@ #include "llvoavatar.h" #include "stringize.h" -void cmdline_printchat(std::string chat); +void cmdline_printchat(const std::string& message); LLVOAvatar* find_avatar_from_object( LLViewerObject* object ); diff --git a/indra/newview/shcommandhandler.cpp b/indra/newview/shcommandhandler.cpp index c6229ad0e..fc0856bf8 100644 --- a/indra/newview/shcommandhandler.cpp +++ b/indra/newview/shcommandhandler.cpp @@ -170,7 +170,7 @@ CMD_SCRIPT(gettext) #include "llphysicsmotion.h" -void cmdline_printchat(std::string message); +void cmdline_printchat(const std::string& message); CMD_CHAT(physparams) { //args[1] = avatar name diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml index 7a49ea9db..a835181d3 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml @@ -127,6 +127,7 @@ The following wildcards are available to enhance your autoresponses: #n for user + Busy Mode Response: