Hans Kristian Rosbach wrote:

Cut down version of messages:
CREATE TABLE messages (
  seen_flag INT2 DEFAULT '0' NOT NULL,
  answered_flag INT2 DEFAULT '0' NOT NULL,
  deleted_flag INT2 DEFAULT '0' NOT NULL,
  flagged_flag INT2 DEFAULT '0' NOT NULL,
  recent_flag INT2 DEFAULT '0' NOT NULL,
  draft_flag INT2 DEFAULT '0' NOT NULL,
  status INT2 DEFAULT '000' NOT NULL,
);

This is what the status field is defined to be:
typedef enum {
        MESSAGE_STATUS_NEW     = 0,
        MESSAGE_STATUS_SEEN    = 1,
        MESSAGE_STATUS_DELETE  = 2,
        MESSAGE_STATUS_PURGE   = 3,
        MESSAGE_STATUS_UNUSED  = 4,
        MESSAGE_STATUS_INSERT  = 5,
        MESSAGE_STATUS_ERROR   = 6
} MessageStatus_t;

Now, why do we have both a seen status and a seen flag?
I was thinking of giving a simple answer.. But then I couldn't find a simple answer..

And what about the delete status and deleted flag?
These *are* different things.

deleted_flag is for IMAP. A message set to deleted is still in a mailbox. MUAs also still receive, but
most often don't show it, or they show it with a strikethrough line.

MESSAGE_STATUS_DELETE is for messages that are really deleted (EXPUNGE in IMAP, DELE from POP).

And why do we define the status flag to be '000' and not '0'?
Because that's faulty.. it's a bug..

Ilja
--

Ilja Booij
IC&S B.V.

Stadhouderslaan 57
3583 JD  Utrecht
www.ic-s.nl

T algemeen: 030 6355730
T direct: 030 6355739
F: 030 6355731
E: [EMAIL PROTECTED]

Reply via email to