Feature Request: Offer to show that autoresponse to muted was sent.

Also, stop letting RLV filter cmdline_printchat() calls.
This commit is contained in:
Inusaito Sayori
2015-03-19 03:37:01 -04:00
parent 8cc2499f0a
commit 6cd7941fd2
9 changed files with 53 additions and 45 deletions

View File

@@ -393,6 +393,17 @@
<key>Value</key>
<string>This is an autoresponse!</string>
</map>
<key>AutoresponseMutedShow</key>
<map>
<key>Comment</key>
<string>Whether to show that AutoresponseMuted's were sent</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>AutoresponseOnlyIfAway</key>
<map>
<key>Comment</key>

View File

@@ -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"));

View File

@@ -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);
}

View File

@@ -38,7 +38,7 @@
#include <boost/regex.hpp>
// 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
{

View File

@@ -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;

View File

@@ -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<LLUUID>(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<LLUUID>(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<LLUUID>(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<LLIMInfo> 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<LLUUID>(gSavedPerAccountSettings.getString("BusyModeResponseItemID"))))
{

View File

@@ -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 );

View File

@@ -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

View File

@@ -127,6 +127,7 @@ The following wildcards are available to enhance your autoresponses: #n for user
<drop_target bottom_delta="-124" left="8" height="17" width="480" control_name="AutoresponseNonFriendsItemID" name="AutoresponseNonFriendsItemID" tool_tip="Drop an item here to have it sent with the above response."/>
<check_box bottom_delta="82" left="6" follows="left|top" control_name="AutoresponseMuted" name="AutoresponseMuted" label="Autorespond to people you have muted" tool_tip="Send the message in the box below to people you have muted."/>
<check_box bottom_delta="0" left_delta="250" follows="left|top" control_name="AutoresponseMutedItem" name="AutoresponseMutedItem" label="Send item"/>
<check_box bottom_delta="0" left_delta="80" follows="left|top" control_name="AutoresponseMutedShow" name="AutoresponseMutedShow" label="Show that this was sent"/>
<text_editor bottom_delta="-47" left="8" font="SansSerifSmall" follows="left|top" height="45" max_length="1100" control_name="AutoresponseMutedMessage" name="AutoresponseMutedMessage" width="480" word_wrap="true" spell_check="true" hide_scrollbar="true"/>
<drop_target bottom_delta="-124" left="8" height="17" width="480" control_name="AutoresponseMutedItemID" name="AutoresponseMutedItemID" tool_tip="Drop an item here to have it sent with the above response."/>
<text bottom_delta="88" left="8" follows="left|top" name="BusyModeResponseText" tool_tip="Send the message in the box below to people who message when you are busy.">Busy Mode Response:</text>