Shift Right click now works on profile pictures, fixed minor message system bug where packets going in would be considered spoofed packets

This commit is contained in:
phr0z3nt04st
2010-07-06 12:24:00 -05:00
parent e25a02c407
commit c6a4f2570f
3 changed files with 39 additions and 22 deletions

View File

@@ -697,7 +697,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count, bool faked_message, U8 fak
mCurrentRecvPacketID = ntohl(*((U32*)(&buffer[1]))); mCurrentRecvPacketID = ntohl(*((U32*)(&buffer[1])));
// <edit> // <edit>
BOOL spoofed_packet = FALSE; BOOL spoofed_packet = FALSE;
if(mSpoofProtectionLevel > 0) if(!faked_message && mSpoofProtectionLevel > 0)
{ {
S32 len = receive_size; S32 len = receive_size;
U32 message = 0; U32 message = 0;

View File

@@ -1139,8 +1139,12 @@ void LLTextureCtrl::setEnabled( BOOL enabled )
} }
mCaption->setEnabled( enabled ); mCaption->setEnabled( enabled );
mEnable = enabled;
// <edit>
/*
LLView::setEnabled( enabled ); LLView::setEnabled( enabled );
*/
// </edit>
} }
void LLTextureCtrl::setValid(BOOL valid ) void LLTextureCtrl::setValid(BOOL valid )
@@ -1254,29 +1258,34 @@ BOOL LLTextureCtrl::handleHover(S32 x, S32 y, MASK mask)
BOOL LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask)
{ {
// <edit>
if(!mEnable) return FALSE;
BOOL handled = LLUICtrl::handleMouseDown( x, y , mask ); BOOL handled = LLUICtrl::handleMouseDown( x, y , mask );
if( handled ) if( handled )
{ {
// <edit>
if( mask & MASK_CONTROL )
{
LLLocalInventory::addItem(mImageAssetID.asString(), (int)LLAssetType::AT_TEXTURE, mImageAssetID, true);
}
else
{
// </edit>
showPicker(FALSE); showPicker(FALSE);
//grab textures first... //grab textures first...
gInventory.startBackgroundFetch(gInventory.findCategoryUUIDForType(LLAssetType::AT_TEXTURE)); gInventory.startBackgroundFetch(gInventory.findCategoryUUIDForType(LLAssetType::AT_TEXTURE));
//...then start full inventory fetch. //...then start full inventory fetch.
gInventory.startBackgroundFetch(); gInventory.startBackgroundFetch();
//<edit>
}
} }
return handled; return handled;
} }
// <edit>
BOOL LLTextureCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
if( mask & MASK_SHIFT )
{
LLLocalInventory::addItem(mImageAssetID.asString(), (int)LLAssetType::AT_TEXTURE, mImageAssetID, true);
return TRUE;
}
return FALSE;
}
// </edit>
void LLTextureCtrl::onFloaterClose() void LLTextureCtrl::onFloaterClose()
{ {
LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get();
@@ -1293,8 +1302,8 @@ void LLTextureCtrl::onFloaterClose()
void LLTextureCtrl::onFloaterCommit(ETexturePickOp op) void LLTextureCtrl::onFloaterCommit(ETexturePickOp op)
{ {
LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get();
// <edit> mEnable getEnabled()
if( floaterp && getEnabled()) if( floaterp && mEnable)
{ {
mDirty = (op != TEXTURE_CANCEL); mDirty = (op != TEXTURE_CANCEL);
if( floaterp->isDirty() ) if( floaterp->isDirty() )
@@ -1327,7 +1336,8 @@ void LLTextureCtrl::setImageAssetID( const LLUUID& asset_id )
mImageItemID.setNull(); mImageItemID.setNull();
mImageAssetID = asset_id; mImageAssetID = asset_id;
LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get();
if( floaterp && getEnabled() ) // <edit> mEnable getEnabled()
if( floaterp && mEnable )
{ {
floaterp->setImageID( asset_id ); floaterp->setImageID( asset_id );
floaterp->setDirty( FALSE ); floaterp->setDirty( FALSE );
@@ -1346,7 +1356,8 @@ BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask,
// returns true, then the cast was valid, and we can perform // returns true, then the cast was valid, and we can perform
// the third test without problems. // the third test without problems.
LLInventoryItem* item = (LLInventoryItem*)cargo_data; LLInventoryItem* item = (LLInventoryItem*)cargo_data;
if (getEnabled() && (cargo_type == DAD_TEXTURE) && allowDrop(item)) // <edit> mEnable getEnabled()
if (mEnable && (cargo_type == DAD_TEXTURE) && allowDrop(item))
{ {
if (drop) if (drop)
{ {

View File

@@ -79,6 +79,9 @@ public:
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
// <edit>
virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
// </edit>
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
BOOL drop, EDragAndDropType cargo_type, void *cargo_data, BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
EAcceptance *accept, EAcceptance *accept,
@@ -187,6 +190,9 @@ private:
BOOL mValid; BOOL mValid;
BOOL mDirty; BOOL mDirty;
BOOL mShowLoadingPlaceholder; BOOL mShowLoadingPlaceholder;
// <edit>
BOOL mEnable;
// </edit>
std::string mLoadingPlaceholderString; std::string mLoadingPlaceholderString;
}; };