I added that new code and tried it again but now I get the following error:
ERROR: column tbl1.wasread does not exist
LINE 1: ...l1.userMe_fk=$1::int AND tbl1.isDeleted=FALSE AND tbl1.wasRe...
This is interesting because when I have that flag set to false (arg->emailIdsOnly = false); ) then this error does not appear, however I don't seem to be able to set the wasread flag or deleted flag. I will explain these a bit...
I am calling the following to set the read flag
RakNet::Lobby2Message *m = m_pMessageFactory->Alloc(RakNet::L2MID_Emails_SetStatus);
RakNet::Emails_SetStatus *arg = (RakNet::Emails_SetStatus *) m;
arg->emailId = mailID;
arg->isNowMarkedRead = true;
arg->updateMarkedRead = true;
This always returns SUCCESS. Even if I set this flag more than once. Is that the correct behavior? But it doesn't seem to respect the flag, when I get the emails again the flag wasReadByMe is always false.
Now for delete I call this code
RakNet::Lobby2Message *m = m_pMessageFactory->Alloc(RakNet::L2MID_Emails_Delete);
RakNet::Emails_Delete *arg = (RakNet::Emails_Delete *) m;
arg->emailId = emailID;
This succeeds and if I call it again it says that the email has already been deleted. But when I get the emails again all the deleted emails still come through (And as a feature request I would like to be able to get a list of the emails that have been deleted so users can undelete them if they want to).
And one last quirk that I am seeing is that I see duplicates of all the emails. I get them twice, right after each other in the
DataStructures::List<EmailResult> emailResults; list. EmailA, EmailA, EmailB, EmailB, EmailC, EmailC etc...