/// <summary> /// Gets the absolute path to where the notes need to be written to. /// </summary> public string GetFullOutputPath(IMeetingInfo meetingInfo) { return(Path.Combine( this.meetbotRoot, GetFileName(meetingInfo) )); }
/// <summary> /// Gets the desired filename based on the meeting info. /// </summary> public string GetFileName(IMeetingInfo meetingInfo) { return(ReplaceWithMeetingInfo( this.FileName, meetingInfo ).NormalizeWhiteSpace('_')); }
/// <summary> /// Evaluates whether the meeting is over or not. /// </summary> /// <param name="meeting">The meeting.</param> /// <returns>Returns <c>true</c> if the meeting is over, <c>false</c> otherwise.</returns> internal static bool IsOver(this IMeetingInfo meeting) { if (meeting == null) { throw new ArgumentNullException(nameof(meeting), "The meeting parameter can not be null."); } return(meeting.EndTime <= DateTime.Now.CalibrateToMinutes()); }
/// <summary> /// Gets the post save message the bot will send to the channel. /// /// Returns null to use specifying to use a default message. /// </summary> public string GetPostSaveMessage(IMeetingInfo meetingInfo) { if (string.IsNullOrWhiteSpace(this.PostSaveMessage)) { return(null); } return(ReplaceAll(this.PostSaveMessage, meetingInfo)); }
/// <summary> /// Gets the post save action the bot needs to run as a subprocess. /// /// Returns null if no action was specified. /// </summary> public string GetPostSaveAction(IMeetingInfo meetingInfo) { if (string.IsNullOrWhiteSpace(this.PostSaveAction)) { return(null); } return(ReplaceAll(this.PostSaveAction, meetingInfo)); }
private string ReplaceAll(string input, IMeetingInfo meetingInfo) { input = ReplaceWithMeetingInfo(input, meetingInfo); input = Regexes.FileNameConfigVariable.Replace(input, this.GetFileName(meetingInfo)); input = Regexes.MeetBotRootConfigVariable.Replace(input, this.meetbotRoot); input = Regexes.FullFilePathConfigVariable.Replace(input, this.GetFullOutputPath(meetingInfo)); return(input); }
private string ReplaceWithMeetingInfo(string input, IMeetingInfo meetingInfo) { input = Regexes.ChannelConfigVariable.Replace(input, meetingInfo.Channel); input = Regexes.MeetingTopicConfigVariable.Replace(input, meetingInfo.MeetingTopic); input = Regexes.TimeStampConfigVariable.Replace( input, meetingInfo.StartTime.ToString(this.TimeStampFormat, this.TimeStampCulture) ); input = Regexes.GeneratorTypeConfigVariable.Replace(input, this.Type.ToString()); return(input); }
// ---------------- Constructor ---------------- public Meeting(IMeetingInfo meetingInfo, IEnumerable <string> botAdmins) { this.MeetingInfo = meetingInfo; this.meetingNotes = new List <MeetingNote>(); this.MeetingNotes = this.meetingNotes.AsReadOnly(); this.chairs = new HashSet <string>(); this.Chairs = this.chairs; this.silencedUsers = new HashSet <string>(); this.SilencedUsers = silencedUsers; this.bannedUsers = new HashSet <string>(); this.BannedUsers = bannedUsers; this.botAdmins = botAdmins; this.chairs.Add(meetingInfo.Owner); }