dcsimg
Problem with setting Flags?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   hari_krishna
Posted On:   Monday, November 19, 2001 01:59 AM

I have setting Flag to particular Message as SEEN.
if(m.isSet(Flags.Flag.DELETED))
{
System.out.println("Flag is true");
flag=true;
}
if(!m.isSet(Flags.Flag.DELETED))
{
m.setFlag(Flags.Flag.DELETED,true);
Flags flags=new Flags();
System.out.println("message Flag is"+flags.contains(Flags.Flag.SEEN));
}
Every Time I access the message(same message)
the Flag is returing false...why so?

Code attached inside to explain how-to

Posted By:   James_Kelley  
Posted On:   Wednesday, December 5, 2001 07:11 PM

The code below should work






// Process each message
for (int i = 0; i < messages.length && i < 1500; i++)
{
boolean deleteFlag = true;
if (!messages[i].isSet(Flags.Flag.SEEN))
{
EmailData emailData = new EmailData();
try
{
EmailProcessing processer = new EmailProcessing();
processer.process(messages[i],queueData.user,queueData.pop_address,emailData,queueData);
PopMail pmail = new PopMail();
pmail.makeQuery(connEmail, emailData, queueData);
messages[i].setFlag(Flags.Flag.SEEN, true);
}
catch (MessagingException mesg)
{
System.out.println("MessagingException: " + mesg + "
at message: "+i+"
");
deleteFlag = false;
RollBackEmail rBack = new RollBackEmail();
rBack.rollBackQuery(connEmail, emailData, queueData);
}
}
//will be enabled on live pop
messages[i].setFlag(Flags.Flag.DELETED, deleteFlag);
}
folder.close(true);
popConn.store.close();
About | Sitemap | Contact