void LLGroupIconCtrl::setValue(const LLSD& value)
{
	if (value.isUUID())
	{
		LLGroupMgr* gm = LLGroupMgr::getInstance();
		if (mGroupId.notNull())
		{
			gm->removeObserver(this);
		}

		if (mGroupId != value.asUUID())
		{
			mGroupId = value.asUUID();
			mID = mGroupId; // set LLGroupMgrObserver::mID to make callbacks work

			// Check if cache already contains image_id for that group
			if (!updateFromCache())
			{
				LLIconCtrl::setValue(mDefaultIconName);
				gm->addObserver(this);
				gm->sendGroupPropertiesRequest(mGroupId);
			}
		}
	}
	else
	{
		LLIconCtrl::setValue(value);
	}
}
Beispiel #2
0
	// If the inspector closes it will delete the pending request object, so the
	// inspector pointer will be valid for the lifetime of this object
	LLFetchGroupData(const LLUUID& group_id, LLInspectGroup* inspector)
	:	LLGroupMgrObserver(group_id),
		mInspector(inspector)
	{
		LLGroupMgr* mgr = LLGroupMgr::getInstance();
		// register ourselves as an observer
		mgr->addObserver(this);
		// send a request
		mgr->sendGroupPropertiesRequest(group_id);
	}
	LLFetchGroupMemberData(const LLUUID& group_id) : 
		mGroupId(group_id),
		mRequestProcessed(false),
		LLGroupMgrObserver(group_id) 
	{
		LL_INFOS() << "Sending new group member request for group_id: "<< group_id << LL_ENDL;
		LLGroupMgr* mgr = LLGroupMgr::getInstance();
		// register ourselves as an observer
		mgr->addObserver(this);
		// send a request
		mgr->sendGroupPropertiesRequest(group_id);
		mgr->sendCapGroupMembersRequest(group_id);
	}