Subj : Validating a moderated message
To   : All
From : Nightfox
Date : Sat Jan 21 2017 06:10 pm

Hi all,

I'm working on my message reader and have added a method (for sysops) to
validate a message that requires moderation.  It seems to me the way to do that
would be to add the MSG_VALIDATED attribute to a message header and save it
with msgbase.put_msg_header(), but it seems that if I re-load the message
header, it doesn't have the MSG_VALIDATED attribute.  msgbase.put_msg_header()
returns true, which I'd think would mean it successfully saved the header.  I'm
wondering what I might be doing wrong?

This is the code I have for the method:

function DigDistMsgReader_ValidateMsg(pSubBoardCode, pMsgNum)
{
 if (!msg_area.sub[pSubBoardCode].is_moderated)
   return true;
 if ((this.msgbase == null) || !this.msgbase.is_open)
   return false;

 var validationSuccessful = false;
 var msgHdr = this.msgbase.get_msg_header(false, pMsgNum, false);
 if (msgHdr != null)
 {
   if ((msgHdr.attr & MSG_VALIDATED) == 0)
   {
     msgHdr.attr &= MSG_VALIDATED;
     validationSuccessful = this.msgbase.put_msg_header(false, msgHdr.number,
                                                        msgHdr);
   }
   else
     validationSuccessful = true;
 }

 return validationSuccessful;
}


Nightfox

---
� Synchronet � Digital Distortion: digitaldistortionbbs.com