Feature Request: Add AutoresponseOnlyIfAway to send autoresponses only if in AFK or FakeAway modes

This commit is contained in:
Inusaito Sayori
2014-05-09 20:32:38 -04:00
parent 3898d29741
commit 009fb10927
2 changed files with 14 additions and 2 deletions

View File

@@ -406,6 +406,17 @@
<key>Value</key>
<string>This is an autoresponse!</string>
</map>
<key>AutoresponseOnlyIfAway</key>
<map>
<key>Comment</key>
<string>When true, enabled autoresponses (not busy responses) will only be sent while in away (or Fake Away) mode. Does not apply to autoresponses to muted persons, they don't need to know you're away.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>BusyModeResponse</key>
<map>
<key>Comment</key>

View File

@@ -2294,9 +2294,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
}
// These bools are here because they would make mess of logic down below in IM_NOTHING_SPECIAL.
bool is_autorespond = !is_muted && (is_friend || !gSavedPerAccountSettings.getBOOL("AutoresponseAnyoneFriendsOnly")) && gSavedPerAccountSettings.getBOOL("AutoresponseAnyone");
bool autorespond_status = gAgent.getAFK() || !gSavedPerAccountSettings.getBOOL("AutoresponseOnlyIfAway") || gSavedSettings.getBOOL("FakeAway");
bool is_autorespond = !is_muted && autorespond_status && (is_friend || !gSavedPerAccountSettings.getBOOL("AutoresponseAnyoneFriendsOnly")) && gSavedPerAccountSettings.getBOOL("AutoresponseAnyone");
bool is_autorespond_muted = is_muted && gSavedPerAccountSettings.getBOOL("AutoresponseMuted");
bool is_autorespond_nonfriends = !is_friend && !is_muted && gSavedPerAccountSettings.getBOOL("AutoresponseNonFriends");
bool is_autorespond_nonfriends = !is_friend && !is_muted && autorespond_status && gSavedPerAccountSettings.getBOOL("AutoresponseNonFriends");
LLSD args;
switch(dialog)