View Single Post
04/27/19, 12:21 PM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
Not sure what you mean with ZO_LinkHandler_CreateChatLink is "unexposed"? It is a global function defined in zo_linkhandler.lua, but you won't need it for getting the attachment name, since all it basically does is call the function that is passed to it.

Reading mailinbox_keyboard.lua you can see how the attachment slots are created. The important part is where ZO_Inventory_BindSlot is called with SLOT_TYPE_MAIL_ATTACHMENT. This determines what happens when you interact with that item slot. When you search the inventoryslot.lua for that slot type, you can see that it passes GetAttachedItemLink, MAIL_INBOX:GetOpenMailId() and ZO_Inventory_GetSlotIndex(inventorySlot) to ZO_LinkHandler_CreateChatLink.

This means calling GetAttachedItemLink(MAIL_INBOX:GetOpenMailId(), ZO_Inventory_GetSlotIndex(inventorySlot)) will give you the item link for the attachment and from there you can use any of the item link functions to extract whatever info you need.
  Reply With Quote