Thread Tools Display Modes
04/30/14, 02:41 PM   #1
Teli
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 19
Mail Attachments show as nil until clicked on

I"m having trouble getting the mail attachment item info. I found that if I have not clicked on the mail item I'm unable to get the attachment information. Is seems to save the information when you log in even after a reload it it remembers the attachment.

So if I first log in and run this script after opening the mailbox I will get a bunch of nil responses and one correct one from the currently selected mail item

Lua Code:
  1. function PS:Test()
  2.     PS.GetMailInfo()
  3.     for k, v in pairs(PS.mailInfo) do
  4.          d(v.attachId)
  5.     end
  6. end

but if I click on every mail item and run the code again it will populate all the item ID. Is there a way to simulate clicking on each mail item or another way to get all of the attachment information without having to click on each one?
  Reply With Quote
04/30/14, 02:56 PM   #2
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
My first guess is that the mail information is only loaded from the server, when you actually want to read the mail, so I would try to ReadMail() the mail before checking for attachments.

Maybe even RequestReadMail() does exactly that without marking the mail as actually read.
  Reply With Quote
04/30/14, 03:46 PM   #3
Teli
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 19
Originally Posted by Iyanga View Post
My first guess is that the mail information is only loaded from the server, when you actually want to read the mail, so I would try to ReadMail() the mail before checking for attachments.

Maybe even RequestReadMail() does exactly that without marking the mail as actually read.
I've tried both ReadMail() and RequestReadMail(). RequestReadMail marks it as read where as ReadMail() does not. RequestReadMail() works but you have to queue up the actions and wait for the first one to complete before moving on to the next. The problem with that is that if the mail is already read it won't trigger another event that I know of.
  Reply With Quote
04/30/14, 04:15 PM   #4
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
Originally Posted by Teli View Post
I've tried both ReadMail() and RequestReadMail(). RequestReadMail marks it as read where as ReadMail() does not. RequestReadMail() works but you have to queue up the actions and wait for the first one to complete before moving on to the next. The problem with that is that if the mail is already read it won't trigger another event that I know of.
?

Well, I get an EVENT_MAIL_READABLE for an already read mail, too. Even if it is also selected.
  Reply With Quote
04/30/14, 04:45 PM   #5
Teli
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 19
I haven't tried that one. That may work. I'll post back later when I give it a try.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Mail Attachments show as nil until clicked on


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off