diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 139c12e7e..946c36ac6 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -334,7 +334,15 @@ void LLAvatarNameCache::processName(const LLUUID& agent_id, { if (add_to_cache) { - sCache[agent_id] = av_name; + // sCache[agent_id] = av_name; + // [SL:KB] - Patch: Agent-DisplayNames | Checked: 2010-12-28 (Catznip-2.4.0h) | Added: Catznip-2.4.0h + // Don't replace existing entries with dummies + cache_t::iterator itName = (av_name.mIsDummy) ? sCache.find(agent_id) : sCache.end(); + if (sCache.end() != itName) + itName->second.mExpires = av_name.mExpires; + else + sCache[agent_id] = av_name; + // [/SL:KB] } sPendingQueue.erase(agent_id); @@ -592,14 +600,14 @@ void LLAvatarNameCache::buildLegacyName(const std::string& full_name, av_name->mIsDummy = true; av_name->mExpires = F64_MAX; - // [Ansariel] + // [Ansariel/Henri] // Why ain't those set? In case of disabled display names // we would have to parse LLAvatarName::mDisplayName to get // first and lastname if we need them. So do it already here // for convenience. std::istringstream fname(full_name); fname >> av_name->mLegacyFirstName >> av_name->mLegacyLastName; - // [/Ansariel] + // [/Ansariel/Henri] } // fills in av_name if it has it in the cache, even if expired (can check expiry time) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1ddb86ec2..a4f8aac4a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -33,17 +33,6 @@ 1 - OptionShowGroupNameInChatIM - - Comment - Show group name in IM notification - Persist - 1 - Type - Boolean - Value - 1 - BeauchampUseInventoryLinks Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2455b7d34..bee332b98 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -316,7 +316,7 @@ static BOOL gDoDisconnect = FALSE; static std::string gLaunchFileOnQuit; // Used on Win32 for other apps to identify our window (eg, win_setup) -const char* const VIEWER_WINDOW_CLASSNAME = "SingularityViewer"; +const char* const VIEWER_WINDOW_CLASSNAME = "Second Life"; // Don't change //---------------------------------------------------------------------------- // File scope definitons diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 45372cd93..98aaea820 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -745,6 +745,12 @@ void LLAvatarTracker::processTerminateFriendship(LLMessageSystem* msg, void**) } } +void LLAvatarTracker::updateFriends() +{ + mModifyMask |= LLFriendObserver::ADD | LLFriendObserver::REMOVE; + notifyObservers(); +} + ///---------------------------------------------------------------------------- /// Tracking Data ///---------------------------------------------------------------------------- diff --git a/indra/newview/llcallingcard.h b/indra/newview/llcallingcard.h index 85a1ab6e1..a0f9d4a28 100644 --- a/indra/newview/llcallingcard.h +++ b/indra/newview/llcallingcard.h @@ -153,6 +153,8 @@ public: static void formFriendship(const LLUUID& friend_id); + void updateFriends(); + protected: void deleteTrackingData(); void agentFound(const LLUUID& prey, diff --git a/indra/newview/llfloaterdisplayname.cpp b/indra/newview/llfloaterdisplayname.cpp index 05974b21d..25d103c61 100644 --- a/indra/newview/llfloaterdisplayname.cpp +++ b/indra/newview/llfloaterdisplayname.cpp @@ -106,9 +106,24 @@ void LLFloaterDisplayName::onOpen() // display as "July 18 12:17 PM" // std::string next_update_string = // next_update_local.toHTTPDateString("%B %d %I:%M %p"); - std::string next_update_string = next_update_local.asString(); - getChild("lockout_text")->setTextArg("[TIME]", next_update_string); + std::string year = next_update_local.asString().substr(0,4); + std::string month = next_update_local.asString().substr(5,2); + std::string day = next_update_local.asString().substr(8,2); + std::string hour = next_update_local.asString().substr(11,2); + std::string minute = next_update_local.asString().substr(14,2); + std::string second = next_update_local.asString().substr(17,2); + std::string next_update_string_date = + llformat("%s/%s/%s",year.c_str(),month.c_str(), + day.c_str()); + std::string next_update_string_time = + llformat("%s:%s:%s",hour.c_str(),minute.c_str(), + second.c_str()); + getChild("lockout_text")->setTextArg("[DATE]", + next_update_string_date); + getChild("lockout_text")->setTextArg("[TIME]", + next_update_string_time); getChild("lockout_text")->setVisible(true); + getChild("no_lockout_text")->setVisible(false); getChild("save_btn")->setEnabled(false); getChild("display_name_editor")->setEnabled(false); getChild("display_name_confirm")->setEnabled(false); @@ -118,6 +133,7 @@ void LLFloaterDisplayName::onOpen() else { getChild("lockout_text")->setVisible(false); + getChild("no_lockout_text")->setVisible(true); getChild("save_btn")->setEnabled(true); getChild("display_name_editor")->setEnabled(true); getChild("display_name_confirm")->setEnabled(true); @@ -230,3 +246,4 @@ void LLFloaterDisplayName::onSave(void* data) self->setVisible(false); } + diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index 21014021a..6c9b8cee3 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -43,6 +43,12 @@ #include "llagent.h" #include "llappviewer.h" // for gLastVersionChannel + +// [Ansariel: Display name support] +#include "llavatarname.h" +#include "llavatarnamecache.h" +// [/Ansariel: Display name support] + #include "llfloateravatarpicker.h" #include "llviewerwindow.h" #include "llbutton.h" @@ -418,7 +424,25 @@ BOOL LLPanelFriends::addFriend(const LLUUID& agent_id) bool isOnline = relationInfo->isOnline(); std::string fullname; - BOOL have_name = gCacheName->getFullName(agent_id, fullname); + // [Ansariel: Display name support] + //BOOL have_name = gCacheName->getFullName(agent_id, fullname); + LLAvatarName avatar_name; + BOOL have_name; + if (LLAvatarNameCache::get(agent_id, &avatar_name)) + { + static LLCachedControl phoenix_name_system("PhoenixNameSystem", 0); + switch (phoenix_name_system) + { + case 0 : fullname = avatar_name.getLegacyName(); break; + case 1 : fullname = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break; + case 2 : fullname = avatar_name.mDisplayName; break; + default : fullname = avatar_name.getCompleteName(); break; + } + + have_name = TRUE; + } + else have_name = FALSE; + // [/Ansariel: Display name support] LLSD element; element["id"] = agent_id; @@ -499,9 +523,27 @@ BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationsh bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(itemp->getUUID()); bool isOnline = info->isOnline(); - std::string fullname; - BOOL have_name = gCacheName->getFullName(agent_id, fullname); - + std::string fullname; + // [Ansariel: Display name support] + //BOOL have_name = gCacheName->getFullName(agent_id, fullname); + LLAvatarName avatar_name; + BOOL have_name; + if (LLAvatarNameCache::get(agent_id, &avatar_name)) + { + static LLCachedControl phoenix_name_system("PhoenixNameSystem", 0); + switch (phoenix_name_system) + { + case 0 : fullname = avatar_name.getLegacyName(); break; + case 1 : fullname = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break; + case 2 : fullname = avatar_name.mDisplayName; break; + default : fullname = avatar_name.getCompleteName(); break; + } + + have_name = TRUE; + } + else have_name = FALSE; + // [/Ansariel: Display name support] + // Name of the status icon to use std::string statusIcon; @@ -861,12 +903,20 @@ void LLPanelFriends::onClickIM(void* user_data) { LLUUID agent_id = ids[0]; const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(agent_id); - std::string fullname; - if(info && gCacheName->getFullName(agent_id, fullname)) + // [Ansariel: Display name support] + //std::string fullname; + //if(info && gCacheName->getFullName(agent_id, fullname)) + //{ + // gIMMgr->setFloaterOpen(TRUE); + // gIMMgr->addSession(fullname, IM_NOTHING_SPECIAL, agent_id); + //} + LLAvatarName avatar_name; + if (info && LLAvatarNameCache::get(agent_id, &avatar_name)) { gIMMgr->setFloaterOpen(TRUE); - gIMMgr->addSession(fullname, IM_NOTHING_SPECIAL, agent_id); - } + gIMMgr->addSession(avatar_name.getLegacyName(),IM_NOTHING_SPECIAL,agent_id); + } + // [/Ansariel: Display name support] } else { @@ -983,12 +1033,30 @@ void LLPanelFriends::onClickRemove(void* user_data) if(ids.size() == 1) { LLUUID agent_id = ids[0]; - std::string first, last; - if(gCacheName->getName(agent_id, first, last)) + // [Ansariel: Display name support] + //std::string first, last; + //if(gCacheName->getName(agent_id, first, last)) + //{ + // args["FIRST_NAME"] = first; + // args["LAST_NAME"] = last; + //} + + LLAvatarName avatar_name; + if (LLAvatarNameCache::get(agent_id, &avatar_name)) { - args["FIRST_NAME"] = first; - args["LAST_NAME"] = last; + std::string fullname; + static LLCachedControl phoenix_name_system("PhoenixNameSystem", 0); + switch (phoenix_name_system) + { + case 0 : fullname = avatar_name.getLegacyName(); break; + case 1 : fullname = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break; + case 2 : fullname = avatar_name.mDisplayName; break; + default : fullname = avatar_name.getCompleteName(); break; + } + + args["NAME"] = fullname; } + // [/Ansariel: Display name support] } else { @@ -1224,12 +1292,29 @@ void LLPanelFriends::confirmModifyRights(rights_map_t& ids, EGrantRevoke command if(ids.size() == 1) { LLUUID agent_id = ids.begin()->first; - std::string first, last; - if(gCacheName->getName(agent_id, first, last)) + //std::string first, last; + //if(gCacheName->getName(agent_id, first, last)) + //{ + // args["FIRST_NAME"] = first; + // args["LAST_NAME"] = last; + //} + + LLAvatarName avatar_name; + if (LLAvatarNameCache::get(agent_id, &avatar_name)) { - args["FIRST_NAME"] = first; - args["LAST_NAME"] = last; + std::string fullname; + static LLCachedControl phoenix_name_system("PhoenixNameSystem", 0); + switch (phoenix_name_system) + { + case 0 : fullname = avatar_name.getLegacyName(); break; + case 1 : fullname = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break; + case 2 : fullname = avatar_name.mDisplayName; break; + default : fullname = avatar_name.getCompleteName(); break; + } + + args["NAME"] = fullname; } + if (command == GRANT) { LLNotifications::instance().add("GrantModifyRights", diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 22ff00ae3..ee086ac1a 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -1618,13 +1618,42 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4 } else { + std::string show_name = name; + LLAvatarName avatar_name; + if ((LLUUID::null != source) && + LLAvatarNameCache::get(source, &avatar_name)) + { + static LLCachedControl phoenix_name_system("PhoenixNameSystem", 0); + switch (phoenix_name_system) + { + case 0 : show_name = avatar_name.getCompleteName(); break; + case 1 : show_name = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break; + case 2 : show_name = avatar_name.mDisplayName; break; + default : show_name = avatar_name.getCompleteName(); break; + } + } // Convert the name to a hotlink and add to message. const LLStyleSP &source_style = LLStyleMap::instance().lookupAgent(source); - mHistoryEditor->appendStyledText(name,false,prepend_newline,source_style); + mHistoryEditor->appendStyledText(show_name,false,prepend_newline,source_style); } prepend_newline = false; } - mHistoryEditor->appendColoredText(utf8msg, false, prepend_newline, color); + + //Kadah - Bold group mods chat. Doesnt work on the first msg of the session, dont have speakers list yet? + if (isModerator(source)) + { + mHistoryEditor->appendColoredText(utf8msg.substr(0,1), false, prepend_newline, color); + LLStyleSP style(new LLStyle); + style->setVisible(true); + style->setColor(color); + style->setFontName(LLStringUtil::null); + style->mBold = TRUE; + mHistoryEditor->appendStyledText(utf8msg.substr(1), false, prepend_newline, style); + } + else + { + mHistoryEditor->appendColoredText(utf8msg, false, prepend_newline, color); + } if (log_to_file && gSavedPerAccountSettings.getBOOL("LogInstantMessages") ) @@ -2522,3 +2551,14 @@ bool LLFloaterIMPanel::onConfirmForceCloseError(const LLSD& notification, const } +//Kadah +const bool LLFloaterIMPanel::isModerator(const LLUUID& speaker_id) +{ + if (mSpeakers) + { + LLPointer speakerp = mSpeakers->findSpeaker(speaker_id); + return speakerp && speakerp->mIsModerator; + } + return FALSE; +} + diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index 1fcbcb44a..c839a2ca2 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -304,6 +304,8 @@ private: void removeTypingIndicator(const LLIMInfo* im_info); void sendTypingState(BOOL typing); + + const bool isModerator(const LLUUID& speaker_id); private: LLLineEditor* mInputEditor; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4f30831fd..f5ec001a9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -201,7 +201,9 @@ struct LLWearInfo }; -BOOL gAddToOutfit = FALSE; +// [RLVa:KB] - Made this part of LLWearableHoldingPattern +//BOOL gAddToOutfit = FALSE; +// [/RLVa:KB] // +=================================================+ // | LLInvFVBridge | @@ -1616,8 +1618,8 @@ BOOL LLFolderBridge::isUpToDate() const } // trying to make it stop trying to fetch Local Inventory - //return category->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN; - return (category->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN) || (mUUID == gSystemFolderRoot) || (gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot)); + return category->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN; + //return (category->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN) || (mUUID == gSystemFolderRoot) || (gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot)); // } @@ -3203,13 +3205,13 @@ void open_texture(const LLUUID& item_id, const LLUUID& source_id, BOOL take_focus) { - - - - - - - +// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a + if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE)) + { + RlvNotifications::notifyBlockedViewTexture(); + return; + } +// [/RLVa:KB] // See if we can bring an exiting preview to the front if( !LLPreview::show( item_id, take_focus ) ) @@ -3419,14 +3421,6 @@ void open_landmark(LLViewerInventoryItem* inv_item, const LLUUID& source_id, BOOL take_focus) { -// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a - if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE)) - { - RlvNotifications::notifyBlockedViewTexture(); - return; - } -// [/RLVa:KB] - // See if we can bring an exiting preview to the front if( !LLPreview::show( inv_item->getUUID(), take_focus ) ) { @@ -4116,8 +4110,8 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model } else if ("edit" == action) { - //if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) - // return; + if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) + return; LLVOAvatar* avatarp = gAgent.getAvatarObject(); if (!avatarp) return; @@ -5037,7 +5031,10 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) // [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0z) | Modified: RLVa-1.2.0b // Filter out any new attachments that can't be worn before adding them if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) ) - obj_items_new.erase(std::remove_if(obj_items_new.begin(), obj_items_new.end(), RlvPredCanNotWearItem(RLV_WEAR_REPLACE)), obj_items_new.end()); + obj_items_new.erase(std::remove_if(obj_items_new.begin(), obj_items_new.end(), + RlvPredCanNotWearItem(RLV_WEAR_ADD)), obj_items_new.end()); + for (S32 idxObjNew = 0; idxObjNew < obj_items_new.count(); idxObjNew++) + RlvAttachmentLockWatchdog::instance().onWearAttachment(obj_items_new.get(idxObjNew).get() , RLV_WEAR_ADD); obj_items.insert(obj_items.end(), obj_items_new.begin(), obj_items_new.end()); // [/RLVa:KB] @@ -5118,7 +5115,7 @@ void wear_inventory_category_on_avatar_step3(LLWearableHoldingPattern* holder, B if( wearable && ((S32)wearable->getType() == i) ) { LLViewerInventoryItem* item; - item = (LLViewerInventoryItem*)gInventory.getItem(data->mItemID); + item = (LLViewerInventoryItem*)gInventory.getLinkedItem(data->mItemID); if( item && (item->getAssetUUID() == wearable->getID()) ) { //RN: after discussing with Brashears, I disabled this code diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 6c797abf4..17e54be4d 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1640,7 +1640,8 @@ void LLInventoryModel::bulkFetch(std::string url) if (cat) { // Pre-emptive strike - if(!(gInventory.isObjectDescendentOf(cat->getUUID(), gSystemFolderRoot))) + //if(!(gInventory.isObjectDescendentOf(cat->getUUID(), gSystemFolderRoot))) + if(true) { // if ( LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion()) @@ -3858,11 +3859,9 @@ bool LLInventoryCollectFunctor::itemTransferCommonlyAllowed(LLInventoryItem* ite switch(item->getType()) { - // I don't even think changing this did anything - //case LLAssetType::AT_CALLINGCARD: - // // not allowed - // break; - // + case LLAssetType::AT_CALLINGCARD: + // not allowed + break; case LLAssetType::AT_OBJECT: my_avatar = gAgent.getAvatarObject(); diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 52f4c0a17..be9431e69 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -1203,12 +1203,12 @@ void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**) // static void LLPanelAvatarPicks::onClickNew(void* data) { - - - - - - +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + return; + } +// [/RLVa:KB] LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data; LLPanelPick* panel_pick = new LLPanelPick(FALSE); LLTabContainer* tabs = self->getChild("picks tab"); @@ -1224,12 +1224,6 @@ void LLPanelAvatarPicks::onClickNew(void* data) //Pick import and export - RK void LLPanelAvatarPicks::onClickImport(void* data) { -// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) - { - return; - } -// [/RLVa:KB] LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data; LLPanelPick* panel_pick = new LLPanelPick(FALSE); LLTabContainer* tabs = self->getChild("picks tab"); diff --git a/indra/newview/llpanelgeneral.cpp b/indra/newview/llpanelgeneral.cpp index 67d6f2ef1..24e1c03f8 100644 --- a/indra/newview/llpanelgeneral.cpp +++ b/indra/newview/llpanelgeneral.cpp @@ -46,6 +46,7 @@ #include "llviewerregion.h" #include "llavatarnamecache.h" #include "llvoavatar.h" +#include "llcallingcard.h" LLPanelGeneral::LLPanelGeneral() { @@ -128,7 +129,9 @@ void LLPanelGeneral::apply() if(gAgent.getRegion()){ if(namesystem_combobox->getCurrentIndex()<=0 || namesystem_combobox->getCurrentIndex()>2) LLAvatarNameCache::setUseDisplayNames(false); else LLAvatarNameCache::setUseDisplayNames(true); - //LLVOAvatar::invalidateNameTags(); No need, they'll be updated on the next loop + LLVOAvatar::invalidateNameTags(); // Remove all clienttags to get them updated + + LLAvatarTracker::instance().updateFriends(); } } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a241f422e..eae3c8d70 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1698,7 +1698,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) to_id.isNull() ) do_auto_response = false; - if( do_auto_response ) +// if( do_auto_response ) +// [RLVa:KB] - Alternate: Phoenix-370 + // Phoenix specific: auto-response should be blocked if the avie is RLV @sendim=n restricted and the recipient is not an exception + if ( (do_auto_response) && ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) || (gRlvHandler.isException(RLV_BHVR_SENDIM, from_id)) ) ) +// [/RLVa:KB] { if((dialog == IM_NOTHING_SPECIAL && !is_auto_response) || (dialog == IM_TYPING_START && gSavedPerAccountSettings.getBOOL("AscentInstantMessageAnnounceIncoming")) @@ -2371,7 +2375,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) position, true); - chat.mText = std::string("IM: ") + name + separator_string + saved + message.substr(message_offset); + if (gAgent.isInGroup(session_id)&& gSavedSettings.getBOOL("OptionShowGroupNameInChatIM")) + { + prepend_msg = "["; + prepend_msg += std::string((char*)binary_bucket); + prepend_msg += "] "; + } + else + { + prepend_msg = std::string("IM: "); + } + chat.mText = prepend_msg + name + separator_string + saved + message.substr(message_offset); LLFloaterChat::addChat(chat, TRUE, is_this_agent); } break; @@ -2462,11 +2476,22 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_LURE_USER: { - if (is_muted) +// [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Added: RLVa-1.2.2c + // If the lure sender is a specific @accepttp exception they will override muted and busy status + bool fRlvSummon = (rlv_handler_t::isEnabled()) && (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, from_id)); +// [/RLVa:KB] + +// if (is_muted) +// [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Added: RLVa-1.2.2c + if ( (is_muted) && (!fRlvSummon) ) +// [/RLVa:KB] { return; } - else if (is_busy) +// else if (is_busy) +// [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Added: RLVa-1.2.2c + else if ( (is_busy) && (!fRlvSummon) ) +// [/RLVa:KB] { busy_message(msg,from_id); } @@ -2475,12 +2500,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.1.3a) | Modified: RLVa-1.0.0d if (rlv_handler_t::isEnabled()) { - // Block if: 1) @tplure=n restricted (and sender isn't an exception), or 2) @unsit=n restricted and currently sitting - LLVOAvatar* pAvatar = gAgent.getAvatarObject(); - if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) && (!gRlvHandler.isException(RLV_BHVR_TPLURE, from_id)) ) || - ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (pAvatar) && (pAvatar->mIsSitting) ) ) + if (!gRlvHandler.canTeleportViaLure(from_id)) { RlvUtil::sendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_TPLURE_REMOTE)); + if (is_busy) + busy_message(msg,from_id); return; } @@ -3078,7 +3102,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) { if (CHAT_SOURCE_AGENT == chat.mSourceType) { - chat.mFromName = RlvStrings::getAnonym(from_name); + chat.mFromName = from_name = RlvStrings::getAnonym(from_name); chat.mRlvNamesFiltered = TRUE; } else if ( (!is_owned_by_me) || (!is_attachment) ) diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index e12504cdc..fb3683764 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -77,11 +77,14 @@ LLVLComposition::LLVLComposition(LLSurface *surfacep, const U32 width, const F32 setDetailTextureID(2, TERRAIN_MOUNTAIN_DETAIL); setDetailTextureID(3, TERRAIN_ROCK_DETAIL); + static const LLCachedControl terrain_color_start_height("TerrainColorStartHeight", 20.f); + static const LLCachedControl terrain_color_height_range("TerrainColorHeightRange", 60.f); + // Initialize the texture matrix to defaults. for (S32 i = 0; i < CORNER_COUNT; ++i) { - mStartHeight[i] = gSavedSettings.getF32("TerrainColorStartHeight"); - mHeightRange[i] = gSavedSettings.getF32("TerrainColorHeightRange"); + mStartHeight[i] = terrain_color_start_height; + mHeightRange[i] = terrain_color_height_range; } mTexScaleX = 16.f; mTexScaleY = 16.f; diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index 88d1ab5a7..32e2e7f37 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -17,6 +17,7 @@ #include "llviewerprecompiledheaders.h" #include "llagent.h" #include "llappviewer.h" +#include "llavatarnamecache.h" #include "lluictrlfactory.h" #include "llversionviewer.h" #include "llviewermenu.h" @@ -117,9 +118,6 @@ void RlvSettings::initClass() if (gSavedSettings.controlExists(RLV_SETTING_SHOWNAMETAGS)) gSavedSettings.getControl(RLV_SETTING_SHOWNAMETAGS)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _1, &fShowNameTags)); - if (gSavedSettings.controlExists(RLV_SETTING_AVATAROFFSET_Z)) - gSavedSettings.getControl(RLV_SETTING_AVATAROFFSET_Z)->getSignal()->connect(boost::bind(&onChangedAvatarOffset, _1)); - fInitialized = true; } } @@ -140,13 +138,6 @@ void RlvSettings::initClass() } #endif // RLV_EXTENSION_STARTLOCATION -// Checked: 2010-10-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0e -bool RlvSettings::onChangedAvatarOffset(const LLSD& sdValue) -{ - gAgent.sendAgentSetAppearance(); - return true; -} - // Checked: 2009-12-18 (RLVa-1.1.0k) | Added: RLVa-1.1.0i bool RlvSettings::onChangedSettingBOOL(const LLSD& newvalue, BOOL* pfSetting) { @@ -239,9 +230,7 @@ const std::string& RlvStrings::getAnonym(const std::string& strName) // Test with 11,264 SL names showed a 3.33% - 3.82% occurance for each so we *should* get a very even spread for (int idx = 0, cnt = strName.length(); idx < cnt; idx++) nHash += pszName[idx]; - - static const std::string empty = ""; - if (m_Anonyms.size() == 0) return empty; + return m_Anonyms[nHash % m_Anonyms.size()]; } @@ -363,18 +352,38 @@ void RlvUtil::filterLocation(std::string& strUTF8Text) rlvStringReplace(strUTF8Text, pParcelMgr->getAgentParcelName(), RlvStrings::getString(RLV_STRING_HIDDEN_PARCEL)); } -// Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f -void RlvUtil::filterNames(std::string& strUTF8Text) +// Checked: 2010-12-08 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c +void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy) { std::vector idAgents; LLWorld::getInstance()->getAvatars(&idAgents, NULL); - std::string strFullName; for (int idxAgent = 0, cntAgent = idAgents.size(); idxAgent < cntAgent; idxAgent++) { - // LLCacheName::getFullName() will add the UUID to the lookup queue if we don't know it yet - if (gCacheName->getFullName(idAgents[idxAgent], strFullName)) - rlvStringReplace(strUTF8Text, strFullName, RlvStrings::getAnonym(strFullName)); + LLAvatarName avName; + if (LLAvatarNameCache::get(idAgents[idxAgent], &avName)) + { + const std::string& strAnonym = RlvStrings::getAnonym(avName.mDisplayName); + + // NOTE: if the legacy first and last name are empty we get a legacy name of " " which would replace all spaces in the string + std::string strLegacyName; + if ( (fFilterLegacy) && (!avName.mIsDisplayNameDefault) && (!avName.mLegacyFirstName.empty()) ) + strLegacyName = avName.getLegacyName(); + + // If the display name is a subset of the legacy name we need to filter that first, otherwise it's the other way around + if (std::string::npos != strLegacyName.find(avName.mDisplayName)) + { + if (!strLegacyName.empty()) + rlvStringReplace(strUTF8Text, strLegacyName, strAnonym); + rlvStringReplace(strUTF8Text, avName.mDisplayName, strAnonym); + } + else + { + rlvStringReplace(strUTF8Text, avName.mDisplayName, strAnonym); + if (!strLegacyName.empty()) + rlvStringReplace(strUTF8Text, strLegacyName, strAnonym); + } + } } } diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index 2712b765a..e5f7fc3b8 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -67,10 +67,6 @@ inline BOOL rlvGetPerUserSettingsBOOL(const std::string& strSetting, BOOL fDefau { return (gSavedPerAccountSettings.controlExists(strSetting)) ? gSavedPerAccountSettings.getBOOL(strSetting) : fDefault; } -inline BOOL rlvGetSettingF32(const std::string& strSetting, F32 nDefault) -{ - return (gSavedSettings.controlExists(strSetting)) ? gSavedSettings.getF32(strSetting) : nDefault; -} inline std::string rlvGetSettingString(const std::string& strSetting, const std::string& strDefault) { return (gSavedSettings.controlExists(strSetting)) ? gSavedSettings.getString(strSetting) : strDefault; @@ -79,7 +75,6 @@ inline std::string rlvGetSettingString(const std::string& strSetting, const std: class RlvSettings { public: - static F32 getAvatarOffsetZ() { return rlvGetSettingF32(RLV_SETTING_AVATAROFFSET_Z, 0.0); } static BOOL getDebug() { return rlvGetSettingBOOL(RLV_SETTING_DEBUG, FALSE); } static BOOL getForbidGiveToRLV() { return rlvGetSettingBOOL(RLV_SETTING_FORBIDGIVETORLV, TRUE); } static BOOL getNoSetEnv() { return fNoSetEnv; } @@ -107,7 +102,6 @@ public: static void initClass(); protected: - static bool onChangedAvatarOffset(const LLSD& sdValue); static bool onChangedSettingBOOL(const LLSD& newvalue, BOOL* pfSetting); #ifdef RLV_EXPERIMENTAL_COMPOSITEFOLDERS @@ -153,14 +147,14 @@ class RlvUtil { public: static bool isEmote(const std::string& strUTF8Text); - static bool isNearbyAgent(const LLUUID& idAgent); // @shownames - static bool isNearbyRegion(const std::string& strRegion); // @showloc + static bool isNearbyAgent(const LLUUID& idAgent); // @shownames + static bool isNearbyRegion(const std::string& strRegion); // @showloc - static void filterLocation(std::string& strUTF8Text); // @showloc - static void filterNames(std::string& strUTF8Text); // @shownames + static void filterLocation(std::string& strUTF8Text); // @showloc + static void filterNames(std::string& strUTF8Text, bool fFilterLegacy = true); // @shownames static bool isForceTp() { return m_fForceTp; } - static void forceTp(const LLVector3d& posDest); // Ignores restrictions that might otherwise prevent tp'ing + static void forceTp(const LLVector3d& posDest); // Ignores restrictions that might otherwise prevent tp'ing static void notifyFailedAssertion(const std::string& strAssert, const std::string& strFile, int nLine); @@ -170,7 +164,7 @@ public: static bool sendChatReply(const std::string& strChannel, const std::string& strUTF8Text); protected: - static bool m_fForceTp; // @standtp + static bool m_fForceTp; // @standtp }; // ============================================================================ diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index bddb4ccfa..b840ff29a 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -57,6 +57,7 @@ // Experimental commands (not part of the RLV API spec, disabled on public releases) #ifdef RLV_EXPERIMENTAL_CMDS #define RLV_EXTENSION_CMD_ALLOWIDLE // Forces "Away" status when idle (effect is the same as setting AllowIdleAFK to TRUE) + #define RLV_EXTENSION_CMD_GETCOMMAND // @getcommand: