STORM-68 Reapply changes to inventory processing lost in the merge.
Move call to updateCap back to where it was. The place it was moved to was too early in the login sequence and was causing a crash.meow-7.2.2
parent
0031e9a97b
commit
176901422f
|
|
@ -898,9 +898,6 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
|
|||
|
||||
// Update all of the regions.
|
||||
LLWorld::getInstance()->updateAgentOffset(mAgentOriginGlobal);
|
||||
|
||||
// Send default object permissions to simulator
|
||||
LLFloaterPermsDefault::updateCap(false);
|
||||
}
|
||||
|
||||
// Pass new region along to metrics components that care about this level of detail.
|
||||
|
|
|
|||
|
|
@ -175,15 +175,18 @@ public:
|
|||
|
||||
void LLFloaterPermsDefault::updateCap(bool alwaysUpdate)
|
||||
{
|
||||
llwarns << "DBG start" << llendl;
|
||||
if(!alwaysUpdate && mCapSent)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
llwarns << "DBG getRegion" << llendl;
|
||||
std::string object_url = gAgent.getRegion()->getCapability("DefaultObjectPermissions");
|
||||
|
||||
if(!object_url.empty())
|
||||
{
|
||||
llwarns << "DBG post" << llendl;
|
||||
LLSD report = LLSD::emptyMap();
|
||||
report["Group"] = (LLSD::Integer)LLFloaterPerms::getGroupPerms(sCategoryNames[CAT_OBJECTS]);
|
||||
report["Everyone"] = (LLSD::Integer)LLFloaterPerms::getEveryonePerms(sCategoryNames[CAT_OBJECTS]);
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@
|
|||
#include "llavataractions.h"
|
||||
#include "lllogininstance.h"
|
||||
#include "llfavoritesbar.h"
|
||||
#include "llfloaterperms.h"
|
||||
|
||||
// Two do-nothing ops for use in callbacks.
|
||||
void no_op_inventory_func(const LLUUID&) {}
|
||||
|
|
@ -989,6 +990,24 @@ void activate_gesture_cb(const LLUUID& inv_item)
|
|||
LLGestureMgr::instance().activateGesture(inv_item);
|
||||
}
|
||||
|
||||
void create_script_cb(const LLUUID& inv_item)
|
||||
{
|
||||
if (inv_item.isNull())
|
||||
return;
|
||||
|
||||
LLViewerInventoryItem* item = gInventory.getItem(inv_item);
|
||||
if (!item) return;
|
||||
|
||||
LLPermissions perm = item->getPermissions();
|
||||
perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Scripts"));
|
||||
perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Scripts"));
|
||||
|
||||
item->setPermissions(perm);
|
||||
|
||||
gInventory.updateItem(item);
|
||||
gInventory.notifyObservers();
|
||||
}
|
||||
|
||||
void create_gesture_cb(const LLUUID& inv_item)
|
||||
{
|
||||
if (inv_item.isNull())
|
||||
|
|
@ -998,6 +1017,13 @@ void create_gesture_cb(const LLUUID& inv_item)
|
|||
|
||||
LLViewerInventoryItem* item = gInventory.getItem(inv_item);
|
||||
if (!item) return;
|
||||
|
||||
LLPermissions perm = item->getPermissions();
|
||||
perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Gestures"));
|
||||
perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Gestures"));
|
||||
|
||||
item->setPermissions(perm);
|
||||
|
||||
gInventory.updateItem(item);
|
||||
gInventory.notifyObservers();
|
||||
|
||||
|
|
@ -1007,6 +1033,24 @@ void create_gesture_cb(const LLUUID& inv_item)
|
|||
}
|
||||
|
||||
|
||||
void create_notecard_cb(const LLUUID& inv_item)
|
||||
{
|
||||
if (inv_item.isNull())
|
||||
return;
|
||||
|
||||
LLViewerInventoryItem* item = gInventory.getItem(inv_item);
|
||||
if (!item) return;
|
||||
|
||||
LLPermissions perm = item->getPermissions();
|
||||
perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Notecards"));
|
||||
perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Notecards"));
|
||||
|
||||
item->setPermissions(perm);
|
||||
|
||||
gInventory.updateItem(item);
|
||||
gInventory.notifyObservers();
|
||||
}
|
||||
|
||||
LLInventoryCallbackManager gInventoryCallbacks;
|
||||
|
||||
void create_inventory_item(const LLUUID& agent_id, const LLUUID& session_id,
|
||||
|
|
@ -1260,22 +1304,43 @@ void create_new_item(const std::string& name,
|
|||
LLViewerAssetType::generateDescriptionFor(asset_type, desc);
|
||||
next_owner_perm = (next_owner_perm) ? next_owner_perm : PERM_MOVE | PERM_TRANSFER;
|
||||
|
||||
|
||||
if (inv_type == LLInventoryType::IT_GESTURE)
|
||||
LLPointer<LLInventoryCallback> cb = NULL;
|
||||
|
||||
switch (inv_type)
|
||||
{
|
||||
LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(create_gesture_cb);
|
||||
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
|
||||
parent_id, LLTransactionID::tnull, name, desc, asset_type, inv_type,
|
||||
NOT_WEARABLE, next_owner_perm, cb);
|
||||
case LLInventoryType::IT_LSL:
|
||||
{
|
||||
cb = new LLBoostFuncInventoryCallback(create_script_cb);
|
||||
next_owner_perm = LLFloaterPerms::getNextOwnerPerms("Scripts");
|
||||
break;
|
||||
}
|
||||
|
||||
case LLInventoryType::IT_GESTURE:
|
||||
{
|
||||
cb = new LLBoostFuncInventoryCallback(create_gesture_cb);
|
||||
next_owner_perm = LLFloaterPerms::getNextOwnerPerms("Gestures");
|
||||
break;
|
||||
}
|
||||
|
||||
case LLInventoryType::IT_NOTECARD:
|
||||
{
|
||||
cb = new LLBoostFuncInventoryCallback(create_notecard_cb);
|
||||
next_owner_perm = LLFloaterPerms::getNextOwnerPerms("Notecards");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LLPointer<LLInventoryCallback> cb = NULL;
|
||||
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
|
||||
parent_id, LLTransactionID::tnull, name, desc, asset_type, inv_type,
|
||||
NOT_WEARABLE, next_owner_perm, cb);
|
||||
}
|
||||
|
||||
|
||||
create_inventory_item(gAgent.getID(),
|
||||
gAgent.getSessionID(),
|
||||
parent_id,
|
||||
LLTransactionID::tnull,
|
||||
name,
|
||||
desc,
|
||||
asset_type,
|
||||
inv_type,
|
||||
NOT_WEARABLE,
|
||||
next_owner_perm,
|
||||
cb);
|
||||
}
|
||||
|
||||
const std::string NEW_LSL_NAME = "New Script"; // *TODO:Translate? (probably not)
|
||||
|
|
@ -1316,7 +1381,7 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge,
|
|||
parent_id,
|
||||
LLAssetType::AT_LSL_TEXT,
|
||||
LLInventoryType::IT_LSL,
|
||||
PERM_MOVE | PERM_TRANSFER);
|
||||
PERM_MOVE | PERM_TRANSFER); // overridden in create_new_item
|
||||
}
|
||||
else if ("notecard" == type_name)
|
||||
{
|
||||
|
|
@ -1325,7 +1390,7 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge,
|
|||
parent_id,
|
||||
LLAssetType::AT_NOTECARD,
|
||||
LLInventoryType::IT_NOTECARD,
|
||||
PERM_ALL);
|
||||
PERM_ALL); // overridden in create_new_item
|
||||
}
|
||||
else if ("gesture" == type_name)
|
||||
{
|
||||
|
|
@ -1334,7 +1399,7 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge,
|
|||
parent_id,
|
||||
LLAssetType::AT_GESTURE,
|
||||
LLInventoryType::IT_GESTURE,
|
||||
PERM_ALL);
|
||||
PERM_ALL); // overridden in create_new_item
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -249,7 +249,9 @@ void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachme
|
|||
|
||||
void activate_gesture_cb(const LLUUID& inv_item);
|
||||
|
||||
void create_script_cb(const LLUUID& inv_item);
|
||||
void create_gesture_cb(const LLUUID& inv_item);
|
||||
void create_notecard_cb(const LLUUID& inv_item);
|
||||
|
||||
class AddFavoriteLandmarkCallback : public LLInventoryCallback
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1577,6 +1577,7 @@ void LLViewerRegion::unpackRegionHandshake()
|
|||
// Supplying false in this call means only send the default permissions to the simulator if
|
||||
// it has never been sent. Once this data is sent the simulator will pass this data to new
|
||||
// simulators as the agent moves around.
|
||||
LLFloaterPermsDefault::updateCap(false);
|
||||
}
|
||||
|
||||
void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
|
||||
|
|
|
|||
Loading…
Reference in New Issue