From 70616479b131d7ba02f84a6e893df79923670a8e Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Fri, 9 Sep 2011 00:08:31 +0200 Subject: [PATCH 1/6] - fixed : @recvchatfrom and @recvemotefrom don't mute the specified UUID as expected -> backported from RLVa-1.4.2 (see bcc524e9e6b7) --HG-- branch : RLVa --- indra/newview/llviewermessage.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index fbe7c9fa80..64d519892b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3482,18 +3482,18 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) ( (CHAT_SOURCE_OBJECT == chat.mSourceType) && ((!is_owned_by_me) || (!is_attachment)) && (CHAT_TYPE_OWNER != chat.mChatType) ) ) { - if (!RlvUtil::isEmote(mesg)) + bool fIsEmote = RlvUtil::isEmote(mesg); + if ((!fIsEmote) && + (((gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHAT)) && (!gRlvHandler.isException(RLV_BHVR_RECVCHAT, from_id))) || + ((gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHATFROM)) && (gRlvHandler.isException(RLV_BHVR_RECVCHATFROM, from_id))) )) { - if ( ((gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHAT)) && (!gRlvHandler.isException(RLV_BHVR_RECVCHAT, from_id))) && - ((!gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHATFROM)) || (gRlvHandler.isException(RLV_BHVR_RECVCHATFROM, from_id))) ) - { - if ( (gRlvHandler.filterChat(mesg, false)) && (!gSavedSettings.getBOOL("RestrainedLoveShowEllipsis")) ) - return; - } + if ( (gRlvHandler.filterChat(mesg, false)) && (!gSavedSettings.getBOOL("RestrainedLoveShowEllipsis")) ) + return; } - else if ( ((gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTE)) && (!gRlvHandler.isException(RLV_BHVR_RECVEMOTE, from_id))) && - ((!gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTEFROM)) || (gRlvHandler.isException(RLV_BHVR_RECVEMOTEFROM, from_id))) ) - { + else if ((fIsEmote) && + (((gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTE)) && (!gRlvHandler.isException(RLV_BHVR_RECVEMOTE, from_id))) || + ((gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTEFROM)) && (gRlvHandler.isException(RLV_BHVR_RECVEMOTEFROM, from_id))) )) + { if (!gSavedSettings.getBOOL("RestrainedLoveShowEllipsis")) return; mesg = "/me ..."; From e16f60a427cfe591a831943c52ae8668dc03bb61 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 10 Sep 2011 23:42:43 +0200 Subject: [PATCH 2/6] - fixed : crash when issuing @getinvworn on a folder containing a folder link to a folder with subfolders (thankies eloise) -> only direct or folded descendents of the linked folder should be collected (see 56ec506fee96) -> backported from RLVa-1.4.2 (see 40644beae9c4) --HG-- branch : RLVa --- indra/newview/rlvinventory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/rlvinventory.cpp b/indra/newview/rlvinventory.cpp index af965e10ae..764427654a 100644 --- a/indra/newview/rlvinventory.cpp +++ b/indra/newview/rlvinventory.cpp @@ -668,7 +668,8 @@ bool RlvWearableItemCollector::onCollectFolder(const LLInventoryCategory* pFolde } } else if ( (RLV_FOLDER_PREFIX_HIDDEN != strFolder[0]) && // Collect from any non-hidden child folder for *all - ( (fMatchAll) || (fLinkedFolder) ) ) // ... and collect from linked folders + ( (fMatchAll) || (fLinkedFolder) ) && // ... and collect from linked folders + (!isLinkedFolder(pFolder->getParentUUID())) ) // ... but never from non-folded linked folder descendents { #ifdef RLV_EXPERIMENTAL_COMPOSITEFOLDERS if ( (!RlvSettings::getEnableComposites()) || // ... if we're not checking composite folders From e4d91c65e40a7451f9054d6fa7873be8d54c67f2 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Fri, 16 Sep 2011 20:57:30 +0200 Subject: [PATCH 3/6] Added tag RLVa-1.4.0 for changeset a563f7e215c7 --HG-- branch : RLVa --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index cb4e7a05ff..69028817d6 100644 --- a/.hgtags +++ b/.hgtags @@ -233,3 +233,4 @@ fc0cbb86f5bd6e7737159e35aea2c4cf9f619b62 RLVa-1.2.1 43cb7dc1804de1a25c0b2b3f0715584af1f8b470 RLVa-1.2.2 89532c8dfd5b6c29f1cb032665b44a74a52452e1 RLVa-1.3.0 7bc5039ccf0b36eafbf6ce33a52b5e26332aa04c RLVa-1.3.1 +a563f7e215c7883c1cfd20908085687a0ed96284 RLVa-1.4.0 From 49bf9bedcff501be2dc47ef56bfd1fd4c037c3e7 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Fri, 16 Sep 2011 21:48:26 +0200 Subject: [PATCH 4/6] Added tag RLVa-1.4.1 for changeset 40644beae9c4 --HG-- branch : RLVa --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 6b20545916..ed0c312764 100644 --- a/.hgtags +++ b/.hgtags @@ -343,3 +343,4 @@ fc0cbb86f5bd6e7737159e35aea2c4cf9f619b62 RLVa-1.2.1 89532c8dfd5b6c29f1cb032665b44a74a52452e1 RLVa-1.3.0 7bc5039ccf0b36eafbf6ce33a52b5e26332aa04c RLVa-1.3.1 a563f7e215c7883c1cfd20908085687a0ed96284 RLVa-1.4.0 +40644beae9c4a617504163d5c9f195dc7bfff1b4 RLVa-1.4.1 From e85e93bb22c3b55aabbc8fa0bc31a57769c96865 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Thu, 6 Oct 2011 19:42:52 +0200 Subject: [PATCH 5/6] - fixed : an offered folder with the name of #RLV can be mistaken for the actual #RLV folder -> inventory offers can't contain subfolders so the critera of a valid #RLV folder changed to: (1) the first folder named #RLV with at least one sub-folder -> we know the user created this one (2) the last folder named #RLV with no sub-folders -> this one could possibly have come from a task or another avie --HG-- branch : RLVa --- indra/newview/rlvinventory.cpp | 25 ++++++++++++++++++------- indra/newview/rlvinventory.h | 6 ++++-- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/indra/newview/rlvinventory.cpp b/indra/newview/rlvinventory.cpp index 764427654a..f5e3975b33 100644 --- a/indra/newview/rlvinventory.cpp +++ b/indra/newview/rlvinventory.cpp @@ -242,7 +242,7 @@ bool RlvInventory::getPath(const uuid_vec_t& idItems, LLInventoryModel::cat_arra return (folders.count() != 0); } -// Checked: 2011-03-28 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g +// Checked: 2011-10-06 (RLVa-1.4.2a) | Modified: RLVa-1.4.2a const LLUUID& RlvInventory::getSharedRootID() const { if ( (m_idRlvRoot.isNull()) && (gInventory.isInventoryUsable()) ) @@ -251,17 +251,19 @@ const LLUUID& RlvInventory::getSharedRootID() const gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), pFolders, pItems); if (pFolders) { - // NOTE: we might have multiple #RLV folders so we'll just go with the first one we come across + // NOTE: we might have multiple #RLV folders (pick the first one with sub-folders; otherwise the last one with no sub-folders) const LLViewerInventoryCategory* pFolder; for (S32 idxFolder = 0, cntFolder = pFolders->count(); idxFolder < cntFolder; idxFolder++) { if ( ((pFolder = pFolders->get(idxFolder)) != NULL) && (cstrSharedRoot == pFolder->getName()) ) { - if (!gInventory.containsObserver((RlvInventory*)this)) - gInventory.addObserver((RlvInventory*)this); m_idRlvRoot = pFolder->getUUID(); + if (getDirectDescendentsFolderCount(pFolder) > 0) + break; } } + if ( (m_idRlvRoot.notNull()) && (!gInventory.containsObserver((RlvInventory*)this)) ) + gInventory.addObserver((RlvInventory*)this); } } return m_idRlvRoot; @@ -349,8 +351,17 @@ std::string RlvInventory::getSharedPath(const LLViewerInventoryCategory* pFolder return strPath.erase(0, 1); } +// Checked: 2011-10-06 (RLVa-1.4.2a) | Added: RLVa-1.4.2a +S32 RlvInventory::getDirectDescendentsFolderCount(const LLInventoryCategory* pFolder) +{ + LLInventoryModel::cat_array_t* pFolders = NULL; LLInventoryModel::item_array_t* pItems = NULL; + if (pFolder) + gInventory.getDirectDescendentsOf(pFolder->getUUID(), pFolders, pItems); + return (pFolders) ? pFolders->size() : 0; +} + // Checked: 2009-05-26 (RLVa-0.2.0d) | Modified: RLVa-0.2.0d -S32 RlvInventory::getDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType filterType) +S32 RlvInventory::getDirectDescendentsItemCount(const LLInventoryCategory* pFolder, LLAssetType::EType filterType) { S32 cntType = 0; if (pFolder) @@ -450,7 +461,7 @@ void RlvRenameOnWearObserver::doneIdle() // Rename the item's parent folder if it's called "New Folder", isn't directly under #RLV and contains exactly 1 object if ( (LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_NONE) == pFolder->getName()) && (pFolder->getParentUUID() != pRlvRoot->getUUID()) && - (1 == RlvInventory::getDirectDescendentsCount(pFolder, LLAssetType::AT_OBJECT)) ) + (1 == RlvInventory::getDirectDescendentsItemCount(pFolder, LLAssetType::AT_OBJECT)) ) { pFolder->rename(strFolderName); pFolder->updateServer(FALSE); @@ -661,7 +672,7 @@ bool RlvWearableItemCollector::onCollectFolder(const LLInventoryCategory* pFolde if ( (!fLinkedFolder) && (RlvInventory::isFoldedFolder(pFolder, false)) ) // Check for folder that should get folded under its parent { - if ( (!fAttach) || (1 == RlvInventory::getDirectDescendentsCount(pFolder, LLAssetType::AT_OBJECT)) ) + if ( (!fAttach) || (1 == RlvInventory::getDirectDescendentsItemCount(pFolder, LLAssetType::AT_OBJECT)) ) { // When attaching there should only be 1 attachment in it m_Folded.push_front(pFolder->getUUID()); m_FoldingMap.insert(std::pair(pFolder->getUUID(), pFolder->getParentUUID())); diff --git a/indra/newview/rlvinventory.h b/indra/newview/rlvinventory.h index 5bdaf4538e..7b08586e67 100644 --- a/indra/newview/rlvinventory.h +++ b/indra/newview/rlvinventory.h @@ -74,8 +74,10 @@ protected: * General purpose helper functions */ public: - // Returns the number of direct descendents of pFolder that have the specified type asset type - static S32 getDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType filterType); + // Returns the number of sub-folders of the specified folder + static S32 getDirectDescendentsFolderCount(const LLInventoryCategory* pFolder); + // Returns the number of direct descendents of the specified folder that have the specified type asset type + static S32 getDirectDescendentsItemCount(const LLInventoryCategory* pFolder, LLAssetType::EType filterType); // A "folded folder" is a folder whose items logically belong to the grandparent rather than the parent static bool isFoldedFolder(const LLInventoryCategory* pFolder, bool fCheckComposite); From e9940d1b3d80171208d0615793eaff9364baaedd Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Fri, 7 Oct 2011 23:11:02 +0200 Subject: [PATCH 6/6] - fixed : crash in rlvGetLastParenthesisedText() and rlvGetFirstParenthesisedText() (thankies Kadah) --HG-- branch : RLVa --- indra/newview/rlvhelper.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 64daa124ca..d506250701 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -1128,9 +1128,9 @@ std::string rlvGetFirstParenthesisedText(const std::string& strText, std::string return std::string(); const char* pstrText = strText.c_str(); idxIt = idxStart; - while ( (cntLevel > 0) && (idxIt < strText.length()) ) + while ( (cntLevel > 0) && (++idxIt < strText.length()) ) { - if ('(' == pstrText[++idxIt]) + if ('(' == pstrText[idxIt]) cntLevel++; else if (')' == pstrText[idxIt]) cntLevel--; @@ -1157,9 +1157,9 @@ std::string rlvGetLastParenthesisedText(const std::string& strText, std::string: return std::string(); const char* pstrText = strText.c_str(); idxIt = idxEnd; - while ( (cntLevel > 0) && (idxIt >= 0) ) + while ( (cntLevel > 0) && (--idxIt >= 0) && (idxIt < strText.length()) ) { - if (')' == pstrText[--idxIt]) + if (')' == pstrText[idxIt]) cntLevel++; else if ('(' == pstrText[idxIt]) cntLevel--;