diff options
Diffstat (limited to 'linden/indra')
7 files changed, 220 insertions, 176 deletions
diff --git a/linden/indra/newview/app_settings/settings_per_account.xml b/linden/indra/newview/app_settings/settings_per_account.xml index e965fe6..1a748f8 100644 --- a/linden/indra/newview/app_settings/settings_per_account.xml +++ b/linden/indra/newview/app_settings/settings_per_account.xml | |||
@@ -461,6 +461,17 @@ | |||
461 | 461 | ||
462 | <!-- Begin IM auto-response --> | 462 | <!-- Begin IM auto-response --> |
463 | 463 | ||
464 | <key>InstantMessageResponseEnabled</key> | ||
465 | <map> | ||
466 | <key>Comment</key> | ||
467 | <string>Toggles whether to auto-respond to instant messages or not</string> | ||
468 | <key>Persist</key> | ||
469 | <integer>1</integer> | ||
470 | <key>Type</key> | ||
471 | <string>Boolean</string> | ||
472 | <key>Value</key> | ||
473 | <integer>0</integer> | ||
474 | </map> | ||
464 | <key>InstantMessageResponseFriends</key> | 475 | <key>InstantMessageResponseFriends</key> |
465 | <map> | 476 | <map> |
466 | <key>Comment</key> | 477 | <key>Comment</key> |
diff --git a/linden/indra/newview/floaterbusy.cpp b/linden/indra/newview/floaterbusy.cpp index 9188ae1..6c49461 100644 --- a/linden/indra/newview/floaterbusy.cpp +++ b/linden/indra/newview/floaterbusy.cpp | |||
@@ -158,6 +158,7 @@ BOOL FloaterBusy::postBuild() | |||
158 | LLWStringUtil::replaceChar(auto_response, '%', ' '); | 158 | LLWStringUtil::replaceChar(auto_response, '%', ' '); |
159 | childSetText("im_response", wstring_to_utf8str(auto_response)); | 159 | childSetText("im_response", wstring_to_utf8str(auto_response)); |
160 | 160 | ||
161 | childSetValue("InstantMessageResponseEnabled", gSavedPerAccountSettings.getBOOL("InstantMessageResponseEnabled")); | ||
161 | childSetValue("InstantMessageResponseFriends", gSavedPerAccountSettings.getBOOL("InstantMessageResponseFriends")); | 162 | childSetValue("InstantMessageResponseFriends", gSavedPerAccountSettings.getBOOL("InstantMessageResponseFriends")); |
162 | childSetValue("InstantMessageResponseMuted", gSavedPerAccountSettings.getBOOL("InstantMessageResponseMuted")); | 163 | childSetValue("InstantMessageResponseMuted", gSavedPerAccountSettings.getBOOL("InstantMessageResponseMuted")); |
163 | childSetValue("InstantMessageResponseAnyone", gSavedPerAccountSettings.getBOOL("InstantMessageResponseAnyone")); | 164 | childSetValue("InstantMessageResponseAnyone", gSavedPerAccountSettings.getBOOL("InstantMessageResponseAnyone")); |
@@ -212,6 +213,7 @@ void FloaterBusy::apply() | |||
212 | LLWStringUtil::replaceChar(im_response, '\n', '^'); | 213 | LLWStringUtil::replaceChar(im_response, '\n', '^'); |
213 | LLWStringUtil::replaceChar(im_response, ' ', '%'); | 214 | LLWStringUtil::replaceChar(im_response, ' ', '%'); |
214 | gSavedPerAccountSettings.setString("InstantMessageResponse", std::string(wstring_to_utf8str(im_response))); | 215 | gSavedPerAccountSettings.setString("InstantMessageResponse", std::string(wstring_to_utf8str(im_response))); |
216 | gSavedPerAccountSettings.setBOOL("InstantMessageResponseEnabled", childGetValue("InstantMessageResponseEnabled").asBoolean()); | ||
215 | gSavedPerAccountSettings.setBOOL("InstantMessageResponseMuted", childGetValue("InstantMessageResponseMuted").asBoolean()); | 217 | gSavedPerAccountSettings.setBOOL("InstantMessageResponseMuted", childGetValue("InstantMessageResponseMuted").asBoolean()); |
216 | gSavedPerAccountSettings.setBOOL("InstantMessageResponseFriends", childGetValue("InstantMessageResponseFriends").asBoolean()); | 218 | gSavedPerAccountSettings.setBOOL("InstantMessageResponseFriends", childGetValue("InstantMessageResponseFriends").asBoolean()); |
217 | gSavedPerAccountSettings.setBOOL("InstantMessageResponseMuted", childGetValue("InstantMessageResponseMuted").asBoolean()); | 219 | gSavedPerAccountSettings.setBOOL("InstantMessageResponseMuted", childGetValue("InstantMessageResponseMuted").asBoolean()); |
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index fb69389..9e2cc3d 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -5443,6 +5443,24 @@ class LLWorldSetBusy : public view_listener_t | |||
5443 | } | 5443 | } |
5444 | }; | 5444 | }; |
5445 | 5445 | ||
5446 | class LLWorldToggleAutoResponse: public view_listener_t | ||
5447 | { | ||
5448 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5449 | { | ||
5450 | gSavedPerAccountSettings.setBOOL("InstantMessageResponseEnabled", !gSavedPerAccountSettings.getBOOL("InstantMessageResponseEnabled")); | ||
5451 | return true; | ||
5452 | } | ||
5453 | |||
5454 | }; | ||
5455 | |||
5456 | class LLWorldCheckAutoResponse: public view_listener_t | ||
5457 | { | ||
5458 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5459 | { | ||
5460 | gMenuHolder->findControl(userdata["control"].asString())->setValue(gSavedPerAccountSettings.getBOOL("InstantMessageResponseEnabled")); | ||
5461 | return true; | ||
5462 | } | ||
5463 | }; | ||
5446 | 5464 | ||
5447 | class LLWorldCreateLandmark : public view_listener_t | 5465 | class LLWorldCreateLandmark : public view_listener_t |
5448 | { | 5466 | { |
@@ -10947,6 +10965,8 @@ void initialize_menus() | |||
10947 | addMenu(new LLWorldTeleportHome(), "World.TeleportHome"); | 10965 | addMenu(new LLWorldTeleportHome(), "World.TeleportHome"); |
10948 | addMenu(new LLWorldSetAway(), "World.SetAway"); | 10966 | addMenu(new LLWorldSetAway(), "World.SetAway"); |
10949 | addMenu(new LLWorldSetBusy(), "World.SetBusy"); | 10967 | addMenu(new LLWorldSetBusy(), "World.SetBusy"); |
10968 | addMenu(new LLWorldToggleAutoResponse(), "World.ToggleAutoResponse"); | ||
10969 | addMenu(new LLWorldCheckAutoResponse(), "World.CheckAutoResponse"); | ||
10950 | 10970 | ||
10951 | addMenu(new LLWorldEnableCreateLandmark(), "World.EnableCreateLandmark"); | 10971 | addMenu(new LLWorldEnableCreateLandmark(), "World.EnableCreateLandmark"); |
10952 | addMenu(new LLWorldEnableSetHomeLocation(), "World.EnableSetHomeLocation"); | 10972 | addMenu(new LLWorldEnableSetHomeLocation(), "World.EnableSetHomeLocation"); |
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index ca7c613..b243e34 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp | |||
@@ -1566,195 +1566,198 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) | |||
1566 | } | 1566 | } |
1567 | } | 1567 | } |
1568 | }*/ | 1568 | }*/ |
1569 | bool typing_init = false; | 1569 | if (gSavedPerAccountSettings.getBOOL("InstantMessageResponseEnabled")) |
1570 | if( dialog == IM_TYPING_START && !is_muted ) | ||
1571 | { | 1570 | { |
1572 | if(!gIMMgr->hasSession(computed_session_id) && gSavedPerAccountSettings.getBOOL("InstantMessageAnnounceIncoming")) | 1571 | bool typing_init = false; |
1572 | if( dialog == IM_TYPING_START && !is_muted ) | ||
1573 | { | 1573 | { |
1574 | typing_init = true; | 1574 | if(!gIMMgr->hasSession(computed_session_id) && gSavedPerAccountSettings.getBOOL("InstantMessageAnnounceIncoming")) |
1575 | if( gSavedPerAccountSettings.getBOOL("InstantMessageAnnounceStealFocus") ) | ||
1576 | { | 1575 | { |
1577 | /*LLUUID sess =*/ gIMMgr->addSession(name, IM_NOTHING_SPECIAL, from_id); | 1576 | typing_init = true; |
1578 | make_ui_sound("UISndNewIncomingIMSession"); | 1577 | if( gSavedPerAccountSettings.getBOOL("InstantMessageAnnounceStealFocus") ) |
1578 | { | ||
1579 | /*LLUUID sess =*/ gIMMgr->addSession(name, IM_NOTHING_SPECIAL, from_id); | ||
1580 | make_ui_sound("UISndNewIncomingIMSession"); | ||
1581 | } | ||
1582 | gIMMgr->addMessage( | ||
1583 | computed_session_id, | ||
1584 | from_id, | ||
1585 | name, | ||
1586 | llformat("You sense a disturbance in the force... (%s is typing)",name.c_str()), | ||
1587 | name, | ||
1588 | IM_NOTHING_SPECIAL, | ||
1589 | parent_estate_id, | ||
1590 | region_id, | ||
1591 | position, | ||
1592 | false); | ||
1579 | } | 1593 | } |
1580 | gIMMgr->addMessage( | ||
1581 | computed_session_id, | ||
1582 | from_id, | ||
1583 | name, | ||
1584 | llformat("You sense a disturbance in the force... (%s is typing)",name.c_str()), | ||
1585 | name, | ||
1586 | IM_NOTHING_SPECIAL, | ||
1587 | parent_estate_id, | ||
1588 | region_id, | ||
1589 | position, | ||
1590 | false); | ||
1591 | } | 1594 | } |
1592 | } | ||
1593 | 1595 | ||
1594 | bool is_auto_response = false; | 1596 | bool is_auto_response = false; |
1595 | if(dialog == IM_NOTHING_SPECIAL) { | 1597 | if(dialog == IM_NOTHING_SPECIAL) { |
1596 | // detect auto responses from GreenLife and compatible viewers | 1598 | // detect auto responses from compatible viewers |
1597 | is_auto_response = ( message.substr(0, 21) == "/me (auto-response): " ); | 1599 | is_auto_response = ( message.substr(0, 21) == "/me (auto-response): " ); |
1598 | } | 1600 | } |
1599 | 1601 | ||
1600 | bool do_auto_response = false; | 1602 | bool do_auto_response = false; |
1601 | if( gSavedPerAccountSettings.getBOOL("InstantMessageResponseAnyone" ) ) | 1603 | if( gSavedPerAccountSettings.getBOOL("InstantMessageResponseAnyone" ) ) |
1602 | do_auto_response = true; | 1604 | do_auto_response = true; |
1603 | 1605 | ||
1604 | // odd name for auto respond to non-friends | 1606 | // odd name for auto respond to non-friends |
1605 | if( gSavedPerAccountSettings.getBOOL("InstantMessageResponseFriends") && | 1607 | if( gSavedPerAccountSettings.getBOOL("InstantMessageResponseFriends") && |
1606 | LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL ) | 1608 | LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL ) |
1607 | do_auto_response = true; | 1609 | do_auto_response = true; |
1608 | 1610 | ||
1609 | if( is_muted && !gSavedPerAccountSettings.getBOOL("InstantMessageResponseMuted") ) | 1611 | if( is_muted && !gSavedPerAccountSettings.getBOOL("InstantMessageResponseMuted") ) |
1610 | do_auto_response = false; | 1612 | do_auto_response = false; |
1611 | 1613 | ||
1612 | if( offline != IM_ONLINE ) | 1614 | if( offline != IM_ONLINE ) |
1613 | do_auto_response = false; | 1615 | do_auto_response = false; |
1614 | 1616 | ||
1615 | if( is_auto_response ) | 1617 | if( is_auto_response ) |
1616 | do_auto_response = false; | 1618 | do_auto_response = false; |
1617 | 1619 | ||
1618 | // handle cases where IM_NOTHING_SPECIAL is not an IM | 1620 | // handle cases where IM_NOTHING_SPECIAL is not an IM |
1619 | if( name == SYSTEM_FROM || | 1621 | if( name == SYSTEM_FROM || |
1620 | from_id.isNull() || | 1622 | from_id.isNull() || |
1621 | to_id.isNull() ) | 1623 | to_id.isNull() ) |
1622 | do_auto_response = false; | 1624 | do_auto_response = false; |
1623 | 1625 | ||
1624 | // if( do_auto_response ) | 1626 | // if( do_auto_response ) |
1625 | // [RLVa:KB] - Alternate: Emerald-370 | 1627 | // [RLVa:KB] - Alternate: Emerald-370 |
1626 | // Emerald specific: auto-response should be blocked if the avie is RLV @sendim=n restricted and the recipient is not an exception | 1628 | // Emerald specific: auto-response should be blocked if the avie is RLV @sendim=n restricted and the recipient is not an exception |
1627 | if ( (do_auto_response) && ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) || (gRlvHandler.isException(RLV_BHVR_SENDIM, from_id)) ) ) | 1629 | if ( (do_auto_response) && ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) || (gRlvHandler.isException(RLV_BHVR_SENDIM, from_id)) ) ) |
1628 | // [/RLVa:KB] | 1630 | // [/RLVa:KB] |
1629 | { | ||
1630 | if((dialog == IM_NOTHING_SPECIAL && !is_auto_response) || | ||
1631 | (dialog == IM_TYPING_START && gSavedPerAccountSettings.getBOOL("InstantMessageShowOnTyping")) | ||
1632 | ) | ||
1633 | { | 1631 | { |
1634 | BOOL has = gIMMgr->hasSession(computed_session_id); | 1632 | if((dialog == IM_NOTHING_SPECIAL && !is_auto_response) || |
1635 | if(!has || gSavedPerAccountSettings.getBOOL("InstantMessageResponseRepeat") || typing_init) | 1633 | (dialog == IM_TYPING_START && gSavedPerAccountSettings.getBOOL("InstantMessageShowOnTyping")) |
1634 | ) | ||
1636 | { | 1635 | { |
1637 | BOOL show = !gSavedPerAccountSettings.getBOOL("InstantMessageShowResponded"); | 1636 | BOOL has = gIMMgr->hasSession(computed_session_id); |
1638 | if(!has && show) | 1637 | if(!has || gSavedPerAccountSettings.getBOOL("InstantMessageResponseRepeat") || typing_init) |
1639 | { | ||
1640 | gIMMgr->addSession(name, IM_NOTHING_SPECIAL, from_id); | ||
1641 | } | ||
1642 | if(show) | ||
1643 | { | ||
1644 | gIMMgr->addMessage( | ||
1645 | computed_session_id, | ||
1646 | from_id, | ||
1647 | SYSTEM_FROM, | ||
1648 | llformat("Autoresponse sent to %s.",name.c_str()), | ||
1649 | LLStringUtil::null, | ||
1650 | IM_NOTHING_SPECIAL, | ||
1651 | parent_estate_id, | ||
1652 | region_id, | ||
1653 | position, | ||
1654 | false); | ||
1655 | } | ||
1656 | std::string my_name; | ||
1657 | gAgent.buildFullname(my_name); | ||
1658 | |||
1659 | //<-- Personalized Autoresponse by Madgeek | ||
1660 | std::string autoresponse = gSavedPerAccountSettings.getText("InstantMessageResponse"); | ||
1661 | //Define Wildcards | ||
1662 | std::string fname_wildcard = "#f"; | ||
1663 | std::string lname_wildcard = "#l"; | ||
1664 | std::string time_wildcard = "#t"; | ||
1665 | //Extract Name | ||
1666 | std::string f_name, l_name; | ||
1667 | std::istringstream inname(name); | ||
1668 | inname >> f_name >> l_name; | ||
1669 | //Generate a Timestamp | ||
1670 | time_t rawtime; | ||
1671 | time(&rawtime); | ||
1672 | char * timestamp_chars; | ||
1673 | timestamp_chars = asctime(localtime(&rawtime)); | ||
1674 | std::string timestamp; | ||
1675 | timestamp.assign(timestamp_chars); | ||
1676 | timestamp = timestamp.substr(0, timestamp.find('\n')); | ||
1677 | //Handle Replacements | ||
1678 | size_t found = autoresponse.find(fname_wildcard); | ||
1679 | while(found != std::string::npos) | ||
1680 | { | ||
1681 | autoresponse.replace(found, 2, f_name); | ||
1682 | found = autoresponse.find(fname_wildcard); | ||
1683 | } | ||
1684 | found = autoresponse.find(lname_wildcard); | ||
1685 | while(found != std::string::npos) | ||
1686 | { | 1638 | { |
1687 | autoresponse.replace(found, 2, l_name); | 1639 | BOOL show = !gSavedPerAccountSettings.getBOOL("InstantMessageShowResponded"); |
1640 | if(!has && show) | ||
1641 | { | ||
1642 | gIMMgr->addSession(name, IM_NOTHING_SPECIAL, from_id); | ||
1643 | } | ||
1644 | if(show) | ||
1645 | { | ||
1646 | gIMMgr->addMessage( | ||
1647 | computed_session_id, | ||
1648 | from_id, | ||
1649 | SYSTEM_FROM, | ||
1650 | llformat("Autoresponse sent to %s.",name.c_str()), | ||
1651 | LLStringUtil::null, | ||
1652 | IM_NOTHING_SPECIAL, | ||
1653 | parent_estate_id, | ||
1654 | region_id, | ||
1655 | position, | ||
1656 | false); | ||
1657 | } | ||
1658 | std::string my_name; | ||
1659 | gAgent.buildFullname(my_name); | ||
1660 | |||
1661 | //<-- Personalized Autoresponse by Madgeek | ||
1662 | std::string autoresponse = gSavedPerAccountSettings.getText("InstantMessageResponse"); | ||
1663 | //Define Wildcards | ||
1664 | std::string fname_wildcard = "#f"; | ||
1665 | std::string lname_wildcard = "#l"; | ||
1666 | std::string time_wildcard = "#t"; | ||
1667 | //Extract Name | ||
1668 | std::string f_name, l_name; | ||
1669 | std::istringstream inname(name); | ||
1670 | inname >> f_name >> l_name; | ||
1671 | //Generate a Timestamp | ||
1672 | time_t rawtime; | ||
1673 | time(&rawtime); | ||
1674 | char * timestamp_chars; | ||
1675 | timestamp_chars = asctime(localtime(&rawtime)); | ||
1676 | std::string timestamp; | ||
1677 | timestamp.assign(timestamp_chars); | ||
1678 | timestamp = timestamp.substr(0, timestamp.find('\n')); | ||
1679 | //Handle Replacements | ||
1680 | size_t found = autoresponse.find(fname_wildcard); | ||
1681 | while(found != std::string::npos) | ||
1682 | { | ||
1683 | autoresponse.replace(found, 2, f_name); | ||
1684 | found = autoresponse.find(fname_wildcard); | ||
1685 | } | ||
1688 | found = autoresponse.find(lname_wildcard); | 1686 | found = autoresponse.find(lname_wildcard); |
1689 | } | 1687 | while(found != std::string::npos) |
1690 | found = autoresponse.find(time_wildcard); | 1688 | { |
1691 | while(found != std::string::npos) | 1689 | autoresponse.replace(found, 2, l_name); |
1692 | { | 1690 | found = autoresponse.find(lname_wildcard); |
1693 | autoresponse.replace(found, 2, timestamp); | 1691 | } |
1694 | found = autoresponse.find(time_wildcard); | 1692 | found = autoresponse.find(time_wildcard); |
1695 | } | 1693 | while(found != std::string::npos) |
1696 | //--> Personalized Autoresponse | ||
1697 | |||
1698 | if(gSavedPerAccountSettings.getBOOL("InstantMessageResponseRepeat") && has && !typing_init) { | ||
1699 | // send as busy auto response instead to prevent endless repeating replies | ||
1700 | // when other end is a bot or broken client that answers to every usual IM | ||
1701 | // reasoning for this decision can be found in RFC2812 3.3.2 Notices | ||
1702 | // where PRIVMSG can be seen as IM_NOTHING_SPECIAL and NOTICE can be seen as | ||
1703 | // IM_BUSY_AUTO_RESPONSE. The assumption here is that no existing client | ||
1704 | // responds to IM_BUSY_AUTO_RESPONSE. --TS | ||
1705 | std::string response = autoresponse; | ||
1706 | pack_instant_message( | ||
1707 | gMessageSystem, | ||
1708 | gAgent.getID(), | ||
1709 | FALSE, | ||
1710 | gAgent.getSessionID(), | ||
1711 | from_id, | ||
1712 | my_name, | ||
1713 | response, | ||
1714 | IM_OFFLINE, | ||
1715 | IM_BUSY_AUTO_RESPONSE, | ||
1716 | session_id); | ||
1717 | } else { | ||
1718 | std::string response = "/me (auto-response): "+autoresponse; | ||
1719 | pack_instant_message( | ||
1720 | gMessageSystem, | ||
1721 | gAgent.getID(), | ||
1722 | FALSE, | ||
1723 | gAgent.getSessionID(), | ||
1724 | from_id, | ||
1725 | my_name, | ||
1726 | response, | ||
1727 | IM_OFFLINE, | ||
1728 | IM_NOTHING_SPECIAL, | ||
1729 | session_id); | ||
1730 | } | ||
1731 | gAgent.sendReliableMessage(); | ||
1732 | if(gSavedPerAccountSettings.getBOOL("InstantMessageResponseItem") && (!has || typing_init)) | ||
1733 | { | ||
1734 | LLUUID itemid = (LLUUID)gSavedPerAccountSettings.getString("InstantMessageResponseItemData"); | ||
1735 | LLViewerInventoryItem* item = gInventory.getItem(itemid); | ||
1736 | if(item) | ||
1737 | { | 1694 | { |
1738 | //childSetValue("im_give_disp_rect_txt","Currently set to: "+item->getName()); | 1695 | autoresponse.replace(found, 2, timestamp); |
1739 | if(show) | 1696 | found = autoresponse.find(time_wildcard); |
1697 | } | ||
1698 | //--> Personalized Autoresponse | ||
1699 | |||
1700 | if(gSavedPerAccountSettings.getBOOL("InstantMessageResponseRepeat") && has && !typing_init) { | ||
1701 | // send as busy auto response instead to prevent endless repeating replies | ||
1702 | // when other end is a bot or broken client that answers to every usual IM | ||
1703 | // reasoning for this decision can be found in RFC2812 3.3.2 Notices | ||
1704 | // where PRIVMSG can be seen as IM_NOTHING_SPECIAL and NOTICE can be seen as | ||
1705 | // IM_BUSY_AUTO_RESPONSE. The assumption here is that no existing client | ||
1706 | // responds to IM_BUSY_AUTO_RESPONSE. --TS | ||
1707 | std::string response = autoresponse; | ||
1708 | pack_instant_message( | ||
1709 | gMessageSystem, | ||
1710 | gAgent.getID(), | ||
1711 | FALSE, | ||
1712 | gAgent.getSessionID(), | ||
1713 | from_id, | ||
1714 | my_name, | ||
1715 | response, | ||
1716 | IM_OFFLINE, | ||
1717 | IM_BUSY_AUTO_RESPONSE, | ||
1718 | session_id); | ||
1719 | } else { | ||
1720 | std::string response = "/me (auto-response): "+autoresponse; | ||
1721 | pack_instant_message( | ||
1722 | gMessageSystem, | ||
1723 | gAgent.getID(), | ||
1724 | FALSE, | ||
1725 | gAgent.getSessionID(), | ||
1726 | from_id, | ||
1727 | my_name, | ||
1728 | response, | ||
1729 | IM_OFFLINE, | ||
1730 | IM_NOTHING_SPECIAL, | ||
1731 | session_id); | ||
1732 | } | ||
1733 | gAgent.sendReliableMessage(); | ||
1734 | if(gSavedPerAccountSettings.getBOOL("InstantMessageResponseItem") && (!has || typing_init)) | ||
1735 | { | ||
1736 | LLUUID itemid = (LLUUID)gSavedPerAccountSettings.getString("InstantMessageResponseItemData"); | ||
1737 | LLViewerInventoryItem* item = gInventory.getItem(itemid); | ||
1738 | if(item) | ||
1740 | { | 1739 | { |
1741 | gIMMgr->addMessage( | 1740 | //childSetValue("im_give_disp_rect_txt","Currently set to: "+item->getName()); |
1742 | computed_session_id, | 1741 | if(show) |
1743 | from_id, | 1742 | { |
1744 | SYSTEM_FROM, | 1743 | gIMMgr->addMessage( |
1745 | llformat("Sent %s auto-response item \"%s\"",name.c_str(),item->getName().c_str()), | 1744 | computed_session_id, |
1746 | LLStringUtil::null, | 1745 | from_id, |
1747 | IM_NOTHING_SPECIAL, | 1746 | SYSTEM_FROM, |
1748 | parent_estate_id, | 1747 | llformat("Sent %s auto-response item \"%s\"",name.c_str(),item->getName().c_str()), |
1749 | region_id, | 1748 | LLStringUtil::null, |
1750 | position, | 1749 | IM_NOTHING_SPECIAL, |
1751 | false); | 1750 | parent_estate_id, |
1751 | region_id, | ||
1752 | position, | ||
1753 | false); | ||
1754 | } | ||
1755 | LLToolDragAndDrop::giveInventory(from_id, item); | ||
1752 | } | 1756 | } |
1753 | LLToolDragAndDrop::giveInventory(from_id, item); | ||
1754 | } | 1757 | } |
1758 | //InstantMessageResponseItem< | ||
1759 | |||
1755 | } | 1760 | } |
1756 | //InstantMessageResponseItem< | ||
1757 | |||
1758 | } | 1761 | } |
1759 | } | 1762 | } |
1760 | } | 1763 | } |
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_busy.xml b/linden/indra/newview/skins/default/xui/en-us/floater_busy.xml index a9bd613..6d74882 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_busy.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_busy.xml | |||
@@ -1,11 +1,14 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> | 1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> |
2 | <floater name="busy" title="IM Response Options" | 2 | <floater name="busy" title="IM Response Options" |
3 | height="446" width="255" min_height="446" min_width="255" | 3 | height="476" width="265" min_height="476" min_width="265" |
4 | follows="top|right" can_close="true" can_drag_on_left="false" | 4 | follows="top|right" can_close="true" can_drag_on_left="false" |
5 | can_minimize="true" can_resize="false" can_tear_off="false"> | 5 | can_minimize="true" can_resize="false" can_tear_off="false"> |
6 | 6 | ||
7 | <check_box bottom="-40" enabled="true" follows="left|top" font="SansSerifSmall" height="16" | 7 | <check_box bottom="-40" enabled="true" follows="left|top" font="SansSerifSmall" height="16" |
8 | initial_value="false" label="Announce incoming instant messages" left="10" mouse_opaque="true" | 8 | initial_value="false" label="Auto-respond to incoming IMs" left="10" mouse_opaque="true" |
9 | name="InstantMessageResponseEnabled" radio_style="false" width="270"/> | ||
10 | <check_box bottom_delta="-30" enabled="true" follows="left|top" font="SansSerifSmall" height="16" | ||
11 | initial_value="false" label="Announce incoming IMs" left="10" mouse_opaque="true" | ||
9 | name="InstantMessageAnnounceIncoming" radio_style="false" width="270"/> | 12 | name="InstantMessageAnnounceIncoming" radio_style="false" width="270"/> |
10 | <check_box bottom_delta="-20" enabled="true" follows="left|top" font="SansSerifSmall" height="16" | 13 | <check_box bottom_delta="-20" enabled="true" follows="left|top" font="SansSerifSmall" height="16" |
11 | initial_value="false" label="Steal focus" left_delta="10" mouse_opaque="true" name="InstantMessageAnnounceStealFocus" | 14 | initial_value="false" label="Steal focus" left_delta="10" mouse_opaque="true" name="InstantMessageAnnounceStealFocus" |
@@ -58,7 +61,7 @@ | |||
58 | 61 | ||
59 | <text_editor type="string" length="1" bottom_delta="-85" embedded_items="false" enabled="true" | 62 | <text_editor type="string" length="1" bottom_delta="-85" embedded_items="false" enabled="true" |
60 | follows="left|top" font="SansSerifSmall" height="75" left_delta="-15" max_length="1100" | 63 | follows="left|top" font="SansSerifSmall" height="75" left_delta="-15" max_length="1100" |
61 | mouse_opaque="true" name="im_response" width="230" word_wrap="true"/> | 64 | mouse_opaque="true" name="im_response" width="245" word_wrap="true"/> |
62 | 65 | ||
63 | <check_box bottom_delta="-30" enabled="true" follows="left|top" font="SansSerifSmall" height="16" | 66 | <check_box bottom_delta="-30" enabled="true" follows="left|top" font="SansSerifSmall" height="16" |
64 | initial_value="false" label="Send an item along with the response" left_delta="0" | 67 | initial_value="false" label="Send an item along with the response" left_delta="0" |
@@ -66,28 +69,28 @@ | |||
66 | width="270"/> | 69 | width="270"/> |
67 | 70 | ||
68 | <view_border blevel_style="in" bottom_delta="-20" follows="left|top" height="16" left_delta="0" | 71 | <view_border blevel_style="in" bottom_delta="-20" follows="left|top" height="16" left_delta="0" |
69 | mouse_opaque="false" name="im_give_drop_target_rect" width="230"/> | 72 | mouse_opaque="false" name="im_give_drop_target_rect" width="245"/> |
70 | 73 | ||
71 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" bottom_delta="0" | 74 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" bottom_delta="0" |
72 | drop_shadow_visible="true" follows="left|top" font="SansSerifSmall" h_pad="0" halign="center" | 75 | drop_shadow_visible="true" follows="left|top" font="SansSerifSmall" h_pad="0" halign="center" |
73 | height="16" left_delta="0" mouse_opaque="true" name="Give inventory" tool_tip="Drop an inventory item here to have it given along with the auto-response." | 76 | height="16" left_delta="0" mouse_opaque="true" name="Give inventory" tool_tip="Drop an inventory item here to have it given along with the auto-response." |
74 | v_pad="2" width="230"> | 77 | v_pad="2" width="245"> |
75 | Drop an inventory item here | 78 | Drop an inventory item here |
76 | </text> | 79 | </text> |
77 | 80 | ||
78 | <view_border blevel_style="in" bottom_delta="-18" follows="left|top" height="16" left_delta="0" | 81 | <view_border blevel_style="in" bottom_delta="-18" follows="left|top" height="16" left_delta="0" |
79 | mouse_opaque="false" name="im_give_disp_rect" width="230"/> | 82 | mouse_opaque="false" name="im_give_disp_rect" width="245"/> |
80 | 83 | ||
81 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" bottom_delta="0" | 84 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" bottom_delta="0" |
82 | drop_shadow_visible="true" follows="left|top" font="SansSerifSmall" h_pad="0" halign="center" | 85 | drop_shadow_visible="true" follows="left|top" font="SansSerifSmall" h_pad="0" halign="center" |
83 | height="16" left_delta="0" mouse_opaque="true" name="im_give_disp_rect_txt" tool_tip="" | 86 | height="16" left_delta="0" mouse_opaque="true" name="im_give_disp_rect_txt" tool_tip="" |
84 | v_pad="2" width="230"> | 87 | v_pad="2" width="245"> |
85 | Currently set to: ITEM | 88 | Currently set to: ITEM |
86 | </text> | 89 | </text> |
87 | 90 | ||
88 | <button bottom_delta="-26" follows="top|right" height="22" label="Cancel" | 91 | <button bottom_delta="-26" follows="top|right" height="22" label="Cancel" |
89 | right="-10" name="btn_cancel" tool_tip="" enagled="true" width="80" /> | 92 | right="-4" name="btn_cancel" tool_tip="" enagled="true" width="80" /> |
90 | <button bottom_delta="0" follows="top|right" height="22" label="OK" | 93 | <button bottom_delta="0" follows="top|right" height="22" label="OK" |
91 | right="-90" name="btn_ok" tool_tip="" enabled="true" width="80" /> | 94 | right="-85" name="btn_ok" tool_tip="" enabled="true" width="80" /> |
92 | 95 | ||
93 | </floater> \ No newline at end of file | 96 | </floater> \ No newline at end of file |
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml index 8033ba7..836c4dd 100644 --- a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | |||
@@ -503,6 +503,11 @@ | |||
503 | <menu_item_call name="Set Busy" label="Set Busy"> | 503 | <menu_item_call name="Set Busy" label="Set Busy"> |
504 | <on_click function="World.SetBusy" userdata="" /> | 504 | <on_click function="World.SetBusy" userdata="" /> |
505 | </menu_item_call> | 505 | </menu_item_call> |
506 | <menu_item_check name="Auto-Respond to IMs" label="Auto-Respond to IMs"> | ||
507 | <on_click function="World.ToggleAutoResponse" userdata="" /> | ||
508 | <on_check function="World.CheckAutoResponse" userdata="" /> | ||
509 | </menu_item_check> | ||
510 | <menu_item_separator /> | ||
506 | <menu_item_call name="Stop Animating My Avatar" enabled="false" | 511 | <menu_item_call name="Stop Animating My Avatar" enabled="false" |
507 | label="Stop Animating My Avatar"> | 512 | label="Stop Animating My Avatar"> |
508 | <on_click function="Tools.StopAllAnimations" userdata="" /> | 513 | <on_click function="Tools.StopAllAnimations" userdata="" /> |
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml index 58845ad..0904815 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml | |||
@@ -63,7 +63,7 @@ | |||
63 | font="SansSerifSmall" height="70" left="148" max_length="255" | 63 | font="SansSerifSmall" height="70" left="148" max_length="255" |
64 | mouse_opaque="true" name="busy_response" width="330" word_wrap="true" /> | 64 | mouse_opaque="true" name="busy_response" width="330" word_wrap="true" /> |
65 | <button bottom_delta="-25" follows="top|right" height="22" label="IM Response Options" | 65 | <button bottom_delta="-25" follows="top|right" height="22" label="IM Response Options" |
66 | left="164" name="busy_adv_btn" tool_tip="Auto response options" | 66 | left="164" name="busy_adv_btn" tool_tip="Instant message Auto-Response options" |
67 | width="180" /> | 67 | width="180" /> |
68 | <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | 68 | <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
69 | bottom_delta="-23" drop_shadow_visible="true" enabled="true" follows="left|top" | 69 | bottom_delta="-23" drop_shadow_visible="true" enabled="true" follows="left|top" |