In the visitormessage table, the state column is either 'visible', 'moderation', or 'deleted', so if it's 'moderation' then it hasn't been approved. There's also a 'messageread' column that's either 0 or 1.
It looks like groupmessage has the same state column, but for "has read" there's a groupread table that has a record for each user and group with the last time that user read that group, so I suppose you'd have to compare the message timestamp with the "readtime" for a given userid/groupid.
|