public void should_parse_timestamp()
        {
            var roomMessage = new RoomMessage();

            var input = "2010-11-19T15:48:19-0800";
            var expectedDateTime = new DateTime(2010, 11, 19, 15, 48, 19);

            var outDate = roomMessage.ParseTimestamp(input);
            Assert.That(outDate, Is.EqualTo(expectedDateTime));
        }
        public static RoomMessageType GetMessageType(RoomMessage message)
        {
            if (message.User.UserId == "api")
                 return RoomMessageType.ApiMessage;

             if (message.UploadInformation != null && ! String.IsNullOrWhiteSpace(message.UploadInformation.Name))
                 return RoomMessageType.FileUpload;

             return RoomMessageType.UserMessage;
        }
Example #3
0
        public void ProcessMessage(RoomMessage message, IRepsonseClient context)
        {
            try
            {
                if (message.Message.StartsWith("ep set tags "))
                {
                    _tags = message.Message.Substring("ep set tags ".Length);
                    return;
                }
            }
            catch (Exception ex)
            {
                return;
            }

            context.Reply(ProcessorDisplayName, _tags +" "+ message.Message + " " + _tags, MessageFormat.Text);
        }
Example #4
0
        public IList<RoomMessage> GetNewMessages()
        {
            var newRoomMessages = RetrieveRecentMessages();

            var newMessageArray = new RoomMessage[newRoomMessages.Count];
            newRoomMessages.CopyTo(newMessageArray,0);

            var messagesToRemove = _previousRoomMessages ?? new List<RoomMessage>();

            _previousRoomMessages = newMessageArray;
            foreach (var messageToRemove in messagesToRemove)
            {
                newRoomMessages.Remove(messageToRemove);
            }

            return newRoomMessages;
        }
Example #5
0
 public void ProcessMessage(RoomMessage message)
 {
     Console.Write("EchoProcessor: {0}", message.Message);
 }