public IEnumerable<Member> GetAlltimeChatMembers(Chat chat)
 {
     IEnumerable<string> participants = new List<string>();
     participants = participants.Union(chat.Participants.Split(' '));
     participants = participants.Union(chat.ActiveMembers.Split(' '));
     participants = participants.Union(chat.Posters.Split(' '));
     var members = LoadMembers(participants);
     return members;
 }
Пример #2
0
        public IEnumerable <Member> GetAlltimeChatMembers(Chat chat)
        {
            IEnumerable <string> participants = new List <string>();

            participants = participants.Union(chat.Participants.Split(' '));
            participants = participants.Union(chat.ActiveMembers.Split(' '));
            participants = participants.Union(chat.Posters.Split(' '));
            var members = LoadMembers(participants);

            return(members);
        }
 public IEnumerable<Member> GetCurrentChatMembers(Chat chat)
 {
     var members = ExecuteReaderItems<Member>("SELECT * FROM ChatMembers Where chatname = @name",
                                              (reader, member) =>
                                                  {
                                                      member.Name = reader.GetObject<string>("identity");
                                                  },
                                              new[] {CreateParameter("@name", chat.Name)});
     members = LoadMembers(members.Select(m => m.Name));
     return members;
 }
Пример #4
0
        public IEnumerable <Member> GetCurrentChatMembers(Chat chat)
        {
            var members = ExecuteReaderItems <Member>("SELECT * FROM ChatMembers Where chatname = @name",
                                                      (reader, member) =>
            {
                member.Name = reader.GetObject <string>("identity");
            },
                                                      new[] { CreateParameter("@name", chat.Name) });

            members = LoadMembers(members.Select(m => m.Name));
            return(members);
        }
 private void Fill(DbDataReader reader, Chat chat)
 {
     chat.Name = reader.GetObject<string>("name") ?? "";
     chat.Id = reader.GetValueObject<long>("id");
     chat.Topic =
         reader.GetObject<string>("topic") ?? "";
     chat.FriendlyName =
         reader.GetObject<string>("friendlyname") ?? "";
     chat.Posters =
         reader.GetObject<string>("posters") ?? "";
     chat.Participants =
         reader.GetObject<string>("participants") ?? "";
     chat.Adder = reader.GetObject<string>("adder");
     chat.Picture = reader.GetObject<byte[]>("picture");
     chat.ActiveMembers =
         reader.GetObject<string>(
             "activemembers") ?? "";
     var timestamp =
         reader.GetValueObject<long>(
             "last_change");
     chat.LastChange = DateUtils.ConvertFromLinuxStamp(timestamp);
 }
Пример #6
0
        private void Fill(DbDataReader reader, Chat chat)
        {
            chat.Name  = reader.GetObject <string>("name") ?? "";
            chat.Id    = reader.GetValueObject <long>("id");
            chat.Topic =
                reader.GetObject <string>("topic") ?? "";
            chat.FriendlyName =
                reader.GetObject <string>("friendlyname") ?? "";
            chat.Posters =
                reader.GetObject <string>("posters") ?? "";
            chat.Participants =
                reader.GetObject <string>("participants") ?? "";
            chat.Adder         = reader.GetObject <string>("adder");
            chat.Picture       = reader.GetObject <byte[]>("picture");
            chat.ActiveMembers =
                reader.GetObject <string>(
                    "activemembers") ?? "";
            var timestamp =
                reader.GetValueObject <long>(
                    "last_change");

            chat.LastChange = DateUtils.ConvertFromLinuxStamp(timestamp);
        }
Пример #7
0
        public IEnumerable <Message> GetMessages(Chat chat)
        {
            var query = string.Format("SELECT * FROM Messages WHERE chatname = '{0}'", chat.Name);

            return(ExecuteReaderItems <Message>(query, Fill));
        }
 public IEnumerable<Message> GetMessages(Chat chat)
 {
     var query = string.Format("SELECT * FROM Messages WHERE chatname = '{0}'", chat.Name);
     return ExecuteReaderItems<Message>(query, Fill);
 }