コード例 #1
0
        private void FilterOverquoting(IList <MsgBase> list)
        {
            for (var i = 0; i < list.Count; i++)
            {
                using (var sr = new StringReader(
                           DatabaseManager.GetMessageBody(_serviceManager, list[i].ID)))
                {
                    string line;

                    var total  = 0;
                    var quotes = 0;

                    while ((line = sr.ReadLine()) != null)
                    {
                        total++;

                        if (_quotedLineRx.Match(line).Success)
                        {
                            quotes++;
                        }
                    }

                    if ((quotes < _quotaCountLimit) || ((double)quotes / total > _quotaPartLimit))
                    {
                        list.RemoveAt(i);
                        i--;
                    }
                }
            }
        }
コード例 #2
0
        public void ExecuteReplyMessage(ICommandContext context, int?messageId)
        {
            var msg = ForumMessageCommandHelper.GetMessage(context, messageId);

            var messageInfo = new MessageInfo(
                msg.ForumID,
                msg.ID,
                msg.Subject,
                Format.Forum.GetEditMessage(
                    DatabaseManager.GetMessageBody(context, msg.ID),
                    msg.UserNick));

            MessageEditor.EditMessage(context, MessageFormMode.Reply, messageInfo);
        }