WoW:API InboxItemCanDelete: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
m (Move page script moved page API InboxItemCanDelete to API InboxItemCanDelete without leaving a redirect)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{stub/API}}
{{cleanup}}
{{wowapi}}__NOTOC__
{{wowapi}}__NOTOC__
Returns false when a mail message contains an item from another player character, true otherwise.
Boolean function for determining whether a message is returnable.
canDelete = InboxItemCanDelete(index)
 
==Parameters==
===Arguments===
:;index : Number - the index of the message (1 is the first message)
===Returns===
:;canDelete : Flag - false if a mailed item or money is returnable, true otherwise.
 
==Notes==
InboxItemCanDelete() is used by Blizzard's MailFrame.lua to determine whether a mail message is returnable, and thus whether it should put a "Return" button on the message frame or a "Delete" button.  This is true when the message has been sent by the Auction House or an NPC, or has been bounced back (returned) from a player character.  It will be false when it is an original message from a player character.
 
This function should not be confused with whether [[API DeleteInboxItem|DeleteInboxItem]] will succeed or not; despite its name, InboxItemCanDelete is not checking for whether you are allowed to delete a message.  For safety, assume that DeleteInboxItem will succeed whenever it is passed a valid index, regardless of whether the message contains any item or money.  It is Blizzard's MailFrame.lua that provides confirmation boxes for deleting messages that still have an item or money attached.

Latest revision as of 04:46, 15 August 2023

WoW API < InboxItemCanDelete

Boolean function for determining whether a message is returnable.

canDelete = InboxItemCanDelete(index)

Parameters[edit]

Arguments[edit]

index
Number - the index of the message (1 is the first message)

Returns[edit]

canDelete
Flag - false if a mailed item or money is returnable, true otherwise.

Notes[edit]

InboxItemCanDelete() is used by Blizzard's MailFrame.lua to determine whether a mail message is returnable, and thus whether it should put a "Return" button on the message frame or a "Delete" button. This is true when the message has been sent by the Auction House or an NPC, or has been bounced back (returned) from a player character. It will be false when it is an original message from a player character.

This function should not be confused with whether DeleteInboxItem will succeed or not; despite its name, InboxItemCanDelete is not checking for whether you are allowed to delete a message. For safety, assume that DeleteInboxItem will succeed whenever it is passed a valid index, regardless of whether the message contains any item or money. It is Blizzard's MailFrame.lua that provides confirmation boxes for deleting messages that still have an item or money attached.