Example #1
0
        public void PutChatMessage(string sender, string username, Message[] messages)
        {
            var db         = GetDatabase();
            var collection = db.GetCollection("offline_msg");

            foreach (var item in messages)
            {
                OfflineMessageItem msg = new OfflineMessageItem()
                {
                    MessageType = item.Type.ToString(),
                    Body        = item.Body,
                    From        = sender,
                    Time        = item.Delay == null ? DateTime.Now : item.Delay.Stamp,
                    To          = username.ToLower()
                };
                collection.Insert <OfflineMessageItem>(msg);
            }
        }
        public void PutChatMessage(string sender, string username, Message[] messages)
        {
            var db = GetDatabase();
            var collection = db.GetCollection("offline_msg");
            foreach (var item in messages)
            {

                OfflineMessageItem msg = new OfflineMessageItem()
                {
                    MessageType = item.Type.ToString(),
                    Body = item.Body,
                    From = sender,
                    Time = item.Delay == null ? DateTime.Now : item.Delay.Stamp,
                    To = username.ToLower()
                };
                collection.Insert<OfflineMessageItem>(msg);
            }
        }