public static MvcHtmlString RenderMessage(this HtmlHelper<IndexViewModel> helper, Message message)
        {
            switch (message.Type)
            {
                case FastLogReader.LineType.Join:
                    return helper.Partial("MessageTypes/Join", message);

                case FastLogReader.LineType.Quit:
                    return helper.Partial("MessageTypes/Quit", message);

                case FastLogReader.LineType.Message:
                    return helper.Partial("MessageTypes/Message", message);

                case FastLogReader.LineType.Meta:
                    return helper.Partial("MessageTypes/Meta", message);

                case FastLogReader.LineType.Action:
                    return helper.Partial("messageTypes/Action", message);

                default:
                    goto case FastLogReader.LineType.Meta;
            }
        }
        private static void Process(MessagesModel model, IEnumerable<FastLogReader.Line> lines)
        {
            Message msg = null;

            var previousState = new MessageState();

            foreach (var line in lines)
            {
                var isTor = Tor.Lines.Contains(line.Host) || DnsCache.ResolveDontWait(line.Host).Any(ipv4 => Tor.Lines.Contains(ipv4));

                msg = msg ?? new Message { UsesTor = isTor, Timestamp = line.When, Nick = line.Nick, Type = line.Type };

                previousState.InitializeIfBlank(line);

                if (previousState.IsLinePartOfMessage(line))
                {
                    msg.Lines.Add(line.Message);
                    continue;
                }

                previousState.SetState(line);

                msg = new Message { UsesTor = isTor, Type = line.Type, Nick = line.Nick, Timestamp = line.When };

                msg.Lines.Add(line.Message);

                model.Messages.Add(msg);
            }
        }
        private static void Process(MessagesModel model, IEnumerable<FastLogReader.Line> lines)
        {
            //
            // This process could be refactored into some black LINQ magic, but
            // for now, just keep track of previous Nick and Type.
            //

            Message msg = null;

            var previousState = new PreviousMessageState();

            foreach (var line in lines)
            {
                var isTor = Tor.Lines.Contains(line.Host) || DnsCache.ResolveDontWait(line.Host).Any(ipv4 => Tor.Lines.Contains(ipv4));

                msg = msg ?? new Message { UsesTor = isTor, Timestamp = line.When, Nick = line.Nick, Type = line.Type };

                previousState.InitializeIfBlank(line);

                if (previousState.IsLinePartOfMessage(line))
                {
                    msg.Lines.Add(line.Message);
                    continue;
                }

                previousState.WriteNewState(line);

                msg = new Message { UsesTor = isTor, Type = line.Type, Nick = line.Nick, Timestamp = line.When };

                msg.Lines.Add(line.Message);

                model.Messages.Add(msg);
            }
        }