Anonymous avatar Anonymous committed 869c162

BUG STORM-1004 FIXED Unblocking/blocking name sometimes deletes identically named entry, but of different TYPE

LLMuteList stores muted objects in two sets: set of names and set of ids. Avatar objects are stored by ids (set of ids), other objects can be stored both by name(set of names) or ids

- Delete items from corresponding set (from set of names or ids), not form both sets at time.

- Improved isMuted method's logic. Now if avatar is tested whether it's muted or not, don't search its name in the set of names.

Comments (0)

Files changed (2)

indra/newview/llmutelist.cpp

 		// Must be after erase.
 		setLoaded();  // why is this here? -MG
 	}
-
-	// Clean up any legacy mutes
-	string_set_t::iterator legacy_it = mLegacyMutes.find(mute.mName);
-	if (legacy_it != mLegacyMutes.end())
+	else
 	{
-		// Database representation of legacy mute is UUID null.
-		LLMute mute(LLUUID::null, *legacy_it, LLMute::BY_NAME);
-		updateRemove(mute);
-		mLegacyMutes.erase(legacy_it);
-		// Must be after erase.
-		setLoaded(); // why is this here? -MG
+		// Clean up any legacy mutes
+		string_set_t::iterator legacy_it = mLegacyMutes.find(mute.mName);
+		if (legacy_it != mLegacyMutes.end())
+		{
+			// Database representation of legacy mute is UUID null.
+			LLMute mute(LLUUID::null, *legacy_it, LLMute::BY_NAME);
+			updateRemove(mute);
+			mLegacyMutes.erase(legacy_it);
+			// Must be after erase.
+			setLoaded(); // why is this here? -MG
+		}
 	}
 	
 	return found;
 	}
 
 	// empty names can't be legacy-muted
-	if (name.empty()) return FALSE;
+	bool avatar = mute_object && mute_object->isAvatar();
+	if (name.empty() || avatar) return FALSE;
 
 	// Look in legacy pile
 	string_set_t::const_iterator legacy_it = mLegacyMutes.find(name);

indra/newview/llviewermenu.cpp

 		}
 		
 		LLMute mute(id, name, type);
-		if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName))
+		if (LLMuteList::getInstance()->isMuted(mute.mID))
 		{
 			LLMuteList::getInstance()->remove(mute);
 		}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.