FIRE-15194: Avatar picker doesn't work anymore when using legacy simulator messages

Thu, 18 Dec 2014 15:03:38 +0100

author
Ansariel
date
Thu, 18 Dec 2014 15:03:38 +0100
changeset 43087
6fdeb99b7cb3
parent 43086
8376ca2b5fc6
child 43088
3adb3ead1196

FIRE-15194: Avatar picker doesn't work anymore when using legacy simulator messages

indra/newview/llfloateravatarpicker.cpp file | annotate | diff | revisions
indra/newview/llfloateravatarpicker.h file | annotate | diff | revisions
     1.1 --- a/indra/newview/llfloateravatarpicker.cpp	Thu Dec 18 09:51:11 2014 +0100
     1.2 +++ b/indra/newview/llfloateravatarpicker.cpp	Thu Dec 18 15:03:38 2014 +0100
     1.3 @@ -65,6 +65,9 @@
     1.4  //put it back as a member once the legacy path is out?
     1.5  static std::map<LLUUID, LLAvatarName> sAvatarNameMap;
     1.6  
     1.7 +// <FS:Ansariel> FIRE-15194: Avatar picker doesn't work anymore when using legacy simulator messages
     1.8 +LLFloaterAvatarPicker::query_id_name_map_t LLFloaterAvatarPicker::sQueryNameMap;
     1.9 +
    1.10  LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback,
    1.11  												   BOOL allow_multiple,
    1.12  												   BOOL closeOnSelect,
    1.13 @@ -219,6 +222,14 @@
    1.14  	}
    1.15  	// </FS:Ansariel>
    1.16  
    1.17 +	// <FS:Ansariel> FIRE-15194: Avatar picker doesn't work anymore when using legacy simulator messages
    1.18 +	query_id_name_map_t::iterator found = sQueryNameMap.find(mQueryID);
    1.19 +	if (found != sQueryNameMap.end())
    1.20 +	{
    1.21 +		sQueryNameMap.erase(found);
    1.22 +	}
    1.23 +	// </FS:Ansariel>
    1.24 +
    1.25  	gFocusMgr.releaseFocusIfNeeded( this );
    1.26  }
    1.27  
    1.28 @@ -648,6 +659,9 @@
    1.29  	}
    1.30  	else
    1.31  	{
    1.32 +		// <FS:Ansariel> FIRE-15194: Avatar picker doesn't work anymore when using legacy simulator messages
    1.33 +		sQueryNameMap[mQueryID] = getKey().asString();
    1.34 +
    1.35  		LLMessageSystem* msg = gMessageSystem;
    1.36  		msg->newMessage("AvatarPickerRequest");
    1.37  		msg->nextBlock("AgentData");
    1.38 @@ -774,7 +788,17 @@
    1.39  	// Not for us
    1.40  	if (agent_id != gAgent.getID()) return;
    1.41  	
    1.42 -	LLFloaterAvatarPicker* floater = LLFloaterReg::findTypedInstance<LLFloaterAvatarPicker>("avatar_picker");
    1.43 +	// <FS:Ansariel> FIRE-15194: Avatar picker doesn't work anymore when using legacy simulator messages
    1.44 +	//LLFloaterAvatarPicker* floater = LLFloaterReg::findTypedInstance<LLFloaterAvatarPicker>("avatar_picker");
    1.45 +	query_id_name_map_t::iterator found = sQueryNameMap.find(query_id);
    1.46 +	if (found == sQueryNameMap.end())
    1.47 +	{
    1.48 +		return;
    1.49 +	}
    1.50 +	std::string floater_key = LLSD(found->second);
    1.51 +	sQueryNameMap.erase(found);
    1.52 +	LLFloaterAvatarPicker* floater = LLFloaterReg::findTypedInstance<LLFloaterAvatarPicker>("avatar_picker", floater_key);
    1.53 +	// </FS:Ansariel>
    1.54  
    1.55  	// floater is closed or these are not results from our last request
    1.56  	if (NULL == floater || query_id != floater->mQueryID)
     2.1 --- a/indra/newview/llfloateravatarpicker.h	Thu Dec 18 09:51:11 2014 +0100
     2.2 +++ b/indra/newview/llfloateravatarpicker.h	Thu Dec 18 15:03:38 2014 +0100
     2.3 @@ -68,6 +68,11 @@
     2.4  	void openFriendsTab();
     2.5  	BOOL isExcludeAgentFromSearchResults() {return mExcludeAgentFromSearchResults;}
     2.6  
     2.7 +	// <FS:Ansariel> FIRE-15194: Avatar picker doesn't work anymore when using legacy simulator messages
     2.8 +	typedef std::map<LLUUID, std::string> query_id_name_map_t;
     2.9 +	static query_id_name_map_t sQueryNameMap;
    2.10 +	// </FS:Ansariel>
    2.11 +
    2.12  private:
    2.13  	void editKeystroke(class LLLineEditor* caller, void* user_data);
    2.14  	// <FS:Ansariel> Search by UUID

mercurial