• Validating a moderated message

    From Nightfox@VERT/DIGDIST to All on Sat Jan 21 18:10:49 2017
    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ã
  • From echicken@VERT/ECBBS to Nightfox on Sat Jan 21 23:26:14 2017
    Re: Validating a moderated messageã By: Nightfox to All on Sat Jan 21 2017 18:10:49ãã Ni> This is the code I have for the method:ãã Ni> if ((msgHdr.attr & MSG_VALIDATED) == 0)ã Ni> {ã Ni> msgHdr.attr &= MSG_VALIDATED;ããTry: msgHdr.attr |= MSG_VALIDATED;ããThe & operator returns 1 wherever the bits in both operands are set. The |ãoperator returns a 1 wherever a bit in either operand is set.ãã('a&=b' is basically shorthand for 'a=a&b', as 'a|=b' is to 'a=a|b'.)ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.com - 416-273-7230ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
  • From echicken@VERT/ECBBS to Nightfox on Sat Jan 21 23:30:58 2017
    Re: Validating a moderated messageã By: echicken to Nightfox on Sat Jan 21 2017 23:26:14ãã ec> ('a&=b' is basically shorthand for 'a=a&b', as 'a|=b' is to 'a=a|b'.)ãã^ May not have come through as intended:ãã('a&=b' is basically shorthand for 'a = a & b', as 'a|=b' is to 'a = a | b'.)ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.com - 416-273-7230ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
  • From Nightfox@VERT/DIGDIST to echicken on Sun Jan 22 11:40:26 2017
    Try: msgHdr.attr |= MSG_VALIDATED;ãã> The & operator returns 1 wherever the bits in both operands are set. The |ã> operator returns a 1 wherever a bit in either operand is set.ããOf course.. I knew that and just had one of those moments. :)ããNightfoxãã---ã þ Synchronet þ Digital Distortion: digitaldistortionbbs.comã