waiting for event to trigger
I'm working on an addon that delete unwanted mail items. The problem I'm having is if I loop through the MailIds to call DeleteMail(MailId) it will delete the first one and then it won't delete the rest. The issue seems to be because the server needs to act on the first one before it can act on the rest. I can queue up other items to be deleted in by adding them to the EVENT_MAIL_REMOVED event. I'm wondering what is the best way to pause the function or wait until there is a response back from the server or time out.?
|