public Room(RoomInfo roomInfo) { RoomInfo = roomInfo; IsActive = true; _settings = RoomSettings.Get(RoomInfo.ShortName); if (_settings == null) { _settings = new RoomSettings { Room = RoomInfo.ShortName, Bans = new HashSet<string>(), Mods = new HashSet<string>() }; _settings.Insert(); } _history = new LinkedList<HistoryLine>(); var cmd = new SqlCommand("SELECT * FROM rohbot.chathistory WHERE chat=lower(:chat) ORDER BY date DESC LIMIT 100;"); cmd["chat"] = RoomInfo.ShortName; foreach (var line in cmd.Execute().Reverse().Select(r => HistoryLine.Read(r))) { _history.AddLast(line); } _showLinkTitles = (RoomInfo["LinkTitles"] ?? "").ToLower() == "true"; IsWhitelisted = (RoomInfo["Whitelist"] ?? "").ToLower() == "true"; IsHidden = (RoomInfo["Hidden"] ?? "").ToLower() == "true"; IsPrivate = (RoomInfo["Private"] ?? "").ToLower() == "true"; IsLogging = (RoomInfo["Logging"] ?? "true").ToLower() == "true"; ShowWebStates = (RoomInfo["WebStates"] ?? "true").ToLower() == "true"; DisableBanning = (RoomInfo["DisableBanning"] ?? "").ToLower() == "true"; }