コード例 #1
0
        // returns true if the mail has been validated
        private bool ValidateOutgoingMail()
        {
            // automated messages are automatically validated
            if (SenderID < 0)
            {
                return(true);
            }

            PC receiver = PC.GetPC(ReceiverID);
            PC sender   = PC.GetOnline(SenderID);

            // this should not occur, as if it is not an automated message these are verified elsewhere -- just in case
            if (receiver == null || sender == null)
            {
                return(false);
            }

            // receiver is ignored by sender
            if (Array.IndexOf(receiver.ignoreList, sender.UniqueID) != -1)
            {
                sender.WriteToDisplay("The receiver of your mail currently has you on their ignore list.");
                return(false);
            }

            // receiver is on sender's ignore list
            if (Array.IndexOf(sender.ignoreList, receiver.UniqueID) != -1)
            {
                sender.WriteToDisplay("The receiver of this mail is on your ignore list. You must remove them in order to send them mail.");
                return(false);
            }

            // filter profanity
            if (receiver.filterProfanity)
            {
                //sender.WriteToDisplay("The receiver of your mail has their profanity filter turned on. The mail is being scanned for profanity...");

                Subject = Conference.FilterProfanity(Subject);
                Body    = Conference.FilterProfanity(Body);
            }

            return(true);
        }